[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb-bugs
Subject:    Attach to already running process - ptrace in stop_thread
From:       Kevin Clayton <kevin_clayton () yahoo ! com>
Date:       2001-09-11 14:11:01
Message-ID: 20010911141101.84228.qmail () web10504 ! mail ! yahoo ! com
[Download RAW message or body]

I'm revisiting an issue that has been raised 
occasionally, but that I am still struggling with.

I'm having trouble using to gdb to attach to and debug
an already running process, specifically an snmp
trap daemon.

Version information:
Red Hat Linux release 6.1
Kernel 2.2.12-20
GNU gdb 5.0

The snmptrapd daemon is running as root and I start
gdb as root.
'ps' only shows one snmptrapd process running, so
picking the pid value to attach to is
straightforward.

When I start gdb, I see feedback that it is
attaching to my process
Attaching to program: /home/kevin/apps/snmptrapd, Pid
8897

As gdb loads symbols, only one output seems to
indicate error:
Reading symbols from /lib/libpthread.so.0...done.
Error while reading shared library symbols:
ptrace in stop_thread: No such process.

GDB tells me where the program was stopped:
0x400f87f1 in __libc_nanosleep () from /lib/libc.so.6
(gdb)

I can continue the program, but when I stop it
again, I get the error message:

ptrace in stop_thread: No such process.
(gdb)

At this point, I can't even kill the program or
quit gdb:
(gdb) kill
Kill the program being debugged? (y or n) y
Error accessing memory address 0x40049664: No such
process.
(gdb) quit
The program is running.  Quit anyway (and detach it)?
(y or n) y
Error accessing memory address 0x40049664: No such
process.
(gdb)

Thanks for any suggestions or pointers to other
resources.
Kevin.


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic