Commit 24fe22a
authored
Fix ordering for auto compaction in get_overloaded_cme()
Found through GC.stress + GC.auto_compact crashes in rubyGH-8932.
Previously, the compaction run within `rb_method_entry_alloc()` could
move the `def->body.iseq.cref` and `iseqptr` set up before the call and
leave the `def` pointing to moved addresses. Nothing was marking `def`
during that GC run.
Low probability reproducer:
GC.stress = true
GC.auto_compact = true
arr = []
alloc = 1000.times.map { [] }
alloc = nil
a = arr.first
GC.start1 parent ef72970 commit 24fe22a
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | 1036 | | |
1040 | 1037 | | |
1041 | 1038 | | |
1042 | 1039 | | |
1043 | 1040 | | |
1044 | 1041 | | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| |||
0 commit comments