Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] FullAOT build asserts at `class1 != ARG_CLASS_NO_CLASS' for EmptyStructs.dll #106071

Open
matouskozak opened this issue Aug 7, 2024 · 6 comments
Labels
arch-x64 area-Codegen-AOT-mono disabled-test The test is disabled in source code against the issue Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@matouskozak
Copy link
Member

matouskozak commented Aug 7, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=763399
Build error leg or test failing: AOT compile CoreCLR tests
Afffected CI: linux-x64 Release AllSubsets_Mono_MiniFullAot_RuntimeTests minifullaot (runtime-extra-platforms), linux-x64 Release AllSubsets_Mono_LLVMFULLAOT_RuntimeTests llvmfullaot (runtime-llvm)
Range of commits: 03b4c79...1337553

Crash dump

2024-08-01T22:17:44.4437150Z   Mono Ahead of Time compiler - compiling assembly /__w/1/s/artifacts/tests/coreclr/linux.x64.Release/JIT/Directed/StructABI/EmptyStructs/EmptyStructs.dll
2024-08-01T22:17:44.4437819Z   AOTID E87160E2-BE64-3040-7216-8519D54F4C66
2024-08-01T22:17:44.4438379Z   * Assertion at /__w/1/s/src/mono/mono/mini/mini-amd64.c:806, condition `class1 != ARG_CLASS_NO_CLASS' not met
2024-08-01T22:17:44.4438707Z   
2024-08-01T22:17:44.4438904Z   
2024-08-01T22:17:44.4439160Z   =================================================================
2024-08-01T22:17:44.4439382Z   	Native Crash Reporting
2024-08-01T22:17:44.4439612Z   =================================================================
2024-08-01T22:17:44.4439878Z   Got a SIGABRT while executing native code. This usually indicates
2024-08-01T22:17:44.4503811Z   a fatal error in the mono runtime or one of the native libraries 
2024-08-01T22:17:44.4504078Z   used by your application.
2024-08-01T22:17:44.4507375Z   =================================================================
2024-08-01T22:17:44.4507639Z   
2024-08-01T22:17:44.4507841Z   =================================================================
2024-08-01T22:17:44.4508094Z   	External Debugger Dump:
2024-08-01T22:17:44.4508310Z   =================================================================
2024-08-01T22:17:44.4508528Z   
2024-08-01T22:17:44.4508730Z   =================================================================
2024-08-01T22:17:44.4508995Z   	Native stacktrace:
2024-08-01T22:17:44.4510175Z   =================================================================
2024-08-01T22:17:44.4515383Z   	0x77209e3f97df - Unknown
2024-08-01T22:17:44.4515852Z   	0x77209e39f1be - Unknown
2024-08-01T22:17:44.4516289Z   	0x77209e3f9091 - Unknown
2024-08-01T22:17:44.4516991Z   	0x77209e746c90 - Unknown
2024-08-01T22:17:44.4517301Z   	0x77209e7970d4 - Unknown
2024-08-01T22:17:44.4517605Z   	0x77209e746bde - Unknown
2024-08-01T22:17:44.4517854Z   	0x77209e72f832 - Unknown
2024-08-01T22:17:44.4518019Z   	0x77209e49d904 - Unknown
2024-08-01T22:17:44.4518400Z   	0x77209e4ad256 - Unknown
2024-08-01T22:17:44.4518545Z   	0x77209e49dd6f - Unknown
2024-08-01T22:17:44.4518692Z   	0x77209e49ded5 - Unknown
2024-08-01T22:17:44.4518833Z   	0x77209e49df17 - Unknown
2024-08-01T22:17:44.4518980Z   	0x77209e3f376f - Unknown
2024-08-01T22:17:44.4519131Z   	0x77209e3d77f7 - Unknown
2024-08-01T22:17:44.4519275Z   	0x77209e3da791 - Unknown
2024-08-01T22:17:44.4519429Z   	0x77209e37b9fa - Unknown
2024-08-01T22:17:44.4519586Z   	0x77209e36f7e6 - Unknown
2024-08-01T22:17:44.4519737Z   	0x77209e36b59f - Unknown
2024-08-01T22:17:44.4519894Z   	0x77209e36182f - Unknown
2024-08-01T22:17:44.4520032Z   	0x77209e360378 - Unknown
2024-08-01T22:17:44.4520164Z   	0x77209e3d68a7 - Unknown
2024-08-01T22:17:44.4520293Z   	0x5d103e91b6d6 - Unknown
2024-08-01T22:17:44.4520417Z   	0x77209e730efb - Unknown
2024-08-01T22:17:44.4520551Z   	0x77209e730fbb - Unknown
2024-08-01T22:17:44.4520677Z   	0x5d103e9187e9 - Unknown
2024-08-01T22:17:44.4520769Z   
2024-08-01T22:17:44.4520885Z   =================================================================
2024-08-01T22:17:44.4521014Z   	Basic Fault Address Reporting
2024-08-01T22:17:44.4521146Z   =================================================================
2024-08-01T22:17:44.4521348Z   Memory around native instruction pointer (0x77209e7970d4):0x77209e7970c4  05 00 44 89 f2 89 de 89 c7 b8 ea 00 00 00 0f 05  ..D.............
2024-08-01T22:17:44.4521550Z   0x77209e7970d4  89 c3 f7 db 3d 00 f0 ff ff b8 00 00 00 00 0f 47  ....=..........G
2024-08-01T22:17:44.4521712Z   0x77209e7970e4  c3 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3  .H...[A\A]A^A_].
2024-08-01T22:17:44.4521859Z   0x77209e7970f4  0f 1f 40 00 4c 89 ef e8 90 ae ff ff e9 55 ff ff  ..@.L........U..
2024-08-01T22:17:44.6457478Z /__w/1/s/src/mono/msbuild/aot-compile.proj(19,9): error MSB3073: The command "/__w/1/s/artifacts/tests/coreclr/linux.x64.Release/Tests/Core_Root/corerun /__w/1/s/artifacts/tests/coreclr/linux.x64.Release/JIT/Directed/StructABI/EmptyStructs/EmptyStructs.dll" exited with code 134.

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "artifacts/tests/coreclr/linux.x64.Release/JIT/Directed/StructABI/EmptyStructs/EmptyStructs.dll\" exited with code 134.",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=763399
Error message validated: [artifacts/tests/coreclr/linux.x64.Release/JIT/Directed/StructABI/EmptyStructs/EmptyStructs.dll" exited with code 134.]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/7/2024 11:37:07 AM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@matouskozak matouskozak added arch-x64 blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' untriaged New issue has not been triaged by the area owner area-Codegen-AOT-mono Known Build Error Use this to report build issues in the .NET Helix tab labels Aug 7, 2024
@matouskozak
Copy link
Member Author

I think the failures got triggered by #104237 @tomeksowi .

It looks like Mono doesn't support this scenario:

/* Empty structs have a nonzero size, causing this assert to be hit */
if (sig->pinvoke)
g_assert (class1 != ARG_CLASS_NO_CLASS);

Do you know what changes would be required to make this work for Mono?

cc: @steveisok

@tomeksowi
Copy link
Contributor

tomeksowi commented Aug 7, 2024

I think the failures got triggered by #104237 @tomeksowi .

Sorry about breaking the build. #104237 JIT changes should be confined to RISC-V and LoongArch.

Do you know what changes would be required to make this work for Mono?

I'm not familiar with Mono but If I understand the code correctly quad stands for what System V ABI calls eightbyte. If so, it's the problem described in #104098. I made ActiveIssues to disable on System V the test cases in JIT/Directed/StructABI/EmptyStructs which have NO_CLASS eightbytes (the ones with standalone Empty arguments or Empty8Float) so it shouldn't get there. Is the problem Mono fails already when it sees a function signature with a NO_CLASS eightbyte? If so, I think only conditional compilation of these test cases would help.

@tomeksowi
Copy link
Contributor

One more thing, in VM we simply reclassify NO_CLASS eightbytes to INTEGER, see https://github.com/dotnet/runtime/pull/103799/files#diff-8b4d839010e3c7e363eb430d3efed40b0f9a01a7661e16f753374598ded88f8cR2695

Maybe Mono could do something similar, I'll try to build Mono and reproduce the issue.

@matouskozak
Copy link
Member Author

Is the problem Mono fails already when it sees a function signature with a NO_CLASS eightbyte? If so, I think only conditional compilation of these test cases would help.

I think that's the case.

One more thing, in VM we simply reclassify NO_CLASS eightbytes to INTEGER, see https://github.com/dotnet/runtime/pull/103799/files#diff-8b4d839010e3c7e363eb430d3efed40b0f9a01a7661e16f753374598ded88f8cR2695

Maybe Mono could do something similar, I'll try to build Mono and reproduce the issue.

Thank you, let me know how it goes.

@tomeksowi
Copy link
Contributor

I tried to build, the NO_CLASS to INTEGER reclassification did solve the test compilation of EmptyStruct but the build fails on other tests on my machine so I couldn't test it.

Another problem is in #105800 I'm adding reflection variants of the tests which also fail on Mono. Unfortunately I'm not familiar enough with Mono to investigate now.

I think it's best to turn off this test for System V Mono for now, these cases are needed mostly for RISC-V and LoongArch to confront passing structs according to hardware FP calling convention with native compilers, empty structs make for interesting cases because they add different field paddings.

@matouskozak matouskozak added disabled-test The test is disabled in source code against the issue and removed untriaged New issue has not been triaged by the area owner labels Aug 8, 2024
@matouskozak matouskozak added this to the 10.0.0 milestone Aug 8, 2024
@jeffschwMSFT jeffschwMSFT removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Sep 11, 2024
@jeffschwMSFT
Copy link
Member

removing 'blocking-clean-ci' as it has not failed in 30 days

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x64 area-Codegen-AOT-mono disabled-test The test is disabled in source code against the issue Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

No branches or pull requests

3 participants