Repository navigation
Commit 7a058b5
committed
Pin refinement CCs to fix SEGV
We carry 9e5ef24 ("Reapply \"Fix check in cc_is_active\"") and
b6e3272 ("Reapply \"Simplify iseq mark_and_move CC handling\""),
which make refinement CCs actually live and movable, but not upstream
master's 8eab317 ("Convert cc_refinement_table into TypedData
object"), which replaced the address-keyed cc_refinement_table with an
array of declarative weak references.
With the address-keyed table, compaction relocating a refinement CC
rewrites the set entry's key but leaves it filed under the hash of the
old address, so rb_vm_delete_cc_refinement() can no longer find it when
the CC is freed and the table is left pointing at a recycled slot. The
next using/refine walks that entry: in debug builds it fails
"vm_method.c:664: invalidate_cc_refinement:vm_cc_refinement_p(cc)"
(seen in test-all as TestRefinement#test_refine_mutual_recursion),
otherwise it silently writes Qundef into an unrelated live object.
Pin them like we already do for method entries that are keys of the
overloaded_cme table, and add a regression test that reproduces the
assertion 100% of the time without this change.1 parent 2f8b396 commit 7a058b5
2 files changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
382 | 388 | | |
383 | 389 | | |
384 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
164 | 206 | | |
165 | 207 | | |
166 | 208 | | |
| |||
0 commit comments