go-capnp icon indicating copy to clipboard operation
go-capnp copied to clipboard

Fix #306

Open zenhack opened this issue 2 years ago • 2 comments

Also, document the fact that ClientPromise.Fulfill steals the reference.

Mixing this up was the root cause of the issue. Specifically both Promise.ReleaseClients() and Message.Reset() were releasing the same clients, causing them to be invalid if later used.

This patch just adds a call to .AddRef() in the appropriate spot, so that the promise has its own references to the clients, as the API suggests.


N.B. this patch is stacked on top of #310 to avoid conflicts; that PR should be reviewed & merged first.

zenhack avatar Sep 27 '22 02:09 zenhack

Test suite is hanging; I got so excited when it fixed ocap-md I forgot to run the tests :sweat_smile:

Marking as a draft while I figure out what's wrong.

zenhack avatar Sep 27 '22 02:09 zenhack

Looks like the test failures are due to release messages not being sent, which is not a surprising symptom of a regression -- so I still have some debugging to do. Will look at it more tomorrow.

zenhack avatar Sep 27 '22 04:09 zenhack

I'm going to close this one. The ownership questions could use better documentation, but this is not the correct solution.

zenhack avatar Oct 23 '22 23:10 zenhack