ptrace in unix tracing non-child processes

Danny Backx dannyb at kulcs.uucp
Fri Apr 15 02:55:34 AEST 1988


In article <49161 at sun.uucp> brent%terra at Sun.COM (Brent Callaghan) writes:
>SunOs ptrace() has this facility.  You can give it a pid with
>the PTRACE_ATTACH request and attach to another process.  The other
>process must be one of "yours" i.e. same uid/gid.  The process gets
>a SIGSTOP.  A PTRACE_DETACH is used to send the traced process on
>it's way when you've lost interest.
>
>This facility is used by dbx.  You can give it a pid in place of
>a core file name e.g. "dbx fnurg 1022".

There is a bug related to this in the SunOS 3.4 kernel, though.
(At least I think this is a bug)

Sometimes when a process is being debugged it can be caused to just hang.
Don't ask me how I did it.
I just know the machine I work on has had one of my processes being traced
and stopped (yes, both !), and there was absolutely no way to remove the
process except for rebooting the system.

It seems such a process is in a state in which it never returns to user mode.
Since processes only receive signals when going into user mode, you obviously
can't kill it.

If anybody knows a solution I am not aware of... please post !

	Danny
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Danny Backx                            |  mail: Katholieke Universiteit Leuven 
 Tel: +32 16 200656 x 3058              |        Dept. Computer Science
 E-mail: dannyb at kulcs.UUCP              |        Celestijnenlaan 200 A
         ... mcvax!prlb2!kulcs!dannyb   |        B-3030 Leuven
         dannyb at blekul60.BITNET         |        Belgium     



More information about the Comp.unix.wizards mailing list