Skip to content

[RISC-V] Interpreter Test Fails #127860

@clamp03

Description

@clamp03

Description

JIT/interpreter/InterpreterTester/InterpreterTester.sh fails on RISCV64 docker (qemu).

Reproduction Steps

This is what I just used to build runtime and tests. (There must be better build configurations. :) )

Build Runtime

ROOTFS_DIR=<ROOTFS_PATH> ./build.sh -cross -arch riscv64 -rc Checked -lc Release -hc Checked -s clr+libs -p:UseLocalAppHostPack=true --cmakeargs -DFEATURE_IBCLOGGER=true --bootstrap

Build Tests

ROOTFS_DIR=<ROOTFS_PATH> ./src/tests/build.sh -riscv64 -Checked -priority1 -cross -p:UseLocalAppHostPack=true -p:LibrariesConfiguration=Release -p:SelfContained=false -p:PublishSingleFile=false

It fails with the below error message, however it built InterpreterTests which I want to test.

/work/dotnet/riscv/runtime/.dotnet/sdk/11.0.100-preview.3.26170.106/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(546,5): error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.linux-riscv64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'linux-riscv64'. [/work/dotnet/riscv/runtime/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj]

Tested on riscv64 docker

*. I set up the docker container 2 years ago. I tried to set up a new one with the same instructions, but I failed.

cd artifacts/tests/coreclr/linux.riscv64.Checked/
export CORE_ROOT=$PWD/Tests/Core_Root/
DOTNET_TieredCompilation=0 ./JIT/interpreter/InterpreterTester/InterpreterTester.sh

Expected behavior

InterpreterTester test pass

Actual behavior

BEGIN EXECUTION                                                                                                                                                                                                                               
/work/dotnet/riscv/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/Tests/Core_Root//corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=tru
e InterpreterTester.dll ''                                                                                                                                                                                                                    
TestCallingConvention0: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6                                                                                                                                                                              
TestCallingConvention1: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6                                                                                                                                                                              
TestCallingConvention9: a = 1, b = 2, c = 3, d = 4                                                                                                                                                                                            
TestCallingConvention10: a = 1, b = 2, c = 3                                                                                                                                                                                                  
TestCallingConvention11: s =                                                                                                                                                                                                                  
1                                                                                                                                                                                                                                             
2                                                                                                                                                                                                                                             
3                                                                                                                                                                                                                                             
TestCallingConvention12: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = a, k = 10, l = 11, m = 12                                                                                                                         
TestCallingConvention13: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)                                                                                                                                          
corerun: /work/dotnet/riscv/runtime/src/coreclr/gcinfo/gcinfoencoder.cpp:725: void TGcInfoEncoder<InterpreterGcInfoEncoding>::SetStackBaseRegister(UINT32) [GcInfoEncoding = InterpreterGcInfoEncoding]: Assertion `regNum == 2 || 8 == regNum
' failed.                                                                                                                                                                                                                                     
Interpreted App returned 134                                                                                                                                                                                                                  
System.Exception: Interpreted App failed execution                                                                                                                                                                                            
   at InterpreterTester.RunTests() in /work/dotnet/riscv/runtime/src/tests/JIT/interpreter/InterpreterTester.cs:line 30                                                                                                                       
   at __GeneratedMainWrapper.Main() in /work/dotnet/riscv/runtime/artifacts/tests/coreclr/obj/linux.riscv64.Checked/Managed/JIT/interpreter/InterpreterTester/XUnitWrapperGenerator/XUnitWrapperGenerator.XUnitWrapperGenerator/SimpleRunner.g
.cs:line 7                                                                                                                                                                                                                                    
Expected: 100                                                                                                                                                                                                                                 
Actual: 101                                                                                                                                                                                                                                   
END EXECUTION - FAILED 

At first, I think it needs to update value 0 of gcInfoEncoder->SetStackBaseRegister(0) in src/coreclr/interpreter/compiler.cpp.

When I updated this, it crashes with other error message.

estCallingConvention0: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention1: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention9: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10: a = 1, b = 2, c = 3
TestCallingConvention11: s = 
1
2
3
TestCallingConvention12: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, j = a, k = 10, l = 11, m = 12
TestCallingConvention13: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)
Interpreted App returned 139
System.Exception: Interpreted App failed execution
   at InterpreterTester.RunTests() in /work/dotnet/riscv/runtime/src/tests/JIT/interpreter/InterpreterTester.cs:line 30
   at __GeneratedMainWrapper.Main() in /work/dotnet/riscv/runtime/artifacts/tests/coreclr/obj/linux.riscv64.Checked/Managed/JIT/interpreter/InterpreterTester/XUnitWrapperGenerator/XUnitWrapperGenerator.XUnitWrapperGenerator/SimpleRunner.g.cs:line 7

I can't investigate further, because gdb is not working well on my computer.

Regression?

No response

Known Workarounds

No response

Configuration

  • Commit: 055e04b
  • Host: Ubuntu 25.10
  • Target: RISC-V docker

Other information

No response

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions