Bug 165142 - bad registers reported to debugger at about to exit time
bad registers reported to debugger at about to exit time
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Martuccelli
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-04 13:13 EDT by Tom Horsley
Modified: 2012-06-20 09:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:23:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Tom Horsley 2005-08-04 13:13:32 EDT
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):
kernel-2.6.9-5.EL

How reproducible:
Always

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 13:17:16 EDT
Created attachment 117466 [details]
test program to demo bug
Comment 2 Tom Horsley 2005-08-04 13:18:11 EDT
Created attachment 117467 [details]
results from test run showing error
Comment 3 Red Hat Bugzilla 2007-03-18 18:33:37 EDT
User jparadis@redhat.com's account has been closed
Comment 4 Jiri Pallich 2012-06-20 09:23:38 EDT
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.