Bug 90900 - Cannot quit gdb after ptrace fails
Summary: Cannot quit gdb after ptrace fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnston
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-15 08:23 UTC by Joe Orton
Modified: 2015-01-08 00:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-08-22 19:12:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Joe Orton 2003-05-15 08:23:02 UTC
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 09:26:12 UTC
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 19:12:57 UTC
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.