Bug 87581

Summary: Newest glibc causes thread havoc. Cannot debug with GDB any longer
Product: [Retired] Red Hat Linux Reporter: Elias Israel <eli>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 8.0CC: ezannoni, fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-22 05:59:34 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 Elias Israel 2003-03-29 06:05:01 UTC
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)
problem.

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):
glibc-2.3.2-4.80

How reproducible:
Always

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 08:41:38 UTC
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 16:25:36 UTC
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 15:19:17 UTC
Any new information on this item? Still can't use GDB on threaded programs.


Comment 4 Jakub Jelinek 2003-04-01 15:28:29 UTC
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 19:09:23 UTC
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 05:59:34 UTC
Apparently a user bug.  At least in the end.  Closing.