]> git.baikalelectronics.ru Git - kernel.git/commit
ptrace: make former thread ID available via PTRACE_GETEVENTMSG after PTRACE_EVENT_EXE...
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 29 Jun 2011 02:13:39 +0000 (04:13 +0200)
committerOleg Nesterov <oleg@redhat.com>
Fri, 1 Jul 2011 16:51:49 +0000 (18:51 +0200)
commit45441b11d158dfa71c1a6c49de417caf920d6f55
tree3425b09bf6217ef4b59e82cec150d2af1ec16f9f
parent2529443acb41e8b5f6ca05a46386aef23cd7ad27
ptrace: make former thread ID available via PTRACE_GETEVENTMSG after PTRACE_EVENT_EXEC stop

When multithreaded program execs under ptrace,
all traced threads report WIFEXITED status, except for
thread group leader and the thread which execs.

Unless tracer tracks thread group relationship between tracees,
which is a nontrivial task, it will not detect that
execed thread no longer exists.

This patch allows tracer to figure out which thread
performed this exec, by requesting PTRACE_GETEVENTMSG
in PTRACE_EVENT_EXEC stop.

Another, samller problem which is solved by this patch
is that tracer now can figure out which of the several
concurrent execs in multithreaded program succeeded.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
fs/exec.c