"Interesting" behavior in std::locale
Jonathan Wakely
jwakely@redhat.com
Fri Oct 31 19:53:00 GMT 2014
On 31/10/14 12:07 -0400, James Benze wrote:
>I found this code because helgrind (valgrind's data-race finder) lit
>up like a lightbulb with all these placement-new calls to the same
>array. It's obviously safe...the locale returned by
>std::locale::classic is guaranteed never to change so it's essentially
>just writing the same chunk of memory over and over.
N.B. you need to rebuild the library with some helgrind annotations to
remove some false positives in the locale::_Impl code, see
https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html#debug.races
There may be other real races that helgind finds though.
More information about the Libstdc++
mailing list