|
From: Bart V. A. <bar...@gm...> - 2006-08-26 12:21:25
|
Hello Julian, I don't have an answer yet why drd fails on pth_cvsimple. But when I enable mutex tracing in drd, it looks like threads 2 and 3 were able to both lock count_lock. How can I verify that the pthread_mutex_lock() implementation of libpthread.so.0 is called and not the implementation of libc.so.6 ? For most pthread functions there are dummy implementation present in glibc. > inst/bin/valgrind --tool=drd --trace-mutex=yes none/tests/pth_cvsimple ==13717== drd, a data race detector. ==13717== Copyright (C) 2006, and GNU GPL'd, by Bart Van Assche. THIS SOFTWARE IS A PROTOTYPE, AND IS NOT YET RELEASED ==13717== Using LibVEX rev 1579, a library for dynamic binary translation. ==13717== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==13717== Using valgrind-3.3.0.SVN, a dynamic binary instrumentation framework. ==13717== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==13717== For more details, rerun with: -v ==13717== --13717-- drd_post_mutex_lock tid = 1, mutex 0x401B2E0 rc 0 owner 0 --13717-- drd_pre_mutex_unlock tid = 1, mutex 0x401B2E0 rc 1 owner 1 --13717-- drd_post_mutex_lock tid = 2, mutex 0x8049A48 rc 0 owner 0 --13717-- drd_post_mutex_lock tid = 3, mutex 0x8049A48 rc 1 owner 2 --13717-- The impossible happened: mutex 0x8049A48 is locked simultaneously by two threads (recursion count 1, owners 2 and 3) ! drd: drd_mutex.c:96 (mutex_lock): the 'impossible' happened. ==13717== at 0x38007585: report_and_quit (m_libcassert.c:136) ==13717== by 0x380078AF: vgPlain_assert_fail (m_libcassert.c:200) ==13717== by 0x380021B8: mutex_lock (drd_mutex.c:96) ==13717== by 0x380016F3: drd_post_mutex_lock (drd_main.c:202) ==13717== by 0x380265EE: do_client_request (scheduler.c:1256) ==13717== by 0x38027C5B: vgPlain_scheduler (scheduler.c:872) ==13717== by 0x38046B63: run_a_thread_NORETURN (syswrap-linux.c:87) ==13717== by 0x38046DC3: vgModuleLocal_start_thread_NORETURN ( syswrap-linux.c:207) ==13717== by 0x38049088: (within /home/bart/software/valgrind-svn/inst/lib/valgrind/x86-linux/drd) ==13717== by 0x382450AF: temporary (in /home/bart/software/valgrind-svn/inst/lib/valgrind/x86-linux/drd) ==13717== by 0x8: ??? sched status: running_tid=3 Thread 1: status = VgTs_Yielding ==13717== at 0x410A648: clone (in /lib/libc-2.4.so) ==13717== by 0x403E9BC: pthread_create@@GLIBC_2.1 (in /lib/libpthread- 2.4.so) ==13717== by 0x401CAAF: pthread_create@* (vg_preloaded.c:135) ==13717== by 0x80486FF: main (pth_cvsimple.c:68) Thread 2: status = VgTs_WaitSys ==13717== at 0x40417E6: pthread_cond_wait@@GLIBC_2.3.2 (in /lib/libpthread-2.4.so) ==13717== by 0x401CB3A: vg_thread_wrapper (vg_preloaded.c:109) ==13717== by 0x403E34A: start_thread (in /lib/libpthread-2.4.so) ==13717== by 0x410A65D: clone (in /lib/libc-2.4.so) Thread 3: status = VgTs_Runnable ==13717== at 0x401C71D: pthread_mutex_lock (vg_preloaded.c:211) ==13717== by 0x80485F5: inc_count (pth_cvsimple.c:34) ==13717== by 0x401CB3A: vg_thread_wrapper (vg_preloaded.c:109) ==13717== by 0x403E34A: start_thread (in /lib/libpthread-2.4.so) ==13717== by 0x410A65D: clone (in /lib/libc-2.4.so) |