You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell there is no race -- we serialise access to the buffer through errChan (the main thread waits for an error through errChan before reading -- and that only happens after the goroutine is finished writing). Your example code doesn't match what we're actually doing in runc. Using your example code, but modified to match what the code in runc, go run -race doesn't produce any panics:
If you remove the <-errChan, then there is a race. But that's not what we're doing. Closing, but please feel free to comment if you think I've missed something.
Hi,
This pr using
bytes.Buffer
cross goroutines which is not goroutines safety.I did a testing:
Run it with
-race
option should be panic.go run -race .
Thanks.
The text was updated successfully, but these errors were encountered: