https://bugs.kde.org/show_bug.cgi?id=428909

--- Comment #10 from Paul Floyd <pjfl...@wanadoo.fr> ---
I'll attempt to add as many explanations as possible.

First, the true nature of the problem on Fedora 33. For some very bizarre
reason, pthread_cond_destroy is no longer in libpthread:

paulf> nm /lib64/libpthread.so.0 | grep cond_destroy
                 U __pthread_cond_destroy@@GLIBC_PRIVATE

instead it is in libc

paulf> nm /lib64/libc.so.6  | grep cond_destroy                               
[snip loads more]
0000000000086440 T pthread_cond_destroy@GLIBC_2.2.5
00000000000869f0 T pthread_cond_destroy@@GLIBC_2.3.2

DRD and Helgrind are doing essentially the sme thing for the intercepts, but
differ a bit in the details. For DRD, see drd_pthread_intercepts.c where the
PTH_FUNCS macro generates 3 wrapper functions covering "name", "name@*" and
"name$*". Bart extended this for both libc and libpthread (but only libthread
with MUSL)

Hence I now see

paulf> nm vgpreload_drd-amd64-linux.so | grep pthread | grep cond | grep
destroy
                 U pthread_cond_destroy
0000000000017c90 T _vgw00000ZZ_libcZdsoZa_pthreadZucondZudestroy
0000000000017f70 T _vgw00000ZZ_libcZdsoZa_pthreadZucondZudestroyZAZa
0000000000018250 T _vgw00000ZZ_libcZdsoZa_pthreadZucondZudestroyZDZa
0000000000017e00 T _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucondZudestroy
00000000000180e0 T _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucondZudestroyZAZa
00000000000183c0 T _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucondZudestroyZDZa


Helgrind is more on a case by case basis (which means the code is a bit longer
but only the required wrappers are generated). So now I see

paulf> nm vgpreload_helgrind-amd64-linux.so | grep pthread | grep cond | grep
destroy 
000000000000a4f9 t pthread_cond_destroy_WRK
000000000000d87d W _vgw00000ZZ_libcZdsoZa_pthreadZucondZudestroyZAZa
000000000000d87d T _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucondZudestroyZAZa

The difference here is that DRD has 3 separate functions whilst Helgrind has
just one plus an alias. They both work the same way with the redirection
mechanism - they're just symbols and calling them does the same thing.

The differences between Linux and other OSes (Solaris, FreeBSD and macOS)
concern the names of the libc / libppthread libraries and the mangling used).

Finally, MUSL. I'm not sure if this is strictly necessary (I don't have a
system to test on, perhaps I will spin up yet another Virtual Box ...). It's
certainly more consistent with DRD.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to