[release/6.0] Port #58410: Fix zero initialization use of "initReg" #62207
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 #58410 to release/6.0
Fixes #62103
Customer Impact
Silent bad codegen: in certain rare cases, a variable is not correctly zero initialized, possibly leading to incorrect results or crashes. Typically, this requires a single local variable that is a register-sized struct, marked as requiring zero initialization by the JIT.
The issue was originally found with internal "stress" testing late in .NET 6 product development, but the fix was not ported to the .NET 6 release branch. However, it was subsequently reported by an external F# customer on the 6.0 release.
This was a regression between .NET 5 and .NET 6 due to extensive struct optimization work in the JIT.
Testing
The fix has been in 'main' for 3 months, but wasn't ported to release/6.0 before release.
Risk
Low