[release/7.0-staging] [Mono] Look for Native Signal SIMD Context #89568
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #89467 to release/7.0-staging
/cc @fanyang-mono
Customer Impact
This PR contains the change to a customer reported issue (#62201). Without this change, an Arm64 Android app would crash when running on the x64 emulator with the debugger enabled. When an app is running in this environment, it looks like the
struct sigcontext __reserved
field is not laid out with thefpsimd_context
first, which caused an assertion in Mono code base. With this PR, Mono doesn't assume the first item in__reserved
is SIMD, instead it looks for it. If found, add SIMD registers information to MonoContext. If not found, fill the corresponding fields of MonoContext with zeros.Testing
Manually tested on windows with Visual Studio 2022 by following the customer provided reproduction steps. (#62201 (comment))
All tests passed on CI.
Risk
Very low. This change only affects platforms which don't have SIMD registers, which is very rare. Plus, this change has been thoroughly tested both manually and automatically with CI.