Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::thread and helgrind
From: Frederick Roth (f-roth_at_[hidden])
Date: 2012-01-05 03:04:46


On Wed, 04 Jan 2012 22:01:01 +0100, Vicente J. Botet Escriba wrote:
> Le 04/01/12 09:46, Frederick Roth a écrit :
>> I am currently fooling around with boost::thread. After writing a
>> short example program (featuring boost::thread and
>> boost::interprocess::interprocess_semaphore), I ran helgrind against
>> it and got some "Possible data race" errors.
>>
>
> could you add the reported "possible data race"?

Sure:

==2743== Possible data race during read of size 4 at 0x46c6d32c by
thread #3
==2743== at 0x46C5FE93: ??? (in
/usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)
==2743== This conflicts with a previous write of size 4 by thread #2
==2743== at 0x46C5FFA1: ??? (in
/usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x46C601A4:
boost::detail::set_current_thread_data(boost::detail::thread_data_base*)
(in /usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)
==2743==
==2743== Possible data race during read of size 4 at 0x46c6d328 by
thread #3
==2743== at 0x46C5FE99: ??? (in
/usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)
==2743== This conflicts with a previous write of size 4 by thread #2
==2743== at 0x46C5FF8C: ??? (in
/usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x46C601A4:
boost::detail::set_current_thread_data(boost::detail::thread_data_base*)
(in /usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)
==2743==
==2743== Possible data race during read of size 4 at 0x46c6d38c by
thread #3
==2743== at 0x46C680CF: boost::detail::get_once_per_thread_epoch()
(in /usr/lib/libboost_thread-mt.so.1.47.0)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)
==2743== This conflicts with a previous write of size 4 by thread #2
==2743== at 0x467FD6F9: pthread_key_create (in
/lib/libpthread-2.14.90.so)
==2743== by 0x467F8CD2: start_thread (in /lib/libpthread-2.14.90.so)
==2743== by 0x4670283D: clone (in /lib/libc-2.14.90.so)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net