Bug 87581 - Newest glibc causes thread havoc. Cannot debug with GDB any longer
Newest glibc causes thread havoc. Cannot debug with GDB any longer
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-03-29 01:05 EST by Elias Israel
Modified: 2007-04-18 12:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-22 01:59:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Elias Israel 2003-03-29 01:05:01 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):

How reproducible:

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"...
(gdb) r
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.

Additional info:

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
I be?
Comment 1 Jakub Jelinek 2003-03-29 03:41:38 EST
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)?
Comment 2 Elias Israel 2003-03-29 11:25:36 EST
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
Comment 3 Elias Israel 2003-04-01 10:19:17 EST
Any new information on this item? Still can't use GDB on threaded programs.
Comment 4 Jakub Jelinek 2003-04-01 10:28:29 EST
Have not been able to reproduce this. Can you reproduce it on some short testcase?
What are the exact steps for reproducing it?
Comment 5 Elias Israel 2003-04-01 14:09:23 EST
My bad.

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.
Comment 6 Ulrich Drepper 2003-04-22 01:59:34 EDT
Apparently a user bug.  At least in the end.  Closing.

Note You need to log in before you can comment on or make changes to this bug.