NetBSD-Users archive

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

Re: Attaching gdb session to a service launched from rc.d



In article <ab3c11b7-ace0-9d69-30ab-1fa4d7dd4e4c%lanvaux.fr@localhost>,
Germain  <germain%lanvaux.fr@localhost> wrote:
>Greetings!
>
>
>I am having trouble debugging with gdb a service that I am launching 
>with rc.d:
>
>When going `attach <pid>' in gdb (running as the same user as the user 
>under which the service is running.)
>
>
>I get :
>
>(gdb) attach 26536
>Attaching to program: 
>/home/german/work/supportTools/Emailizer/Emailizer, process 26536
>ptrace: Device busy.
>
>Is it because I incorrectly start my service? (I do a fork.)
>
>
>What's crazy is:
>
>if I launch my service manually: (going `/etc/rc.d/mail start'.)
>then I can attach and inspect, but I can't change threads.
>
>If I restart my station (and the service autostart)
>then I can't even attach.
>
>
>Ok maybe it's not craazy, especially for the one who would know the 
>internal reasons why this is.
>
>
>Anyways, all help is welcome.
>I read avidly the Chapter 7 of NetBSD Guide and skimmed the PDF 
>referenced in it for all occurrences of the word `user' but did not find 
>an answer to my question :|.

Can you ktrace the process and see if it does ptrace itself to make
it undebuggable?

christos



Home | Main Index | Thread Index | Old Index