I have tested four cases:
- PT_CONTINUE + waitpid() works fine, the trace program prints out values. - PT_CONTINUE alone does not work but no core-dump caused by SIGTRAP - PT_DETACH + waitpid() does not work and core-dump - PT_DETACH alone does not work and core-dump. Who is sending the SIGRAP (5) signal? The same program works fine on SunOS. Maybe there is a bug in the kernel. I have looked into sys_process.c and still have no idea. -Zhihui On 9 Feb 2002, Dag-Erling Smorgrav wrote: > Zhihui Zhang <[EMAIL PROTECTED]> writes: > > The following small program demonstrates that a parent process can write > > into the data space of its child by ptrace(). If the parent waits for the > > child to exit, there is no problem. However, if the parent does not do so, > > the child will get a SIGTRAP signal and core dumps. Can anyone give me a > > clue how this is the case? Thanks! > > The parent must either detach from the child, or wait for it to > terminate. See ptrace(2). > > DES > -- > Dag-Erling Smorgrav - [EMAIL PROTECTED] > To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

