vz icon indicating copy to clipboard operation
vz copied to clipboard

Shared data structure can be accessed concurrently

Open cfergeau opened this issue 3 years ago • 1 comments

Describe the bug

shouldAcceptNewConnectionHandlers is a global variable which will be accessed both from NewVirtioSocketListener and shouldAcceptNewConnectionHandler. NewVirtioSocketListener may be called from a different thread/go routine than the one shouldAcceptNewConnectionHandler will run in. We need to protect accesses to shouldAcceptNewConnectionHandlers with a mutex in order to avoid concurrency problems.

Patch from kata-container/vz doing this, rebased on top of master: https://github.com/Code-Hex/vz/compare/master...cfergeau:vz:kata

cfergeau avatar Oct 13 '22 12:10 cfergeau

I will fix them using cgo handler

Code-Hex avatar Oct 13 '22 15:10 Code-Hex