Date: Sun, 20 Dec 2020 09:42:47 +0100 From: Paul Floyd <pjfloyd@wanadoo.fr> To: freebsd-hackers@freebsd.org Subject: Re: pthread_self() problem in DRD Message-ID: <56cf3993-778e-be75-bd2f-39fbe90e83c8@wanadoo.fr> In-Reply-To: <b40521bc-04c7-d302-d635-a92214fa2152@wanadoo.fr> References: <61236c3a-05b8-7986-e95d-a9369eaf522b@wanadoo.fr> <X93wG%2BZWC5uPZJSR@kib.kiev.ua> <b40521bc-04c7-d302-d635-a92214fa2152@wanadoo.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
Soooo ...
Quicky test
paulf> LD_PRELOAD=/lib/libthr.so.3 ../../vg-in-place --tool=drd -q
./dlopen_main ./dlopen_lib.so
In main: creating thread 1
Hello World! It's me, thread #1!
No assert, so I have a workaround at least
If I add
#if defined(VGO_freebsd)
{
dlclose(dlopen("/lib/libthr.so.3",
RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE));
}
#endif
Then I get
paulf> ../../vg-in-place --tool=drd -q ./dlopen_main ./dlopen_lib.so
In main: creating thread 1
Hello World! It's me, thread #1!
==22973== pthread_join(): invalid thread ID 0x5401570
==22973== at 0x4860F29: pthread_join_intercept
(drd_pthread_intercepts.c:731)
==22973== by 0x4860F29: pthread_join (drd_pthread_intercepts.c:738)
==22973== by 0x4CB47DC: foo (in
/usr/home/paulf/scratch/valgrind/drd/tests/dlopen_lib.so)
==22973== by 0x201B38: main (dlopen_main.c:26)
==22973==
OK, so that's better than hitting the assert. Now I need to figure out
why there is an extra call to pthread_join().
A+
Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56cf3993-778e-be75-bd2f-39fbe90e83c8>
