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

fix(swingset): only mark refs for processing if refcount hits zero #3380

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

warner
Copy link
Member

@warner warner commented Jun 21, 2021

This should remove some unnecessary work done by processRefcounts on
objects which have lost one reference, but not all of them.

refs #3106

warner added 2 commits June 21, 2021 02:03
There were two bugs in the kernel's garbage-collection handling of orphaned
objects (exports of a vat which is later terminated).

* Sending a message to an orphaned vat caused the object's refcount to be
incremented, but never decremented again, preventing it from being collected.
The root cause was `kernelKeeper.kernelObjectExists` using `.owner` to decide
whether the object still exists. Orphaned objects have a `.refcount` but no
`.owner`. The fix is to  just test `.refcount` instead of `.owner`. #3376
* `kernelKeeper.processRefcounts()` wants to check the `isReachable` flag of
the exporting vat, to know whether they need a dropExport message, but
orphaned objects have no exporting vat anymore. The check crashed the kernel
when it attempted to get a vatKeeper for `undefined`. The immediate fix is to
skip this check for orphaned objects, which avoids the crash (#3377). But we
still need a fix to delete the refcount=0,0 entry (#3378).

closes #3376
closes #3377
refs #3378
This should remove some unnecessary work done by `processRefcounts` on
objects which have lost one reference, but not all of them.

refs #3106
@warner warner added the SwingSet package: SwingSet label Jun 21, 2021
@warner warner added this to the Testnet: Stress Test Phase milestone Jun 21, 2021
@warner warner requested a review from FUDCo June 21, 2021 15:57
@warner warner self-assigned this Jun 21, 2021
Base automatically changed from 3376-gc-orphans to master June 21, 2021 17:00
@warner warner enabled auto-merge (rebase) June 21, 2021 17:27
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

Still seems OK.

@warner warner merged commit 3354bbf into master Jun 21, 2021
@warner warner deleted the 3106-better-decref branch June 21, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants