Bug 78228

Summary: Cannot find user-level thread for LWP 27549: generic error
Product: Red Hat Enterprise Linux 2.1 Reporter: Johan Walles <johan.walles>
Component: gdbAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED ERRATA QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: psessions, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-21 19:36:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Johan Walles 2002-11-20 13:34:37 UTC
Sometimes when using gdb-5.2-2 it starts answering...

Cannot find user-level thread for LWP 27549: generic error

or...

Cannot find new threads: generic error

... anytime I try to give it any command (except help, maybe others).  No
commands never do anything but printing the error message.  Notably, even "quit"
doesn't work, so I have to kill it to get rid of it.

Unforturnately I cannot give you any steps to re-produce this (because I can't
send you the code I'm trying to debug :-(), so I don't really expect you to fix
this soon, but you should be aware of that it's happening.  I think this *is*
provokable though, since I tend to run into it again and again once I've managed
to trigger it once.

Comment 1 Johan Walles 2002-11-21 08:01:15 UTC
Some unusual stuff we are doing (that may or may not be related to this) is
using alternative signal stacks (man sigaltstack), installing signal handlers
for SIGSEGV and SIGILL, creating new pthreads with stacks allocated using mmap(NULL,
stackSize, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0). 
If you need any additional information that you think I may actually be able to
provide, please ask.


Comment 2 Johan Walles 2002-12-05 10:38:51 UTC
I have seen this on IA32 as well, platform -> All.

Comment 3 Johan Walles 2002-12-05 10:43:05 UTC
Just discovered that the gdb version on my RHAS2.1/ia32 install is 5.1-1 and not
5.2.  The gdb version on RHAS2.1/ia64 with this problem is still 5.2-2.


Comment 4 Phillip Sessions 2003-04-14 06:11:31 UTC
I have the same issue on IA32.  I have discovered that it will happen if you
link any program against the pthread library even if it doesn't use threads.

To test this I created a very small hello world program. If I build using

cc -g -o tst -lstdc++ tst.cc

I can run the program from gdb.  If I build using 

cc -g -o tst -lstdc++ -lpthread tst.cc

The debugger generates following the messages;

Error while reading shared library symbols:
Cannot find new threads: generic error
Cannot find user-level thread for LWP 25301: no LWP to satisfy query


Comment 5 Phillip Sessions 2003-04-14 06:21:50 UTC
Sorry I forgot the software versions the above example was compiled using;

gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-116.7.2)
libstdc++-2.96-116.7.2
glibc-devel-2.2.4-31.7



Comment 6 Johan Walles 2003-04-14 06:35:46 UTC
Phillip: I think what you are seeing is bug 82640.  You should be able to work
around it by downgrading glibc (more info at bug 82640).

Comment 8 Jeff Johnston 2003-08-21 21:48:55 UTC
Problem 458 is fixed in the current RAWHIDE release.  Could
you try latest RAWHIDE and see if problem persists.

[jjohnstn@tonic]~/test% gdb -nx ./a.out
GNU gdb Red Hat Linux (5.3.90-0.20030710.19rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) run argument
Starting program: /home/jjohnstn/test/a.out argument
[Thread debugging using libthread_db enabled]
[New Thread 2305843009213874432 (LWP 9718)]
Argc: 2
[New Thread 2305843009222047936 (LWP 9719)]
exec()ing thread started

Program exited normally.
(gdb) quit
[jjohnstn@tonic]~/test%

Comment 9 Johan Walles 2003-08-25 09:01:24 UTC
It now works for me using your rawhide gdb on RH9 / i686.  Building that gdb on
a Debian Testing box (glibc 2.3.1 + linuxthreads) however it still shows the
same problem.

This still needs to be verified on RHAS.


Comment 10 Jeff Johnston 2004-09-30 20:52:55 UTC
Never heard back from you regarding verifying RHAS.  I'm afraid we
can't help you with Debian.  This should be fixed in current releases.

Comment 11 John Flanagan 2004-12-21 19:36:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-561.html