Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Dmitry Vyukov
Thank you. Yes, I am covered by the Google copyright assignment, and I have commit access. I don't commit frequently, hope I didn't mess up things fundamentally :) https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=227403 On Wed, Sep 2, 2015 at 4:08 PM, Jonathan Wakely wrote: > On 02/09/15

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Jonathan Wakely
On 02/09/15 16:01 +0200, Dmitry Vyukov wrote: Added comment to _M_dispose and restored ChangeLog entry. Please take another look. Thanks, this is OK for trunk. I assume you are covered by the Google company-wide copyright assignment, so someone just needs to commit it, which I can do if you li

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Jonathan Wakely
On 02/09/15 15:49 +0200, Dmitry Vyukov wrote: On Wed, Sep 2, 2015 at 12:58 PM, Marc Glisse wrote: On Tue, 1 Sep 2015, Dmitry Vyukov wrote: The refcounted basic_string implementation contains several data races on _M_refcount: There are several bug reports about races in basic_string in bug

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Dmitry Vyukov
Added comment to _M_dispose and restored ChangeLog entry. Please take another look. On Wed, Sep 2, 2015 at 3:17 PM, Jonathan Wakely wrote: > On 01/09/15 17:42 +0200, Dmitry Vyukov wrote: >> >> On Tue, Sep 1, 2015 at 5:08 PM, Jonathan Wakely >> wrote: >>> >>> On 01/09/15 16:56 +0200, Dmitry Vyuk

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Dmitry Vyukov
On Wed, Sep 2, 2015 at 12:58 PM, Marc Glisse wrote: > On Tue, 1 Sep 2015, Dmitry Vyukov wrote: > >> The refcounted basic_string implementation contains several data races >> on _M_refcount: > > > There are several bug reports about races in basic_string in bugzilla (some > might even have been clo

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Jonathan Wakely
On 01/09/15 17:42 +0200, Dmitry Vyukov wrote: On Tue, Sep 1, 2015 at 5:08 PM, Jonathan Wakely wrote: On 01/09/15 16:56 +0200, Dmitry Vyukov wrote: I don't understand how a new gcc may not support __atomic builtins on ints. How it is even possible? That's a portable API provided by recent gcc'

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-02 Thread Marc Glisse
On Tue, 1 Sep 2015, Dmitry Vyukov wrote: The refcounted basic_string implementation contains several data races on _M_refcount: There are several bug reports about races in basic_string in bugzilla (some might even have been closed as wontfix because of the new implementation). Does this als

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-01 Thread Dmitry Vyukov
On Tue, Sep 1, 2015 at 5:08 PM, Jonathan Wakely wrote: > On 01/09/15 16:56 +0200, Dmitry Vyukov wrote: >> >> I don't understand how a new gcc may not support __atomic builtins on >> ints. How it is even possible? That's a portable API provided by >> recent gcc's... > > > The built-in function is a

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-01 Thread Jonathan Wakely
On 01/09/15 16:56 +0200, Dmitry Vyukov wrote: I don't understand how a new gcc may not support __atomic builtins on ints. How it is even possible? That's a portable API provided by recent gcc's... The built-in function is always defined, but it might expand to a call to an external function in

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-01 Thread Dmitry Vyukov
On Tue, Sep 1, 2015 at 4:27 PM, Jonathan Wakely wrote: > On 01/09/15 14:51 +0200, Dmitry Vyukov wrote: >> >> Hello, >> >> The refcounted basic_string implementation contains several data races >> on _M_refcount: >> 1. _M_is_leaked loads _M_refcount concurrently with mutations of >> _M_refcount. Th

Re: [Patch, libstdc++] Fix data races in basic_string implementation

2015-09-01 Thread Jonathan Wakely
On 01/09/15 14:51 +0200, Dmitry Vyukov wrote: Hello, The refcounted basic_string implementation contains several data races on _M_refcount: 1. _M_is_leaked loads _M_refcount concurrently with mutations of _M_refcount. This loads needs to be memory_order_relaxed load, as _M_is_leaked predicate do