I am running Linux based on OpenEmbedded on an ARM board where my application is running. I used to run the kernel 2.6.35, gdb 6.8 and gcc 4.3. Recently, I upgraded the system to kernel 2.6.37, gdb 7.4 (also tried 7.3) and gcc 4.6.
Now my application can no longer be debugged (on the ARM board), every time I try to run it in gdb, I get the error message "gdb: Unable to find new threads: general error". The application uses pthreads and references pthreads (readelf lists libpthread.so.0 as a dependency). The suggested solutions that I have found so far recommend binding to pthread, which I already do. Another recommendation I found was to use LD_PRELOAD = / lib / libpthread.so.0 which does not make any difference to me.
Debugging x86 application builds works without problems.
EDIT: To answer the questions asked in the first answer, I use gdb for the target (ARM), i.e. there is no cross-gdb. I also did not share libpthread.so.0 (/lib/libpthread-2.9.so: 32-bit LSB file ELB, ARM, version 1 (SYSV), dynamically linked (uses shared libraries) for GNU / Linux 2.6. 16, not undresses). glibc remained in version 2.9, and the update included recompiling the entire Linux image
EDIT2: Removing / lib / libthread -db * allows debugging (with subsequent warnings and obviously some functions will not work)
EDIT3: Using set debug libthread-db 1 I get:
Starting program: /home/root/app
Trying host libthread_db library: libthread_db.so.1.
Host libthread_db.so.1 resolved to: /lib/libthread_db.so.1.
td_ta_new failed: application not linked with libthread
thread_db_load_search returning 0
Trying host libthread_db library: libthread_db.so.1.
Host libthread_db.so.1 resolved to: /lib/libthread_db.so.1.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
warning: Unable to set global thread event mask: generic error
Warning: find_new_threads_once: find_new_threads_callback: cannot get thread info: generic error
Found 0 new threads in iteration 0.
Warning: find_new_threads_once: find_new_threads_callback: cannot get thread info: generic error
Found 0 new threads in iteration 1.
Warning: find_new_threads_once: find_new_threads_callback: cannot get thread info: generic error
Found 0 new threads in iteration 2.
Warning: find_new_threads_once: find_new_threads_callback: cannot get thread info: generic error
Found 0 new threads in iteration 3.
thread_db_load_search returning 1
Warning: find_new_threads_once: find_new_threads_callback: cannot get thread info: generic error
Found 0 new threads in iteration 0.
Cannot find new threads: generic error
(gdb) Write failed: Broken pipe
source
share