-
Notifications
You must be signed in to change notification settings - Fork 212
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
does finalizeDroppedCollection() make syscalls sensitive to GC? #6760
Comments
cc @mhofman |
I finally looked at the code and concur this finalizer can have observable side effects.
As far as I understand, finalizers are run after the promise queue is drained and before setImmediate calls back. Since I don't see any metering disablement for finalizers, it seems that all of them (virtual objects and vref manager) run metered, which would further make consensus execution sensitive to worker gc, including organic. I filed #6795. |
I just did another pass and I agree: metering will be affected, but not syscalls.
So I'm pretty sure that no syscalls can happen because of this pathway. It's not as obvious as I'd like, because The next time we consider refactoring in this file, we should consider splitting Based on that, and since we have #6795 to track the metering variations (which come from all finalizers, not just |
What is the Problem Being Solved?
While studying the liveslots virtual-collection code, I ran across
finalizeDroppedCollection
:agoric-sdk/packages/SwingSet/src/liveslots/virtualReferences.js
Lines 612 to 614 in 669ad6d
This is wired to a FinalizationRegistry during initialization (in startVat):
agoric-sdk/packages/SwingSet/src/liveslots/virtualReferences.js
Lines 32 to 34 in 669ad6d
and can do things like call
voAwareWeakSetDeleter
:agoric-sdk/packages/SwingSet/src/liveslots/virtualObjectManager.js
Lines 355 to 371 in 669ad6d
which can do syscalls:
agoric-sdk/packages/SwingSet/src/liveslots/virtualReferences.js
Lines 514 to 519 in 669ad6d
I'm worried that this creates an additional syscall sensitivity to GC, like #6360 , because
finalizeDroppedCollection
does not go through apossiblyDeadSet
(which doesn't get serviced until BOYD).The task is to audit this pathway with whatever tools or techniques we come up with for #6360, determine whether it's an actual sensitivity, if so decide whether we care deeply enough to fix it, and then fix it. The fix will probably involve some kind of BOYD/
possiblyDeadSet
delay, where it doesn't matter when the finalizer runs, and nothing that could trigger a syscall (or influence other syscalls) can happen until a BOYD.Things to be wary of:
finalizeDroppedCollection
reducing virtual-reference refcounts (the "vref pillar") of other objects before BOYD, allowing them to be collected when e.g. their export pillar is dropped, which would cause different syscalls.cc @FUDCo
Description of the Design
Security Considerations
Test Plan
The text was updated successfully, but these errors were encountered: