Bug 165142

Summary: bad registers reported to debugger at about to exit time
Product: Red Hat Enterprise Linux 4 Reporter: Tom Horsley <horsley1953>
Component: kernelAssignee: Peter Martuccelli <peterm>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: bugsy, jbaron
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:23:38 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:
Attachments:
Description Flags
test program to demo bug
none
results from test run showing error none

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):
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 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'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.