Bug 165142 - bad registers reported to debugger at about to exit time
Summary: bad registers reported to debugger at about to exit time
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: x86_64
OS: Linux
Target Milestone: ---
: ---
Assignee: Peter Martuccelli
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2005-08-04 17:13 UTC by Tom Horsley
Modified: 2012-06-20 13:23 UTC (History)
2 users (show)

Clone Of:
Last Closed: 2012-06-20 13:23:38 UTC

Attachments (Terms of Use)
test program to demo bug (4.78 KB, text/plain)
2005-08-04 17:17 UTC, Tom Horsley
no flags Details
results from test run showing error (1.11 KB, text/plain)
2005-08-04 17:18 UTC, Tom Horsley
no flags Details

Description Tom Horsley 2005-08-04 17:13:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6

Description of problem:
When using the PTRACE_SETIOPTIONS function of ptrace() and setting the
PTRACE_O_TRACEEXIT flag, the register values the debugger sees reported
by the kernel for the child process are bogus when hitting the
"about to exit" SIGTRAP. I suspect no one saved the registers in the
user area ptrace looks for them in, they appear to be some random
previous register set value leftover from the last actual save.

I will attach the exitbug2.c program and exitbug2.results file demonstrating
the problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. gcc -o exitbug2 -g exitbug2.c
2. ./exitbug2
3. observe the obviously bad rsp register value in final reg dump.

Actual Results:  rsp=0x0000007fbfffee80 while I know for a fact that a previously
existing stack frame had a value somewhere around 0x7fbfffec60, since
the _exit call is the last frame on the stack, the rsp value should
be decremented from 0x7fbfffec60, not incremented :-).

Expected Results:  The rsp= value should be <= the last entry in the level:4 printout at the
end of the program.

Additional info:

This is a problem because debuggers can't tell the user who the heck
called exit (which may be relevant to the bug they are trying to find).
The walkback is all messaed up because the registers are bad.

Comment 1 Tom Horsley 2005-08-04 17:17:16 UTC
Created attachment 117466 [details]
test program to demo bug

Comment 2 Tom Horsley 2005-08-04 17:18:11 UTC
Created attachment 117467 [details]
results from test run showing error

Comment 3 Red Hat Bugzilla 2007-03-18 22:33:37 UTC
User jparadis@redhat.com's account has been closed

Comment 4 Jiri Pallich 2012-06-20 13:23:38 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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