[PATCH] PR libstdc++/91910 fix data race in Debug Mode destructors
Jonathan Wakely
jwakely@redhat.com
Thu Sep 26 16:25:00 GMT 2019
On 26/09/19 14:20 +0100, Jonathan Wakely wrote:
>Fix data race when _Safe_iterator_base::_M_detach() runs concurrently with
>the _Safe_container_base destructor.
>
> PR libstdc++/91910
> * src/c++11/debug.cc (_Safe_iterator_base::_M_detach()): Load pointer
> atomically and lock the mutex before accessing the sequence.
> (_Safe_iterator_base::_M_reset()): Clear _M_sequence atomically.
>
>Tested x86_64-linux. I plan to commit this to trunk unless somebody
>sees a problem with it.
We need the same change in the _Safe_local_iterator_base::_M_detach()
function, as in this new patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2296 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190926/eb757117/attachment.bin>
More information about the Libstdc++
mailing list