This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Port to 3.1 - Fix JIT_CheckedWriteBarrier on macOS #28051
Merged
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.
Port of dotnet/runtime#38242
In a change to enable Mojave hardened runtime support that was made last
year, a bug was introduced into the JIT_CheckedWriteBarrier. A
conditional relative jump before an updated piece of code that was jumping
after that piece of code was not updated and ended up jumping into the
middle of an instruction. Since that condition occurs only with specific
memory layout and it is very rare, that problem was not discovered until
now.
Customer impact
The bug is causing consistent crashes on some configurations of OSX machines while it works fine on others. Unity was hit by this problem. It was observed on the new Apple silicon devices when running under Rosetta 2 emulator, but it can occur on any x64 macOS device.
Regression?
Yes, introduced in 3.1.0
Testing
The original fix was supplied and tested by Unity
Risk
Low, this fix fixes an obvious bug in assembler helper code where a conditional jump jumps into the middle of an instruction and the app crashes.