-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] Fix Mono Windows x86 build and runtime crash. #74639
[Mono] Fix Mono Windows x86 build and runtime crash. #74639
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics Issue DetailsWhen trying to validate a fix on Mono Windows x86, runtime crashed with stack overflow. After some investigation it turns out that Mono Windows x86 have SIMD disabled, but S.P.C was still build with
causing a stack overflow when called at runtime. There was already a fallback implemented in Mono to handle case where runtime is build without SIMD support but code calls There was also a warning in NOTE, Mono Windows x86 is not an official supported configuration, but can still be used for testing and validation of x86 codegen and runtime behaviors (Mono x86 is still supported on other platforms), so there is still a value fixing it when needed.
|
92d10be
to
0466cf8
Compare
0466cf8
to
4180ecc
Compare
Trying to validate a fix on x86 Windows Mono crashed runtime with stack overflow. After some investigation it turns out that Mono Windows x86 have SIMD disabled, but S.P.C was still build with System.Runtime.Intrinsics support and implementation of methods like get_IsSupported is implemented as follow: .method public hidebysig specialname static bool get_IsSupported() cil managed { // Code size 6 (0x6) .maxstack 8 IL_0000: call bool System.Runtime.Intrinsics.X86.Popcnt::get_IsSupported() IL_0005: ret } // end of method Popcnt::get_IsSupported causing a stack overflow when called at runtime. There was already a fallback implemented in Mono runtime to handle case where runtime is build without SIMD support but code calls get_IsHardwareAccelerated, fix extends that check to include get_IsSuppored as well. Fix also make sure we won't add support for System.Runtime.Intrinsics in S.P.C for Mono Windows x86 builds. There was also a warning in debugger-agent.c when building debug that caused build to fail, including fix for that as well.
de32ebd
to
ef43574
Compare
Looks like we have configurations that assumes fallback through runtime code, so can't add get_IsSupported check in this PR, so PR will only make sure Mono Windows x86 build includes the not supported source files into its build of affected System.Numerics classes. |
Several CI landes like llvmfullaot Linux x64 depends on fallback.
ef43574
to
df4fd65
Compare
Failure in Mono Linux argm64 Debug lane appears on other PR's and not related to changes done in this PR. |
When trying to validate a fix on Mono Windows x86, runtime crashed with stack overflow. After some investigation it turns out that Mono Windows x86 have SIMD disabled, but S.P.C was still build with
System.Runtime.Intrinsics
support and implementation of methods likeget_IsSupported
is implemented as follow:causing a stack overflow when called at runtime.
Fix make sure we won't add support for
System.Runtime.Intrinsics
in S.P.C for Mono Windows x86 builds.There was also a warning in
debugger-agent.c
when building debug that caused build to fail, including fix for that as well.NOTE, Mono Windows x86 is not an official supported configuration, but can still be used for testing and validation of x86 codegen and runtime behaviors (Mono x86 is still supported on other platforms), so there is still a value fixing it when needed.