From 2981a8ab00f15f70c0b283779a787c6761cadc40 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 16 Jul 2021 18:22:16 -0700 Subject: [PATCH] fix(swingset): addEgress should cause an import/reachable refcount `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 --- packages/SwingSet/src/vats/comms/clist-xgress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SwingSet/src/vats/comms/clist-xgress.js b/packages/SwingSet/src/vats/comms/clist-xgress.js index d61fc7e10d5..0e3f37bef6d 100644 --- a/packages/SwingSet/src/vats/comms/clist-xgress.js +++ b/packages/SwingSet/src/vats/comms/clist-xgress.js @@ -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