As per comment, there appears to be a potential race with a subprocess, where after the initial PTRACE_ATTACH, but before the process receives a SIGSTOP, it hits an execve and then triggers a SIGTRAP, which can cause the process to die. Details on ptrace+execve at: https://man7.org/linux/man-pages/man2/ptrace.2.html#:~:text=execve(2)%20under%20ptrace
This fixes by supressing the SIGTRAP (which should only be issued by debuggers).
As per comment, there appears to be a potential race with a subprocess, where after the initial
PTRACE_ATTACH
, but before the process receives aSIGSTOP
, it hits an execve and then triggers aSIGTRAP
, which can cause the process to die. Details on ptrace+execve at: https://man7.org/linux/man-pages/man2/ptrace.2.html#:~:text=execve(2)%20under%20ptraceThis fixes by supressing the
SIGTRAP
(which should only be issued by debuggers).