-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drd/tests/dlopen is failing #57
Comments
The assert is firing whilst servicing a client request, VG_USERREQ__SET_PTHREADID It fires because the threadid is neither new nor equal to the existing one. This can be either from In reverse order DRD_(set_pthread_id) has two callers, pthread_create_intercept again with a note to see B.Z. 356374. and also
Looks like we're on to something there |
There are 2 calls to DRD_(thread_set_pthreadid) with the second one failing. This first has pid 1 and ptid 80165632. (gdb) p vgPlain_get_and_pp_StackTrace(1, 6) (gdb) p *vgDrd_g_threadinfo $11 = {sg_first = 0x0, sg_last = 0x0, vg_threadid = 0, pt_threadid = 0, stack_min_min = 0, stack_min = 0, stack_startup = 0, stack_max = 0, stack_size = 0, name = '\000' <repeats 63 times>, on_alt_stack = 0 '\000', valid = 0 '\000', vg_thread_exists = 0 '\000', so the assert is OK This one is called because void DRD_(init) is marked with attribute constructor. It makes a call to VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__SET_PTHREADID, with pthread_self() The above is executing as client code afaict, so not easy to debug the pid that it gets tl_assert(DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID because DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID is true Second time round, pid is still 1 and ptid is 88080432 (gdb) p vgPlain_get_and_pp_StackTrace(1, 6) But now g_threadinfo)[tid].pt_threadid has the value from the first call. But, the threadid is different. Could hack this by not doing that 1st call. Perhaps some init is bad, and the 1st is wrong? |
Workaround: LD_PRELOAD=/lib/libthr.so.3 |
In main: creating thread 1
drd: drd_thread.c:611 (vgDrd_thread_set_pthreadid): Assertion 'DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID || DRD_(g_threadinfo)[tid].pt_threadid == ptid' failed.
host stacktrace:
==38047== at 0x3802761C: ??? (in /usr/home/paulf/scratch/valgrind/drd/drd-amd64-freebsd)
==38047== by 0x380AE026: ??? (in /usr/home/paulf/scratch/valgrind/drd/drd-amd64-freebsd)
==38047== by 0xDEADBEEFDEADBEEE: ???
sched status:
running_tid=1
Thread 1: status = VgTs_Runnable (lwpid 101560)
==38047== at 0x4A5128B: vgDrd_set_pthread_id (drd_pthread_intercepts.c:526)
==38047== by 0x4A513D4: pthread_create_intercept (drd_pthread_intercepts.c:584)
==38047== by 0x4A513D4: pthread_create (drd_pthread_intercepts.c:602)
==38047== by 0x58006A1: foo (dlopen_lib.c:22)
==38047== by 0x4009EA: main (dlopen_main.c:26)
client stack range: [0x7FEFFD000 0x7FF000FFF] client SP: 0x7FF0001F0
valgrind stack range: [0x40298E000 0x402A8DFFF] top usage: 12620 of 1048576
Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.
If that doesn't help, please report this bug to: www.valgrind.org
In the bug report, send all the above text, the valgrind
version, and what OS and version you are using. Thanks.
The text was updated successfully, but these errors were encountered: