Reputation: 15406
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.
Upvotes: 2
Views: 6934
Reputation: 405
you need to use target record
http://sources.redhat.com/ml/gdb/2010-07/msg00096.html
Upvotes: 0
Reputation: 213375
libthread_db
is never used by a threaded program. It is only used by the debugger.
Your assertion that libthread_db
is somehow required to run a program using pthreads is incorrect. If your pthread programs crash when libthread_db
is removed from the system, something else is broken on your embedded target; removal of libthread_db
merely 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 that libthread_db
does not appear in strace
output. Now rename /lib/libthread_db.so.1
to something else, and observe that the test program continues to work just fine.
Upvotes: 6