Hi,
I've just run Synopsys Coverity, version 2020.03, static analysis on Boost v 1_75_0
It has highlighted several potential issues one of which I will describe here.
In scopedlock.hpp there is a mutex and a Boolean guard around the mutex. ‘locked’ is checked prior to locking and unlocking the mutex and then set to true or false respectively.
This, to me and the Coverity static analysis, creates a data race condition. Is that a false positive in the static analysis tool? What am I missing?
The issue can be also reproduced by running Coverity static analysis on this boost example server:
https://www.boost.org/doc/libs/1_75_0/doc/html/boost_asio/example/cpp03/ssl/server.cpp
Hi, I've just run Synopsys Coverity, version 2020.03, static analysis on Boost v 1_75_0 It has highlighted several potential issues one of which I will describe here. In scopedlock.hpp there is a mutex and a Boolean guard around the mutex. ‘locked’ is checked prior to locking and unlocking the mutex and then set to true or false respectively. This, to me and the Coverity static analysis, creates a data race condition. Is that a false positive in the static analysis tool? What am I missing? The issue can be also reproduced by running Coverity static analysis on this boost example server: https://www.boost.org/doc/libs/1_75_0/doc/html/boost_asio/example/cpp03/ssl/server.cpp
Thanks, Dimitar