Subject: kern/5790: gdb can't attach running process
To: None <gnats-bugs@gnats.netbsd.org>
From: Ken Raeburn <raeburn@raeburn.org>
List: netbsd-bugs
Date: 07/18/1998 04:54:43
>Number: 5790
>Category: kern
>Synopsis: gdb can't attach running process
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jul 18 02:05:02 1998
>Last-Modified:
>Originator: Ken Raeburn
>Organization:
>Release: 1998-07-01
>Environment:
System: NetBSD kr-pc.cygnus.com 1.3F NetBSD 1.3F (RAEBURN) #0: Thu Jul 9 16:33:34 EDT 1998 root@kr-pc.cygnus.com:/dos/sys.980701/arch/i386/compile/RAEBURN i386
>Description:
I fired up gdb on an executable, and tried attaching a process running
as me, but the kernel (or possibly gdb) doesn't like it...
kr-pc 4:43 /h/NetBSD-build/pkgsrc/www/mozilla/work/19980429/mozilla/cmd/xfe
[6] % jobs -l
[1] + 851 Running mozilla-export (wd: ~)
kr-pc 4:43 /h/NetBSD-build/pkgsrc/www/mozilla/work/19980429/mozilla/cmd/xfe
[7] % gdb NetBSD1.3F_OPT.OBJ/mozilla-export
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-netbsd), Copyright 1996 Free Software Foundation, Inc...
(no debugging symbols found)...
(gdb) attach 851
Attaching to program `/h/NetBSD-build/pkgsrc/www/mozilla/work/19980429/mozilla/cmd/xfe/NetBSD1.3F_OPT.OBJ/mozilla-export', process 851
ptrace: Operation not permitted.
(gdb)
This process is very large (>30M and still growing) and appears to be
running in a loop at the moment, using more than half my cpu time.
Attaching another process (a small one, my window manager, blocked
when I attached to it instead of running) worked okay.
>How-To-Repeat:
Debug a large, looping process?
>Fix:
Give up on debugging mozilla for now...
>Audit-Trail:
>Unformatted: