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

comms doesn't mark addEgress as "reachable" #3483

Closed
warner opened this issue Jul 17, 2021 · 0 comments · Fixed by #3485
Closed

comms doesn't mark addEgress as "reachable" #3483

warner opened this issue Jul 17, 2021 · 0 comments · Fixed by #3485
Assignees
Labels
bug Something isn't working SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented Jul 17, 2021

Describe the bug

The comms addEgress method, which provides an out-of-band export operation (e.g. what you do on the chain when you're provisioning a client, to bootstrap the initial object reference), is failing to mark the downstream/importing c-list entry as "reachable". The result is that if the downstream machine ever drops the exported object, the refcount would go negative, causing an exception in the processing of that message.

The remote.setReachable() method takes an lref and an isImport boolean. The addEgress function was calling setReachable with "false" when it should have been "true". I think I confused myself with the parameter name: it doesn't mention which side is doing the importing. I'm going to replace that with isImportFromComms to make it more clear. Then I'll fix the flag and add a test.

@warner warner added bug Something isn't working SwingSet package: SwingSet labels Jul 17, 2021
@warner warner added this to the Testnet: Metering Phase milestone Jul 17, 2021
@warner warner self-assigned this Jul 17, 2021
warner added a commit that referenced this issue Jul 17, 2021
`addEgress` was calling `setReachable` with the wrong value for
`isImportFromComms`. When we add an egress, the kernel is exporting an object
into comms, and comms is exporting that to the downstream machine. So the
downstream machine is *importing* it from comms (which means the
`isReachable` flag causes the `reachable` refcount to be increased, something
that only happens on imports, not on the export).

This caused the object being exported through `addEgress` to have a zero
refcount. If/when the downstream machine ever dropped it, the refcount would
go negative, causing an error.

fixes #3483
warner added a commit that referenced this issue Jul 17, 2021
`addEgress` was calling `setReachable` with the wrong value for
`isImportFromComms`. When we add an egress, the kernel is exporting an object
into comms, and comms is exporting that to the downstream machine. So the
downstream machine is *importing* it from comms (which means the
`isReachable` flag causes the `reachable` refcount to be increased, something
that only happens on imports, not on the export).

This caused the object being exported through `addEgress` to have a zero
refcount. If/when the downstream machine ever dropped it, the refcount would
go negative, causing an error.

fixes #3483
warner added a commit that referenced this issue Jul 22, 2021
`addEgress` was calling `setReachable` with the wrong value for
`isImportFromComms`. When we add an egress, the kernel is exporting an object
into comms, and comms is exporting that to the downstream machine. So the
downstream machine is *importing* it from comms (which means the
`isReachable` flag causes the `reachable` refcount to be increased, something
that only happens on imports, not on the export).

This caused the object being exported through `addEgress` to have a zero
refcount. If/when the downstream machine ever dropped it, the refcount would
go negative, causing an error.

fixes #3483
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant