Hi,
diman <[EMAIL PROTECTED]> writes:
>
> Another problem(?) Jiangui found considers PT_DETACH ptrace(2)
> call. While i'm attaching to a running process via PT_ATTACH,
> PT_DETACH works well as expected.
> If i instead use PT_TRACE_ME -> execve -> PT_DETACH,
> child always got killed by SIGTRAP.
> I'm not sure it's a bug - needs play a bit more with gdb... ..
>
Maybe it's not a bug. It's a feature. :-) Notice execve() in
sys/kern/kern_exec.c:
/*
* If tracing the process, trap to debugger so breakpoints
* can be set before the program executes.
*/
STOPEVENT(p, S_EXEC, 0);
if (p->p_flag & P_TRACED)
psignal(p, SIGTRAP);
> Attached is a simple program i used for tests.
> Note that Jiangyi Liu reported same effects on 4.3-S.
>
> Sorry Jiangyi Liu, I wrong understood you yesterday -
> needs more more more sleeping :~)
>
Never mind. Maybe enough sleeping and morning jogging do good to
hacking. But it's almost impossible. :-)
Cheers,
Jiangyi Liu
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message