Red Hat Bugzilla – Bug 87581
Newest glibc causes thread havoc. Cannot debug with GDB any longer
Last modified: 2016-11-24 10:19:50 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314
Description of problem:
Since installing the latest update to the glibc library, threaded programs can
no longer be debugged in GDB. Recompiling GDB is no help (generates same
result). Recompiling target program is no help. Not even compiling the target
program statically linked fixes the problem.
It appears that libpthread library is stripped, but this may not be the (only)
Attempts to debug threaded programs in GDB now fail with this message: "Couldn't
get registers: Operation Not Permitted". User permissions do not seem to change
this. (Root gets same error.)
Same threaded programs appear to run properly by themselves. But attempting to
run them under GDB fails as described above.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build a program that uses posix threads.
2. Attempt to debug it in GDB
3. Issue gdb 'r' command to begin execution of program.
4. See message "Couldn't get registers: operation not permitted."
Actual Results: GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 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 "i386-redhat-linux"...
Starting program: /home/eli/PureMessaging/purem/servers/checkspam/checkspamd
Couldn't get registers: Operation not permitted.
(gdb) The program is running. Exit anyway? (y or n) y
Expected Results: Should have seen the start of several threads, the program
coming to life, etc.
This problem definitely started after the most recent glibc update.
This is a major loss of functionality with no workaround. I cannot use the
machine in this state.
Theoretically, I could back out the patch (though I'm not really sure that's a
good idea), but I could be wrong that this is glibc related and then where would
The primary problem is a kernel bug which passes incorrect AT_PLATFORM
string, so /lib/i686 libraries aren't used.
Can you please try ftp://people.redhat.com/jakub/glibc/errata/8.0/*4.80.3*
which has workarounds for this (and a couple of bugfixes too)?
I downloaded and installed the RPMs you referenced with rpm --upgrade.
Now, GDB can start the program, but it still has strange behavior. When the
program hits a breakpoint or traps a signal, I get the folllowing:
Cannot find user-level thread for LWP 1493: no LWP to satisfy query
Attempts to terminate the process being debugged within GDB then get this response:
Cannot find thread 32771: invalid thread handle
Any new information on this item? Still can't use GDB on threaded programs.
Have not been able to reproduce this. Can you reproduce it on some short testcase?
What are the exact steps for reproducing it?
Attempting to reproduce the remaining problems turned up a software defect that
was masquerading as a similar problem.
The "no LWP to satisfy query" should be read as "heap corruption so bad that I
wet myself and quit."
I consider this bug resolved, thanks.
Apparently a user bug. At least in the end. Closing.