Red Hat Bugzilla – Bug 165142
bad registers reported to debugger at about to exit time
Last modified: 2012-06-20 09:23:38 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
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. gcc -o exitbug2 -g exitbug2.c
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.
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.
Created attachment 117466 [details]
test program to demo bug
Created attachment 117467 [details]
results from test run showing error
User firstname.lastname@example.org's account has been closed
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.