On 03/10/12 00:06, John Rocha wrote:
> I'm finding what appears to be a data race in the std::string class. Although 
> I
> find that hard to believe.
>
> I am using libstdc++ 6.0.8, with g++ version 4.1.2 that is using the posix
> thread model, on a Linux machine running SuSE SLES10SP1
>
>      Linux <hostname> 2.6.16.46-0.12-smp #1 SMP Thu May 17 14:00:09 UTC 2007
>      i686 i686 i386 GNU/Linux
>
> My machine has 2 cores (or 4 hyper threads).
>
> My application is a multithreaded, using boost threads, which in turn is using
> posix pthreads under the sheets.
>
>
> Below is one of many reports that all seem to be variations on the same
> thing. If I read this correctly it is indicating that std::string in thread 1
> and thread 8 are potentially racing.
>
> thread1 and thread8 are absolutely not sharing any strings. Thread8's string 
> is
> a local stack string, and thread1's string appears to be another stack string
> from inside the libboost_program_options.so-1.43.0
>
> Am I reading this correctly? That there is a data race in the string class?

In old versions of libstdc++, yes. You might have run into gcc bug
#40518 (gcc.gnu.org/bugzilla/show_bug.cgi?id=40518). See also
http://stackoverflow.com/questions/3035313/cant-figure-out-where-race-condition-is-occuring.

Bart.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to