Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite scanForDeadObjects to avoid retire-without-drop #9942

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

warner
Copy link
Member

@warner warner commented Aug 22, 2024

Rewrite 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.

fixes #9939

@warner warner added SwingSet package: SwingSet liveslots requires vat-upgrade to deploy changes labels Aug 22, 2024
@warner warner self-assigned this Aug 22, 2024
Copy link

cloudflare-workers-and-pages bot commented Aug 22, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: c045163
Status: ✅  Deploy successful!
Preview URL: https://761d9c6a.agoric-sdk.pages.dev
Branch Preview URL: https://warner-9939-retire-without-d.agoric-sdk.pages.dev

View logs

@warner warner force-pushed the warner/9939-retire-without-drop branch 3 times, most recently from 479652d to 310c064 Compare August 26, 2024 08:37
@warner warner changed the title WIP: failing test rewrite scanForDeadObjects to avoid retire-without-drop Aug 26, 2024
@warner warner marked this pull request as ready for review August 26, 2024 08:39
@warner warner requested review from mhofman and gibson042 August 26, 2024 08:39
@warner
Copy link
Member Author

warner commented Aug 27, 2024

note: revert the test.skip from 064ff1a when this lands

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary review of the commit titled add tests for #9939 to both SwingSet and liveslots

@mhofman mhofman self-requested a review August 28, 2024 03:13
Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implicit approval from #9961

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review of comments in commit titled fix(liveslots): rewrite scanForDeadObjects to avoid retire-without-drop. I am still looking through the code changes, but wanted to provide early feedback on what I believe may be an important conceptual mistake regarding recognizable only imported presence.

packages/swingset-liveslots/src/boyd-gc.js Outdated Show resolved Hide resolved
packages/swingset-liveslots/src/boyd-gc.js Outdated Show resolved Hide resolved
packages/swingset-liveslots/src/boyd-gc.js Outdated Show resolved Hide resolved
@mhofman mhofman self-requested a review August 29, 2024 03:13
@warner warner force-pushed the warner/9939-retire-without-drop branch 2 times, most recently from 568549b to a47fa2c Compare August 30, 2024 00:56
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new logic looks sounds, matches the descriptions, and more importantly, is much clearer than before!

packages/swingset-liveslots/src/boyd-gc.js Outdated Show resolved Hide resolved
packages/swingset-liveslots/src/boyd-gc.js Outdated Show resolved Hide resolved
warner added 4 commits August 30, 2024 09:04
These tests will fail without the fixes in the next commit

One new test is disabled because of additional pending bugs that
interfere with the test setup (a combo of #9956 and #9959), which will
be re-enabled in PR #9961 (to address #8756 and others)
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
This reverts commit 064ff1a.

Now that the underlying issue is fixed, we can re-enable this
formerly-flaky test. Thanks @michaelfig for your patience.
@warner warner force-pushed the warner/9939-retire-without-drop branch from a47fa2c to c045163 Compare August 30, 2024 16:04
@warner warner added the automerge:rebase Automatically rebase updates, then merge label Aug 30, 2024
@mergify mergify bot merged commit ef9ed26 into master Aug 30, 2024
90 checks passed
@mergify mergify bot deleted the warner/9939-retire-without-drop branch August 30, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge liveslots requires vat-upgrade to deploy changes SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syscall.retireImports translation error (when deleting WeakSet)
3 participants