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): fix GC handling of orphaned objects #3379

Merged
merged 1 commit into from
Jun 21, 2021
Merged

Conversation

warner
Copy link
Member

@warner warner commented Jun 21, 2021

There were two bugs in the kernel's garbage-collection handling of orphaned
objects (exports of a vat which is later terminated).

closes #3376
closes #3377
refs #3378

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
@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 09:06
@warner warner self-assigned this Jun 21, 2021
@warner warner enabled auto-merge (rebase) June 21, 2021 09:07
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.

Seems legit.

@warner warner merged commit dcfe169 into master Jun 21, 2021
@warner warner deleted the 3376-gc-orphans branch June 21, 2021 17:00
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
2 participants