]> sourceware.org Git - systemtap.git/commit
task_finder2: change the default engine action to UTRACE_INTERRUPT
authorSultan Alsawaf <sultan@openresty.com>
Thu, 29 Oct 2020 18:25:53 +0000 (11:25 -0700)
committerYichun Zhang (agentzh) <yichun@openresty.com>
Thu, 29 Oct 2020 18:29:50 +0000 (11:29 -0700)
commit72f1927c98ce4d6f0b8115fa861d0bf1b5b56ed9
tree48896552489beb9462d8211ac4447a31da214fe3
parent5f74d0db40a1824d908562599ad44afa30fd2681
task_finder2: change the default engine action to UTRACE_INTERRUPT

There is a race condition where, right after an engine is attached, a
reporting pass will occur before the engine can actually request what it
wants from the target process. In this case, the action that the engine
used when it was first attached will be carried out during the reporting
pass. When the default action is UTRACE_STOP, this means that the
reporting pass will think the newly-attached engine wants to stop the
target process, at which point the target process will be moved into the
TASK_TRACED state (visible via `ps aux | grep ' t '`) and will be
halted forever (until it receives a SIGKILL) because the engine will
never send a UTRACE_RESUME request to bring the target process back to
life. This seems to be an issue with the UTRACE_STOP machinery; it's not
clear how *any* process entering the UTRACE_STOP state can exit that
state naturally. It's also dubious whether the UTRACE_STOP state is even
needed, since tracing is done from within task workers that run inside
the context of the process we're trying to analyze, which allows us to
to safely analyze the process without needing to stop it.

Regardless, it's clear that a newly-attached engine would definitely not
want to stop the process it's trying to analyze; after all, there's
nothing interesting to see if the process is just halted. The common
engine action seems to be UTRACE_INTERRUPT, so let's set that to be the
default instead of UTRACE_STOP.

Signed-off-by: Yichun Zhang (agentzh) <yichun@openresty.com>
runtime/linux/task_finder2.c
This page took 0.027556 seconds and 5 git commands to generate.