Commit b41d940
[release/9.0-staging] [mono] Missing memory barrier leads to crash in multi-threaded scenarios (#113740)
Backport of #113140
Issue #109410 appears to be a case where klass is 0 when we perform an isinst operation, but the cache and obj are nonzero and look like valid addresses. klass is either a compile-time (well, jit-time) constant or being fetched out of the cache (it looks like it can be either depending on some sort of rgctx condition).
This PR adds null checks in two places along with a memory barrier in the location where we believe an uninitialized cache is being published to other threads.
---------
Co-authored-by: Katelyn Gadd <kg@luminance.org>1 parent 51e319d commit b41d940
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6806 | 6806 | | |
6807 | 6807 | | |
6808 | 6808 | | |
| 6809 | + | |
6809 | 6810 | | |
6810 | 6811 | | |
6811 | 6812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1702 | 1702 | | |
1703 | 1703 | | |
1704 | 1704 | | |
1705 | | - | |
| 1705 | + | |
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
| |||
1743 | 1743 | | |
1744 | 1744 | | |
1745 | 1745 | | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1746 | 1751 | | |
1747 | 1752 | | |
1748 | 1753 | | |
| |||
0 commit comments