Bug 90900 - Cannot quit gdb after ptrace fails
Cannot quit gdb after ptrace fails
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnston
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-15 04:23 EDT by Joe Orton
Modified: 2015-01-07 19:05 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-22 15:12:57 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)

  None (edit)
Description Joe Orton 2003-05-15 04:23:02 EDT
Description of problem:
If you try to attach to a process using gdb, and the ptrace fails with EPERM, it
 is then no longer possible to quit gdb.

Version-Release number of selected component (if applicable):
gdb-5.3post-0.20021129.18

How reproducible:
Always

Steps to Reproduce:
1. # /usr/sbin/httpd.worker
2. # ps axf ## pick a child of httpd.worker
3. # gdb /usr/sbin/httpd.worker 5697
...
Couldn't get registers: Operation not permitted.
A program is being debugged already.  Kill it? (y or n) n
Program not killed.
(gdb) quit

Actual results:
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /usr/sbin/httpd.worker, process 5955
ptrace: Operation not permitted.

Expected results:
It should be possible to quit GDB without needing to kill -9 it!

Additional info:
Comment 1 Joe Orton 2003-05-15 05:26:12 EDT
Note that this is only reproducible if you boot a kernel with the
ptrace-of-setuid-process bug, e.g. 2.4.20-9, not the 2.4.20-13.9 erratum which
was released today.
Comment 2 Jeff Johnston 2003-08-22 15:12:57 EDT
Fixed in latest release.  Error in ptrace detach now causes
message but does not call error() so quitting will complete.

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