This repository has been archived by the owner on May 26, 2022. It is now read-only.
likely data race in NewSwarm's use of context #189
Labels
kind/bug
A bug in existing code (including security flaws)
This is a partial trace, because I assume it's enough for you to realise what's going on. My assumption is that, in the lines below in
swarm.go
, it's possible to reads.ctx
at the same time as it's being set:I haven't been able to craft a main.go that reproduces the race reliably, unfortunately. This only happens as part of a non-trivial test. I can provide more details privately, if you prefer.
Continuing with my assumptions - I assume we should be setting
s.ctx
before it's ever used in any way. I don't know thegoprocessctx
package well, though. At the end of the test, we callhost.Close
andcancel
on the context used inlibp2p.Config.NewNode
, in that order. Perhaps that's wrong, given #59.The text was updated successfully, but these errors were encountered: