|
From: Jorge M. <jor...@gm...> - 2010-06-05 00:52:14
|
I got a drd error in one of my programs, and searching on the web I found the following boost bug report, including a test sample reporting the same error found with drd. https://svn.boost.org/trac/boost/ticket/3526 with a similar error. There they seem to conclude that this is not a real problem, but I wanted to get your opinion. I can reproduce the error. I am running boost 1.43 and valgrind 11150M (with Bart's linker fix, thank you!!!). This is the test code they provide in the link above. // @file main.cpp #include </usr/local/include/boost/thread.hpp> using namespace boost; class Runner1 { public: void operator()() { sleep(2); } }; class Runner2 { public: void operator()() { sleep(2); } }; int main() { Runner1 r1; Runner2 r2; thread t1(r1); thread t2(r2); t1.join(); t2.join(); } This is my valgrind output when compiled with "g++ -l boost_thread main.cpp" valgrind --tool=drd ./a.out ==7014== drd, a thread error detector ==7014== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. ==7014== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info ==7014== Command: ./a.out ==7014== ==7014== Thread 3: ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 ==7014== at 0x4E41A23: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== Allocation context: BSS section of /usr/local/lib/libboost_thread.so.1.43.0 ==7014== Other segment start (thread 2) ==7014== at 0x58C8001: clone (clone.S:84) ==7014== Other segment end (thread 2) ==7014== at 0x5B66734: pthread_once (pthread_once.S:129) ==7014== by 0x4C30E2D: pthread_once (drd_pthread_intercepts.c:516) ==7014== by 0x4E47F43: boost::detail::get_once_per_thread_epoch() (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E4199F: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==7014== by 0x5B608B9: start_thread (pthread_create.c:300) ==7014== by 0x58C803C: clone (clone.S:112) ==7014== ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 ==7014== at 0x4E41A69: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== Allocation context: BSS section of /usr/local/lib/libboost_thread.so.1.43.0 ==7014== Other segment start (thread 2) ==7014== at 0x58C8001: clone (clone.S:84) ==7014== Other segment end (thread 2) ==7014== at 0x5B66734: pthread_once (pthread_once.S:129) ==7014== by 0x4C30E2D: pthread_once (drd_pthread_intercepts.c:516) ==7014== by 0x4E47F43: boost::detail::get_once_per_thread_epoch() (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E4199F: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==7014== by 0x5B608B9: start_thread (pthread_create.c:300) ==7014== by 0x58C803C: clone (clone.S:112) ==7014== Other segment start (thread 2) ==7014== at 0x58C8001: clone (clone.S:84) ==7014== Other segment end (thread 2) ==7014== at 0x5B66734: pthread_once (pthread_once.S:129) ==7014== by 0x4C30E2D: pthread_once (drd_pthread_intercepts.c:516) ==7014== by 0x4E47F43: boost::detail::get_once_per_thread_epoch() (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E4199F: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==7014== by 0x5B608B9: start_thread (pthread_create.c:300) ==7014== by 0x58C803C: clone (clone.S:112) ==7014== ==7014== Conflicting load by thread 3 at 0x05d71288 size 8 ==7014== at 0x5B5FECE: __nptl_deallocate_tsd (pthread_create.c:153) ==7014== Allocation context: BSS section of /lib/libpthread-2.11.1.so ==7014== Other segment start (thread 2) ==7014== at 0x58C8001: clone (clone.S:84) ==7014== Other segment end (thread 2) ==7014== at 0x4C2F283: pthread_mutex_lock (drd_pthread_intercepts.c:578) ==7014== by 0x4E419BB: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==7014== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==7014== by 0x5B608B9: start_thread (pthread_create.c:300) ==7014== by 0x58C803C: clone (clone.S:112) ==7014== ==7014== ==7014== For counts of detected and suppressed errors, rerun with: -v ==7014== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 66 from 66) |
|
From: Bart V. A. <bva...@ac...> - 2010-06-05 12:47:39
|
On Sat, Jun 5, 2010 at 2:52 AM, Jorge Moraleda <jor...@gm...> wrote: > > I got a drd error in one of my programs, and searching on the web I > found the following boost bug report, including a test sample > reporting the same error found with drd. > https://svn.boost.org/trac/boost/ticket/3526 with a similar error. > > There they seem to conclude that this is not a real problem, but I > wanted to get your opinion. I can reproduce the error. I am running > boost 1.43 and valgrind 11150M (with Bart's linker fix, thank you!!!). You are welcome to test Valgrind r11146 or later (unmodified) -- Julian has fixed the "mmap(...) failed in UME with error 22 (Invalid argument)" error message. > This is the test code they provide in the link above. > [ ... ] > This is my valgrind output when compiled with "g++ -l boost_thread main.cpp" > valgrind --tool=drd ./a.out > ==7014== drd, a thread error detector > ==7014== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. > ==7014== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info > ==7014== Command: ./a.out > ==7014== > ==7014== Thread 3: > ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 > ==7014== at 0x4E41A23: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) > [ ... ] Looks like a false positive on current_thread_tls_key to me, so I have added a suppression pattern in r11152. Bart. |
|
From: Jorge M. <jor...@gm...> - 2010-06-07 19:47:43
|
On Sat, Jun 5, 2010 at 5:47 AM, Bart Van Assche <bva...@ac...> wrote: > On Sat, Jun 5, 2010 at 2:52 AM, Jorge Moraleda <jor...@gm...> wrote: >> >> I got a drd error in one of my programs, and searching on the web I >> found the following boost bug report, including a test sample >> reporting the same error found with drd. >> https://svn.boost.org/trac/boost/ticket/3526 with a similar error. >> >> There they seem to conclude that this is not a real problem, but I >> wanted to get your opinion. I can reproduce the error. I am running >> boost 1.43 and valgrind 11150M (with Bart's linker fix, thank you!!!). > > You are welcome to test Valgrind r11146 or later (unmodified) -- > Julian has fixed the "mmap(...) failed in UME with error 22 (Invalid > argument)" error message. > >> This is the test code they provide in the link above. >> [ ... ] >> This is my valgrind output when compiled with "g++ -l boost_thread main.cpp" >> valgrind --tool=drd ./a.out >> ==7014== drd, a thread error detector >> ==7014== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. >> ==7014== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info >> ==7014== Command: ./a.out >> ==7014== >> ==7014== Thread 3: >> ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 >> ==7014== at 0x4E41A23: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) >> [ ... ] > > Looks like a false positive on current_thread_tls_key to me, so I have > added a suppression pattern in r11152. > > Bart. > Thank you Bart. I still get an error using r11158: ==19714== drd, a thread error detector ==19714== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. ==19714== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info ==19714== Command: ./a.out ==19714== ==19714== Thread 3: ==19714== Conflicting load by thread 3 at 0x0504c750 size 8 ==19714== at 0x4E41994: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== Allocation context: BSS section of /usr/local/lib/libboost_thread.so.1.43.0 ==19714== Other segment start (thread 2) ==19714== at 0x4C2F283: pthread_mutex_lock (drd_pthread_intercepts.c:578) ==19714== by 0x4E41A4D: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==19714== by 0x5B608B9: start_thread (pthread_create.c:300) ==19714== by 0x58C803C: clone (clone.S:112) ==19714== Other segment end (thread 2) ==19714== at 0x4C2FE7F: pthread_mutex_unlock (drd_pthread_intercepts.c:631) ==19714== Other segment start (thread 2) ==19714== at 0x4C2F283: pthread_mutex_lock (drd_pthread_intercepts.c:578) ==19714== by 0x4E419BB: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==19714== by 0x5B608B9: start_thread (pthread_create.c:300) ==19714== by 0x58C803C: clone (clone.S:112) ==19714== Other segment end (thread 2) ==19714== at 0x4C2FE7F: pthread_mutex_unlock (drd_pthread_intercepts.c:631) ==19714== by 0x4E41A32: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41D98: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4E41F54: thread_proxy (in /usr/local/lib/libboost_thread.so.1.43.0) ==19714== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==19714== by 0x5B608B9: start_thread (pthread_create.c:300) ==19714== by 0x58C803C: clone (clone.S:112) ==19714== ==19714== ==19714== For counts of detected and suppressed errors, rerun with: -v ==19714== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 46 from 46) |
|
From: Bart V. A. <bva...@ac...> - 2010-06-07 20:02:17
|
On Mon, Jun 7, 2010 at 9:47 PM, Jorge Moraleda <jor...@gm...> wrote: > > On Sat, Jun 5, 2010 at 5:47 AM, Bart Van Assche <bva...@ac...> wrote: > > On Sat, Jun 5, 2010 at 2:52 AM, Jorge Moraleda <jor...@gm...> wrote: > >> > >> I got a drd error in one of my programs, and searching on the web I > >> found the following boost bug report, including a test sample > >> reporting the same error found with drd. > >> https://svn.boost.org/trac/boost/ticket/3526 with a similar error. > >> > >> There they seem to conclude that this is not a real problem, but I > >> wanted to get your opinion. I can reproduce the error. I am running > >> boost 1.43 and valgrind 11150M (with Bart's linker fix, thank you!!!). > > > > You are welcome to test Valgrind r11146 or later (unmodified) -- > > Julian has fixed the "mmap(...) failed in UME with error 22 (Invalid > > argument)" error message. > > > >> This is the test code they provide in the link above. > >> [ ... ] > >> This is my valgrind output when compiled with "g++ -l boost_thread main.cpp" > >> valgrind --tool=drd ./a.out > >> ==7014== drd, a thread error detector > >> ==7014== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. > >> ==7014== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info > >> ==7014== Command: ./a.out > >> ==7014== > >> ==7014== Thread 3: > >> ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 > >> ==7014== at 0x4E41A23: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) > >> [ ... ] > > > > Looks like a false positive on current_thread_tls_key to me, so I have > > added a suppression pattern in r11152. > > > > Bart. > > > > Thank you Bart. I still get an error using r11158: > > ==19714== drd, a thread error detector > ==19714== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. > ==19714== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info > ==19714== Command: ./a.out > ==19714== > ==19714== Thread 3: > ==19714== Conflicting load by thread 3 at 0x0504c750 size 8 > ==19714== at 0x4E41994: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) > [ ... ] DRD still reports this on your system because no debug information was loaded for libboost_thread. Installing a package called boost-debuginfo or similar should fix this. Bart. |
|
From: Jorge M. <jor...@gm...> - 2010-06-08 02:06:29
|
On Mon, Jun 7, 2010 at 1:02 PM, Bart Van Assche <bva...@ac...> wrote: > On Mon, Jun 7, 2010 at 9:47 PM, Jorge Moraleda <jor...@gm...> wrote: >> >> On Sat, Jun 5, 2010 at 5:47 AM, Bart Van Assche <bva...@ac...> wrote: >> > On Sat, Jun 5, 2010 at 2:52 AM, Jorge Moraleda <jor...@gm...> wrote: >> >> >> >> I got a drd error in one of my programs, and searching on the web I >> >> found the following boost bug report, including a test sample >> >> reporting the same error found with drd. >> >> https://svn.boost.org/trac/boost/ticket/3526 with a similar error. >> >> >> >> There they seem to conclude that this is not a real problem, but I >> >> wanted to get your opinion. I can reproduce the error. I am running >> >> boost 1.43 and valgrind 11150M (with Bart's linker fix, thank you!!!). >> > >> > You are welcome to test Valgrind r11146 or later (unmodified) -- >> > Julian has fixed the "mmap(...) failed in UME with error 22 (Invalid >> > argument)" error message. >> > >> >> This is the test code they provide in the link above. >> >> [ ... ] >> >> This is my valgrind output when compiled with "g++ -l boost_thread main.cpp" >> >> valgrind --tool=drd ./a.out >> >> ==7014== drd, a thread error detector >> >> ==7014== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. >> >> ==7014== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info >> >> ==7014== Command: ./a.out >> >> ==7014== >> >> ==7014== Thread 3: >> >> ==7014== Conflicting store by thread 3 at 0x0504c750 size 8 >> >> ==7014== at 0x4E41A23: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) >> >> [ ... ] >> > >> > Looks like a false positive on current_thread_tls_key to me, so I have >> > added a suppression pattern in r11152. >> > >> > Bart. >> > >> >> Thank you Bart. I still get an error using r11158: >> >> ==19714== drd, a thread error detector >> ==19714== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. >> ==19714== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info >> ==19714== Command: ./a.out >> ==19714== >> ==19714== Thread 3: >> ==19714== Conflicting load by thread 3 at 0x0504c750 size 8 >> ==19714== at 0x4E41994: T.1292 (in /usr/local/lib/libboost_thread.so.1.43.0) >> [ ... ] > > DRD still reports this on your system because no debug information was > loaded for libboost_thread. Installing a package called > boost-debuginfo or similar should fix this. > Bart, Thank you again! I recompiled boost from source using: bjam variant=debug define=BOOST_LOG_USE_CHAR install and all the above warnings are gone. When I run the program, half of the time I get a clean output, the other 10% of the time I get the following: ==14837== drd, a thread error detector ==14837== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. ==14837== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info ==14837== Command: ./a.out ==14837== ==14837== Thread 3: ==14837== Conflicting load by thread 3 at 0x05d8a288 size 8 ==14837== at 0x5B78ECE: __nptl_deallocate_tsd (pthread_create.c:153) ==14837== Allocation context: BSS section of /lib/libpthread-2.11.1.so ==14837== Other segment start (thread 2) ==14837== at 0x58E1001: clone (clone.S:84) ==14837== Other segment end (thread 2) ==14837== at 0x4C2F283: pthread_mutex_lock (drd_pthread_intercepts.c:578) ==14837== by 0x4E53985: boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock(pthread_mutex_t*) (pthread_mutex_scoped_lock.hpp:25) ==14837== by 0x4E556A4: void boost::call_once<void (*)()>(boost::once_flag&, void (*)()) (once.hpp:55) ==14837== by 0x4E50938: boost::detail::set_current_thread_data(boost::detail::thread_data_base*) (thread.cpp:105) ==14837== by 0x4E509C3: thread_proxy (thread.cpp:118) ==14837== by 0x4C2EA60: vgDrd_thread_wrapper (drd_pthread_intercepts.c:272) ==14837== by 0x5B798B9: start_thread (pthread_create.c:300) ==14837== by 0x58E103C: clone (clone.S:112) ==14837== ==14837== ==14837== For counts of detected and suppressed errors, rerun with: -v ==14837== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 130 from 130) |
|
From: Bart V. A. <bva...@ac...> - 2010-06-08 16:38:23
|
On Tue, Jun 8, 2010 at 4:06 AM, Jorge Moraleda <jor...@gm...> wrote: > [ ... ] > I recompiled boost from source using: > bjam variant=debug define=BOOST_LOG_USE_CHAR install > > and all the above warnings are gone. When I run the program, half of > the time I get a clean output, the other 10% of the time I get the > following: > > ==14837== drd, a thread error detector > ==14837== Copyright (C) 2006-2010, and GNU GPL'd, by Bart Van Assche. > ==14837== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info > ==14837== Command: ./a.out > ==14837== > ==14837== Thread 3: > ==14837== Conflicting load by thread 3 at 0x05d8a288 size 8 > ==14837== at 0x5B78ECE: __nptl_deallocate_tsd (pthread_create.c:153) > [ ... ] I had a look at the implementation in glibc of the function __nptl_deallocate_tsd(). The function itself looks fine. So this kind of race report is probably caused by reuse of the memory for thread-local storage from a terminated thread by a newly created thread. I have added a suppression pattern for the above report. Bart. |