On an embedded file system, I would like to get rid of libthread_db. My understanding
was that it was only necessary when debugging a program using pthread. However, here is my observation :
-
If the libthread_db is not present at boot time (when the first pthread using programm is launched), launching such a program causes a segfault.
-
Adding libthread_db later (ie after a pthread program has segfaulted) doesn’t change anything. Every program that uses pthread will segfault on launch.
So it seems libthread_db is essential to run any sort of program using pthread.
libthread_dbis never used by a threaded program. It is only used by the debugger.Your assertion that
libthread_dbis somehow required to run a program using pthreads is incorrect. If your pthread programs crash whenlibthread_dbis removed from the system, something else is broken on your embedded target; removal oflibthread_dbmerely triggers that something else.You can trivially confirm this: build a pthread program on a regular Linux system. Run that program under
strace, and observe thatlibthread_dbdoes not appear instraceoutput. Now rename/lib/libthread_db.so.1to something else, and observe that the test program continues to work just fine.