Skip to content

Commit

Permalink
fix(liveslots): rewrite scanForDeadObjects to avoid retire-without-drop
Browse files Browse the repository at this point in the history
This rewrites scanForDeadObjects(), which is called during
dispatch.bringOutYourDead to process possiblyDeadSet and
possiblyRetiredSet. The new flow should be easier to review and
understand.

The main behavioral difference is to fix a bug (#9939) in which a vref
that appears in possiblyRetiredSet (because e.g. a weak collection was
deleted, which was using that vref as a key), but which 1: lacks a RAM
pillar (Presence object) and 2: was not dropped in this BOYD (e.g. it
has a vdata pillar), used to be sent to the kernel in a bogus
`syscall.retireImports()` call. Because this vref was not previously
dropped by the vat (syscall.dropImports()), this was a vat-fatal
error.

The new code will only retire such a Presence vref if it was not
reachable by the vat.

The new tests are marked as expected to pass again.

thanks @mhofman and @gibson042 for recommendations

fixes #9939
  • Loading branch information
warner committed Aug 30, 2024
1 parent 4490a73 commit 7a09175
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 91 deletions.
2 changes: 1 addition & 1 deletion packages/SwingSet/test/gc/gc-vat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ test('forward to fake zoe', async t => {
});

// see #9939
test.failing('drop without retire', async t => {
test('drop without retire', async t => {
let targetID;
let didBOYD = false;
// const msgs = ['deliver', 'deliver-result', 'syscall', 'syscall-result'];
Expand Down
Loading

0 comments on commit 7a09175

Please sign in to comment.