I am having trouble creating the behavior described in the attach and detach section in ptrace :
If the tracer dies, all tracees are automatically detached and
restarted, unless they were in group-stop.
I have a process (trace) that consists of several threads that I attach to ptrace. Using a separate process (tracer) using the following calls:
ptrace(PTRACE_ATTACH, pid, 0, 0);
sleep(3600);
When the tracer dies (using ctrl + c or kill -9) during sleep and is still attached to the process, I notice that all threads of the trace process are put into a stopped state, and not continue to execute.
I also tried using GDB to reproduce this problem, since GDB also joins the process using ptrace. But when killing gdb (using kill -9) when attaching a trace, all trace streams continue to execute as expected. I tried to take a look at the source of GDB, but still could not understand anything.
Does anyone know what could cause the behavior of all trace streams to be stopped when the trace is erased?
This is evaluated on an ARM Cortex-A9 processor using a 3.6.5 kernel
source
share