[Bug libstdc++/91910] Debug mode: there is a racing condition between destructors of iterator and the associated container.
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 5 17:45:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91910
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:
https://gcc.gnu.org/g:9d0ad2d40ee86ad47913b06b7585d67bd216ce4f
commit r9-8348-g9d0ad2d40ee86ad47913b06b7585d67bd216ce4f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Mar 5 16:53:20 2020 +0000
PR libstdc++/91910 fix data race in Debug Mode destructors
Fix data race when _Safe_iterator_base::_M_detach() runs concurrently with
the _Safe_container_base destructor.
Backport from mainline
2019-09-27 Jonathan Wakely <jwakely@redhat.com>
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_local_iterator_base::_M_detach()): Likewise.
(_Safe_iterator_base::_M_reset()): Clear _M_sequence atomically.
More information about the Gcc-bugs
mailing list