'Cannot find new threads: generic error' when debugging certain applications

Bug #563361 reported by Andreas Sandberg on 2010-04-14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)

Bug Description

Binary package hint: gdb

When debugging bug #423252 I noticed that GDB looses control over the target application if it executes getpwnam when using libnss-ldap. GDB displays the following error message:

[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error

It is impossible to continue to work with the application after the above message has been displayed. For example, trying to execute 'next' results in the following error message:

Cannot execute this command while the selected thread is running.

I suspect this could actually be a kernel bug rather than a GDB bug (I've seen a fair deal of ptrace breakage at work), but I have no way of verifying that at the moment.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: gdb 7.1-1ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-20.30-generic
Uname: Linux 2.6.32-20-generic x86_64
Architecture: amd64
Date: Wed Apr 14 22:35:03 2010
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
SourcePackage: gdb

Andreas Sandberg (andysan) wrote :
Christopher Grayce (cgrayce) wrote :

Actually gdb does this for all kinds of reasons. And has done so since about Ubuntu 9.xx. It's REALLY a pain, and is the main reason I keep the work computer at Ubuntu 8. I had hoped that 10.04 would solve it, but nope.

Martin Olsson (mnemo) wrote :

Some people seems to be able to work around this error by linking pthreads to their apps.

Riccardo Ressi (riccardo-ressi) wrote :

I solved the problem as said Martin Olsson.
If you add flag -lpthread to gcc (or g++) while linking your application to be debugged the problem vanish.

Matthias Klose (doko) wrote :

closing this rather old issue. sorry for not addressing this earlier. Please could you recheck with the recent 14.04 LTS or 14.10 releases and reopen the issue if the problem persists?

Changed in gdb (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers