Skip to content

Commit

Permalink
fix(swingset): addEgress should cause an import/reachable refcount
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
warner committed Jul 22, 2021
1 parent 2635336 commit 2981a8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/SwingSet/src/vats/comms/clist-xgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function makeIngressEgress(state, provideLocalForRemote) {
const inboundRRef = makeRemoteSlot('object', true, remoteRefID);
remote.addRemoteMapping(inboundRRef, loid);
remote.skipRemoteObjectID(remoteRefID);
const isImportFromComms = false; // bug 3483: this should be 'true'
const isImportFromComms = true;
remote.setReachable(loid, isImportFromComms);

// prettier-ignore
Expand Down

0 comments on commit 2981a8a

Please sign in to comment.