You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running Coz with strace shows that the child process terminates with SIGSEGV. If you capture a core dump, you can see that there is a stack overflow due to infinite recursion in pthread_cond_broadcast. This is because RTLD_DEFAULT is defined as NULL in include/dlfcn.h, so dlsym interprets the NULL handle passed to it as RTLD_DEFAULT. This causes the lookup for the "real" function to use the default search order, hence returning the overridden symbol from libcoz.so instead of the actual pthreads implementation.
The text was updated successfully, but these errors were encountered:
mbUSC
changed the title
Infinite recursion when libpthread.so.0 cannot be loaded
Infinite recursion when libpthread.so.0 cannot be dynamically loaded
Apr 21, 2024
In
get_pthread_handle
(real.cpp),dlopen
can fail to load "libpthread.so.0" and return a NULL pointer.This condition is not properly handled by Coz.
How to reproduce the problem:
Build https://github.com/ClickHouse/ClickHouse.
Try profiling the
clickhouse_server
program with Coz. It fails silently (no output).Debugging:
Running Coz with
strace
shows that the child process terminates with SIGSEGV. If you capture a core dump, you can see that there is a stack overflow due to infinite recursion inpthread_cond_broadcast
. This is becauseRTLD_DEFAULT
is defined asNULL
ininclude/dlfcn.h
, sodlsym
interprets theNULL
handle passed to it asRTLD_DEFAULT
. This causes the lookup for the "real" function to use the default search order, hence returning the overridden symbol fromlibcoz.so
instead of the actual pthreads implementation.The text was updated successfully, but these errors were encountered: