|
From: Florian K. <br...@ac...> - 2011-10-27 04:16:17
|
helgrind/tests/cond_timedwait_invalid is failing on x86-linux.
There is an additional line in the backtrace. Unfiltered, the
backtrace looks like this:
==28111== Thread #1's call to pthread_cond_timedwait failed
==28111== with error code 22 (EINVAL: Invalid argument)
==28111== at 0x4029F3B: pthread_cond_timedwait_WRK (hg_intercepts.c:784)
==28111== by 0x4029F7F: pthread_cond_timedwait@* (hg_intercepts.c:797)
==28111== by 0x4125DF3: pthread_cond_timedwait@@GLIBC_2.3.2
(forward.c:152)
==28111== by 0x80485DF: main (cond_timedwait_invalid.c:22)
Note the line referring to pthread_cond_timedwait@@GLIBC_2.3.2
which should not be there because pthread_cond_timedwait is
supposed to be intercepted and wrapped.
I poked around a bit and found that this testcase is linked against -lrt
instead of -lpthread. (why?) If we linked against -lpthread instead the
...@@GLIBC_2.3.2.... line is gone. But that would only cure the symptom.
It seems that on my system the symbol pthread_cond_timedwait exists in
two places:
(1) /usr/lib/debug/lib/libc-2.12.1.so
$ nm /usr/lib/debug/lib/libc-2.12.1.so | grep pthread_cond_timedwait
000dddb0 T pthread_cond_timedwait@@GLIBC_2.3.2
0010fa50 T pthread_cond_timedwait@GLIBC_2.0
(2) /usr/lib/debug/lib/libpthread-2.12.1.so
$ nm /usr/lib/debug/lib/libpthread-2.12.1.so | grep
pthread_cond_timedwait
0000a730 T pthread_cond_timedwait@@GLIBC_2.3.2
0000ae50 T pthread_cond_timedwait@GLIBC_2.0
And both these libraries get loaded. Running with --trace-symtab=yes
--trace-redir=yes
--28287-- Reading syms from /lib/libc-2.12.1.so (0x4048000)
......
raw symbol [7032]: GLO FUN : svma 0x00000dddb0, sz 74
pthread_cond_timedwait@@GLIBC_2.3.2
rec(t) [7032]: val 0x0004125db0, sz 74
pthread_cond_timedwait@@GLIBC_2.3.2
--28287-- Reading syms from /lib/libpthread-2.12.1.so (0x41a5000)
......
raw symbol [ 575]: GLO FUN : svma 0x000000a730, sz 715
pthread_cond_timedwait@@GLIBC_2.3.2
rec(t) [ 575]: val 0x00041af730, sz 715
pthread_cond_timedwait@@GLIBC_2.3.2
......
==28287== Adding active redirection:
--28287-- new: 0x041af730 (pthread_cond_timedwait@@GLIBC_2.3.2) W->
(0000.0) 0x04029f69 pthread_cond_timedwait@*
--28287-- REDIR: 0x41af730 (pthread_cond_timedwait@@GLIBC_2.3.2)
redirected to 0x4029f69 (pthread_cond_timedwait@*)
Does this look like a problem in the redirection machinery?
If so, any pointers how to debug this further would be welcome.
Florian
|