bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Attach to already running process - ptrace in stop_thread


From: Kevin Clayton
Subject: Attach to already running process - ptrace in stop_thread
Date: Tue, 11 Sep 2001 07:11:01 -0700 (PDT)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]