Skip to content

[LoongArch64] Apply fixes for coreclr-interp on linux-loongarch64.#129887

Open
LuckyXu-HF wants to merge 1 commit into
dotnet:mainfrom
LuckyXu-HF:main-LA64
Open

[LoongArch64] Apply fixes for coreclr-interp on linux-loongarch64.#129887
LuckyXu-HF wants to merge 1 commit into
dotnet:mainfrom
LuckyXu-HF:main-LA64

Conversation

@LuckyXu-HF

Copy link
Copy Markdown
Contributor

Align PR#127919 to fix the InterpreterTester.sh failed like issue:#127860 on LA64.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 26, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@LuckyXu-HF

Copy link
Copy Markdown
Contributor Author

LA64 also hit the same issue like #127860 :

root@af0f9dca56cd:/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug# CORE_ROOT=$(pwd)/Tests/Core_Root DOTNET_TieredCompilation=0 ./JIT/interpreter/InterpreterTester/InterpreterTester.sh
BEGIN EXECUTION
/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/Tests/Core_Root//corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true 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: /runtime/src/coreclr/gcinfo/gcinfoencoder.cpp:723: void TGcInfoEncoder<InterpreterGcInfoEncoding>::SetStackBaseRegister(UINT32) [GcInfoEncoding = InterpreterGcInfoEncoding]: Assertion `regNum == 3 || 22 == regNum' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
Interpreted App returned 134
System.Exception: Interpreted App failed execution
   at InterpreterTester.RunTests() in /runtime/src/tests/JIT/interpreter/InterpreterTester.cs:line 30
   at __GeneratedMainWrapper.Main() in /runtime/artifacts/tests/coreclr/obj/linux.loongarch64.Debug/Managed/JIT/interpreter/InterpreterTester/XUnitWrapperGenerator/XUnitWrapperGenerator.XUnitWrapperGenerator/SimpleRunner.g.cs:line 7
Expected: 100
Actual: 101
END EXECUTION - FAILED

Fixed:

InterpreterTester.sh PASS
root@af0f9dca56cd:/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug# CORE_ROOT=$(pwd)/Tests/Core_Root DOTNET_TieredCompilation=0 ./JIT/interpreter/InterpreterTester/InterpreterTester.sh
BEGIN EXECUTION
/runtime/artifacts/tests/coreclr/linux.loongarch64.Debug/Tests/Core_Root/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true 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)
TestCallingConvention0Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention1Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6
TestCallingConvention2Rev: s = 1, 2
TestCallingConvention3Rev: v = 1, 2
TestCallingConvention4Rev: s = 1, 2, 3, 4, 5, 6
TestCallingConvention5Rev: s = 1, 2, 3, 4
TestCallingConvention6Rev: s = 1, 2, 3, 4
TestCallingConvention7Rev: s = 1, 2, 3, 4
TestCallingConvention8Rev: s = 1, 2, 3, 4
TestCallingConvention9Rev: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10Rev: a = 1, b = 2, c = 3
TestCallingConvention11Rev: s = 1, 2, 3
TestCallingConvention12Rev: 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
TestCallingConvention13Rev: a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, s = (9, 10, 11, 12)
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
TestCallingConvention: s = 
1
2
TestCallingConvention: s = 
1
2
3
4
5
6
TestCallingConvention: s = 
1
2
3
4
TestCallingConvention: s = 
1
2
3
4
TestCallingConvention: s = 
1
2
3
4
TestCallingConvention: s = 
1
2
3
4
TestCallingConvention9: a = 1, b = 2, c = 3, d = 4
TestCallingConvention10: a = 1, b = 2, c = 3
TestCallingConvention: 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)
Sum
Mul4
TestSwitch
PowLoop
TestJitFields
TestFields
TestStructRefFields
TestSpecialFields
TestFloat
TestConvOvf
TestConvOvfUn
TestConvBoundaries
TestLocalloc
TestVirtual
bc.NonVirtualMethod
bc.VirtualMethod
bc.GenericVirtualMethod
bc.GenericVirtualMethod<int>
bc.GenericVirtualMethod<string>
itest.VirtualMethod
itest.GenericVirtualMethod<int>
itest.GenericVirtualMethod<string>
bc.NonVirtualMethod
bc.VirtualMethod
bc.GenericVirtualMethod<int>
bc.GenericVirtualMethod<string>
itest.VirtualMethod
itest.GenericVirtualMethod<int>
itest.GenericVirtualMethod<string>
TestBoxing
TestArray
TestXxObj
TestSizeof
TestLdtoken
TestMdArray
TestExceptionHandling
1
2
3
Object reference not set to an instance of an object.
4
6
7
TestStringCtor
TestSharedGenerics
Test calls to shared generics from non-generic code
Test calls to shared generics from generic code (unshared generics)
Test calls to shared generics from generic code (shared generics)
Test isinst with shared generics (string)
Test castclass with shared generics (string)
Expected InvalidCastException from casting object to string[]
Test unbox.any with shared generics
Expected InvalidCastException from casting object to string
Test box with shared generics
Test classic unbox instruction with shared generics
Test newarr
Test new MD arr
TestDelegate
CallingFunc first time
Return CallingFunc first time
CallingFunc second time
Return CallingFunc second time
TestIntrinsics
Vector128.IsHardwareAccelerated=
False
X86Base.IsSupported=
False
ArmBase.IsSupported=
False
TestCalli
CallingFunc first time
Return CallingFunc first time
CallingFunc second time
Return CallingFunc second time
TestStaticVirtualGeneric_CodePointerCase
TestPreciseInitCctors
TestThreading_Interlocked_CompareExchange
TestRuntimeHelpers_IsReferenceOrContainsReferences
TestMemoryMarshal_GetArrayDataReference
Empty string length: 0
BitConverter.IsLittleEndian: True
IntPtr.Zero: 0, UIntPtr.Zero: 0
TestPInvoke
Hello world from pinvoke.dll!writeToStdout

calling missingPInvoke
caught #1
calling missingPInvokeWithMarshaling
caught #2
All tests passed successfully!
Interpreted App returned 100
Expected: 100
Actual: 100
END EXECUTION - PASSED

// Note that the regNum == 0 only occurs under interpreter.
assert(regNum == 3 || 22 == regNum || 0 == regNum);
#elif defined(TARGET_RISCV64)
assert(regNum == 2 || 8 == regNum);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @am11 , does riscv64 also need to modify here? I'm curious why riscv64 can pass the assertion here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuckyXu-HF, tests were passing in May #127919 (comment) so I'm not sure why it wasn't failing if you think it's needed there. Are you running the same test command (with Debug configuration), I can test with latest main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-loongarch64 area-VM-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants