Repository navigation
Commit 737e8bd
committed
fix(patch): mark ephemeron values reached from resurrected finalizer keys
* The resurrection closure drained via `MarkTransitiveClosureFixpoint()` in
the default worklist mode. Once the main closure ends in
`MarkTransitiveClosureLinear()`, unresolved ephemerons live in
`key_to_values_` rather than `next_ephemerons`, and only the
`kProcessRememberedEphemerons` mode consults that map -- so the values of
a resurrected WeakMap key were never marked.
* Linear is the common terminal path, not a rare fallback: `ProcessEphemeron`
reports progress for every `kUnresolved` entry, so a single persistently
unresolved ephemeron spins the fixpoint out to its iteration cap. A
resurrected key is itself such an entry, so the objects that trigger the
bug are the same ones that force the algorithm that exposes it.
* `ClearWeakCollections()` keeps any entry whose key is marked and inspects
the value only under VERIFY_HEAP, so the entry survived into a live table
with a value pointing at a page that sweeping then released.
* Drain in remembered-ephemerons mode before the fixpoint/linear pair. Sound
unconditionally: fixpoint success implies `key_to_values_` is empty, so the
block needs no flag telling it which algorithm ended the main closure, and
neither `SetKeyToValues`' nor `MarkTransitiveClosureLinear`'s DCHECK can
fire. `VerifyEphemeronMarking()` afterwards is a no-op outside
--verify-heap builds.1 parent fb6007e commit 737e8bd
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
| 375 | + | |
365 | 376 | | |
366 | 377 | | |
367 | 378 | | |
368 | 379 | | |
| 380 | + | |
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
| |||
0 commit comments