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.
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.
I have seen this on IA32 as well, platform -> All.
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.
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
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
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).
This may be gdb problem report 458 ("When GNU/Linux pthreads program calls execv, gdb refuses to exit, must be killed") at "http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=458&return_url=http%3A%2F%2Fsources.redhat.com%2Fcgi-bin%2Fgnatsweb.pl%3Fdatabase%3Dgdb%26category%3Dall%26severity%3Dall%26priority%3Dall%26responsible%3Dall%26submitter_id%3Dall%26state%3Dall%26ignoreclosed%3DIgnore%2520Closed%26class%3Dall%26synopsis%3Dexec%26multitext%3D%26columns%3Dcategory%26columns%3Dstate%26columns%3Dclass%26columns%3Dresponsible%26columns%3Dsynopsis%26displaydate%3DDisplay%2520Current%2520Date%26cmd%3Dsubmit%2520query%26sortby%3DResponsible%26.cgifields%3Doriginatedbyme%26.cgifields%3Ddisplaydate%26.cgifields%3Dcolumns%26.cgifields%3Dignoreclosed".
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%
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.
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.
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