FA-90547 / Garbage collector invariants / Member archive
Reference processing: phantoms enqueued while referent is still finalizer-reachable · case 02
Cleanup actions run for objects that a pending finalizer can still reach.
Case contract
Each cycle: trace strong reachability from roots (weak and phantom references are not traced); weak references whose referent is not strongly reachable are cleared; pending finalizable objects that are not strongly reachable are queued for finalization once and resurrected together with everything they reach for this cycle; phantom references are enqueued only when their referent is not reachable even through the resurrected set; everything else is freed. Return per cycle the cleared weak refs, finalized objects, enqueued phantoms and freed objects.
Why this case matters
Reference-processing order decides whether code can observe resurrected or half-dead objects.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: finalizable object over two cycles | [{"finalize": [23], "freed": [26], "phantom": ["p1", "p2"], "weak": ["w1"]}, {"finalize": [], "freed": [23, 24, 25], "phantom": [], "weak": []}] | [{"finalize": [23], "freed": [26], "phantom": ["p2"], "weak": ["w1"]}, {"finalize": [], "freed": [23, 24, 25], "phantom": ["p1"], "weak": []}] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗