Date: 27 Apr 1996 14:37:24 -0400 From: mycroft@mit.edu (Charles M. Hannum) To: "Jordan K. Hubbard" <jkh@time.cdrom.com> Cc: sef@freebsd.org, hackers@freebsd.org Subject: Re: Something fishy with our PT_ATTACH code! Message-ID: <el2bukd344b.fsf@zygorthian-space-raiders.MIT.EDU> In-Reply-To: "Jordan K. Hubbard"'s message of Fri, 26 Apr 1996 02:57:31 -0700 References: <29493.830512651@time.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
"Jordan K. Hubbard" <jkh@time.cdrom.com> writes: > > Start cat, attach cat from another tty with gdb, watch cat go to > sleep, detach cat in gdb and watch it return to its previous > un-stopped state. Yes; that's correct. One of the problems here is that PT_ATTACH sends a SIGSTOP to the process, expecting it to be trapped by the debugger, but it accidentally gets passed through when the process is resumed. In general, the signal handling in Sean's ptrace(2) implementation is fairly broken. Also, the only difference between PT_CONTINUE and PT_DETACH should be that the latter gives the process back to its original parent first (and turns off P_TRACED and P_WAITED, of course). In particular, PT_DETACH is allowed to specify an address and signal to continue with. You may want to look at the implementation in NetBSD, in which I've fixed these problems (and others).
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?el2bukd344b.fsf>