This is the mail archive of the
mailing list for the GDB project.
GDB and libthread_db.so.1 issue
- From: Avi Gozlan <avi at checkpoint dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Cc: Avi Gozlan <avi at checkpoint dot com>
- Date: Thu, 16 May 2013 12:30:05 +0000
- Subject: GDB and libthread_db.so.1 issue
I have got a problem with debugging 32bit applications on a target x86_64 machine.
I use 64bit gdb 7.1 on a x86_64 machine (running 'file `which gdb`' returns ELF 64-bit LSB executable, AMD x86-64...)
I can debug 64bit applications successfully on this target machine. However, when trying to debug 32bit applications, I get the following error message:
Cannot find new threads: generic error
Both libpthread.so.0 and libthread_db.so.1 were copied from another machine, both are located in /lib64. (for the sake of trouble shooting I replaced also libc.so.6 and ld-linux-x86.so.2 with libraries copied from that same machine).
When debugging gdb itself, I saw that indeed these shared libraries are loaded by gdb (by running 'info shared'). Yet debugging fails with 32bit programs. The top of the gdb's backtrace for the failure is the following:
#0 thread_db_err_str (err=TD_ERR) at linux-thread-db.c:264
#1 0x0000000000497897 in find_new_threads_callback (th_p=0x7fffffffb760,
data=0x7fffffffb840) at linux-thread-db.c:1306
#2 0x0000003154202000 in iterate_thread_list () from /lib64/libthread_db.so.1
#3 0x00000031542020b5 in td_ta_thr_iter () from /lib64/libthread_db.so.1
#4 0x0000000000497aea in find_new_threads_once (info=0xd38a50, iteration=0,
errp=0x7fffffffb8c0) at linux-thread-db.c:1378
#5 0x0000000000497ccc in thread_db_find_new_threads_2 (ptid=...,
until_no_new=0) at linux-thread-db.c:1445
#6 0x0000000000497d2b in thread_db_find_new_threads_1 (ptid=...)
#7 0x00000000004976d9 in thread_db_wait (ops=0xb21ca0, ptid=...,
ourstatus=0x7fffffffbad0, options=0) at linux-thread-db.c:1247
#8 0x0000000000588734 in target_wait (ptid=..., status=0x7fffffffbad0,
options=0) at target.c:2132
#9 0x0000000000551de6 in wait_for_inferior (treat_exec_as_sigtrap=0)
#10 0x0000000000551468 in proceed (addr=18446744073709551615,
siggnal=TARGET_SIGNAL_0, step=0) at infrun.c:1896
#11 0x000000000054ad68 in run_command_1 (args=0x0, from_tty=1,
tbreak_at_main=0) at infcmd.c:585
#12 0x000000000054ad9b in run_command (args=0x0, from_tty=1) at infcmd.c:595
#13 0x00000000004bc730 in do_cfunc (c=0xb80070, args=0x0, from_tty=1)
It appears that the libthread_db library is called by gdb but identifies a problem. As said, the very same libraries are loaded by gdb for a successful 64bit applications debugging.
I would be thankful if you could shed light on this issue.