As of Cap'n Proto v3.0.0-alpha.10, RPC messages and their arenas are pooled and zeroed between reuses. This revealed a preexisting use-after-free bug in Wetware's pubsub code. This bug was formerly harmless, but now causes pubsub to publish and receive messages containing only null bytes. This PR corrects the issue by copying pubsub message data into and out of RPC arenas.
While working on this PR, I observed a one-off data race in the pubsub unit tests. I have not been able to reproduce this, so I have created https://github.com/wetware/ww/issues/67 to track the issue. Note that it is not clear whether this is a problem in Wetware or in Cap'n Proto, nor is it clear that this issue could appear in production. It may be an artifact of the test harness. Upstream maintainers have been notified, and we will continue to track this issue.
As of Cap'n Proto v3.0.0-alpha.10, RPC messages and their arenas are pooled and zeroed between reuses. This revealed a preexisting use-after-free bug in Wetware's pubsub code. This bug was formerly harmless, but now causes pubsub to publish and receive messages containing only null bytes. This PR corrects the issue by copying pubsub message data into and out of RPC arenas.
While working on this PR, I observed a one-off data race in the pubsub unit tests. I have not been able to reproduce this, so I have created https://github.com/wetware/ww/issues/67 to track the issue. Note that it is not clear whether this is a problem in Wetware or in Cap'n Proto, nor is it clear that this issue could appear in production. It may be an artifact of the test harness. Upstream maintainers have been notified, and we will continue to track this issue.