CppServer
CppServer copied to clipboard
Data race in SSLClient
trafficstars
Testing an app built by clang with thread sanitizer showed a data race in ssl_client.cpp:
Imagine that while receiving data, an error occurs, it causes calling Disconnect, that causes calling onReset, where _pimpl is reset. But at the same time a different thread can try send data, using any of Send methods, that calls pimpl() method, that returns a reference, that might be reset in onReset method.