[Bug 162774] strace ignores int3 SIGTRAP

bugzilla at redhat.com bugzilla at redhat.com
Wed Sep 10 15:44:58 UTC 2008


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=162774





--- Comment #8 from Denys Vlasenko <dvlasenk at redhat.com>  2008-09-10 11:44:57 EDT ---
The "bug" of extra SIGTRAP which patch works around is not really a bug, it's a
feature of execve:

NAME
       execve - execute program
DESCRIPTION
...
       If  the current program is being ptraced, a SIGTRAP is sent to it after
       a successful execve().
...

This extra SIGTRAP is not affected by PTRACE_O_TRACESYSGOOD option. In my
opinion, this SIGTRAP should not be passed to straced program as this may
change its behavior, so handling of this SIGTRAP as coded in the patch is
correct, only comment

+  /* Kernel bug (observed on 2.6.25 x86_64):
+   * even if we set PTRACE_O_TRACESYSGOOD option,
+   * after execve(), post-syscall ptrace-generated SIGTRAP
+   * has signo == SIGTRAP, not (SIGTRAP | 0x80)!
+   * Detect it by looking at siginfo.
+   */

nees changing. I am not sure whether the detection is future-proof (why kernel
doesn't fill in correct si.si_signo? What would happen if it would be fixed in
kernel? etc), but so far it works.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.




More information about the fedora-triage-list mailing list