Path: utzoo!mnetor!uunet!mcvax!prlb2!kulcs!dannyb From: dannyb@kulcs.uucp (Danny Backx) Newsgroups: comp.unix.wizards Subject: Re: ptrace in unix tracing non-child processes Message-ID: <110@icarus.kulcs.uucp> Date: 14 Apr 88 16:55:34 GMT References: <352@tandem.UUCP> <10996@mimsy.UUCP> <10224@tut.cis.ohio-state.edu> <49161@sun.uucp> Reply-To: dannyb@kulcs.UUCP (Danny Backx) Organization: Katholieke Universiteit Leuven, Dept. Computer Science Lines: 32 In article <49161@sun.uucp> brent%terra@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@kulcs.UUCP | Celestijnenlaan 200 A ... mcvax!prlb2!kulcs!dannyb | B-3030 Leuven dannyb@blekul60.BITNET | Belgium