This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/91910 fix data race in Debug Mode destructors
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, leon zadorin <leonleon77 at gmail dot com>
- Date: Fri, 27 Sep 2019 17:21:14 +0100
- Subject: Re: [PATCH] PR libstdc++/91910 fix data race in Debug Mode destructors
- References: <20190926131959.GA3393@redhat.com> <60ec779f-86d2-1ab4-667b-0dcaab030e61@gmail.com>
On 27/09/19 18:07 +0200, François Dumont wrote:
On 9/26/19 3:20 PM, 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.
Thanks to the additional _M_sequence check in _M_detach_single() this
patch looks good.
Thanks, it's now committed to trunk.
We might want to backport this. I'll leave it on trunk for a while
first though.