[PATCH] Try to use PTRACE_SETOPTIONS to handle non-ptrace SIGTRAP
Roland McGrath
roland at redhat.com
Fri Jul 23 08:15:47 UTC 2010
> > Furthermore, the actual behavior of Linux kernels where TCB_WAITEXECVE
> > is needed (i.e. PTRACE_O_TRACEEXEC not supported or not yet in force)
> > is that a normal SIGTRAP signal is generated, so the normal ptrace
> > signal stop for that comes only after the syscall-exit stop for the
> > execve call completing.
>
> This is irrelevant. With the old code the flag is set in both cases
> which is obviously wrong.
It's true that the existing code is wrong.
It's not true that what I said is irrelevant.
Your change works around it being wrong, but that's still not really just
being correct. As I said, we should just make it correct. That is, simply:
if (exiting(tcp) && !syserror(tcp))
tcp->flags |= TCB_WAITEXECVE;
There is no need for any other case to set TCB_WAITEXECVE in the first
place. So with that, there is no case in which TCB_WAITEXECVE is wrongly
set and needs to be removed.
Thanks,
Roland
More information about the Strace-devel
mailing list