]> git.baikalelectronics.ru Git - kernel.git/commit
perf stat: Avoid sending SIGTERM to random processes
authorStephane Eranian <eranian@google.com>
Tue, 4 Jun 2013 15:44:26 +0000 (17:44 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Jul 2013 20:36:33 +0000 (17:36 -0300)
commit5bf65a2c2e8e6c47ddfb1a280d5665164f607bc8
tree0a0c3e465c98439a4ab98bbdb21892422b994ca1
parenta3c8ac2e5f17e81b981edbb71bb1820418f2808a
perf stat: Avoid sending SIGTERM to random processes

This patch fixes a problem with perf stat whereby on termination it may
send a SIGTERM signal to random processes on systems with high PID
recycling. I got some actual bug reports on this.

There is race between the SIGCHLD and sig_atexit() handlers.  This patch
addresses this problem by clearing child_pid in the SIGCHLD handler.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130604154426.GA2928@quad
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c