原文:http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
Questions:
When I run GDB against a program which loads a .so which is linked to pthreads, GDB reports error "Cannot find new threads: generic error".
Note that executable that I run is not linked with pthreads.
Any clues?
Answer 1:
This also works:
LD_PRELOAD=/lib/libpthread.so.0 gdb --args ./app
Answer 2:
64 bit Ubuntu users should do this:
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 gdb --args ./app
Answer 3:
You can also create a .gdbinit
in your home directory containing this text:
set env LD_PRELOAD /lib/libpthread.so.0