[libFuzzer] Use PID to send signals rather than process name.
authorMatt Morehouse <mascasa@google.com>
Thu, 16 May 2019 01:32:39 +0000 (01:32 +0000)
committerMatt Morehouse <mascasa@google.com>
Thu, 16 May 2019 01:32:39 +0000 (01:32 +0000)
pkill reads the process name as a pattern, not a raw name.  This means
that if the process name contains + or other regex characters, pkill
fails.

llvm-svn: 360835

compiler-rt/test/fuzzer/fork-sigusr.test
compiler-rt/test/fuzzer/merge-sigusr.test

index 8ec8f00..0737f0d 100644 (file)
@@ -5,9 +5,9 @@ RUN: rm -rf %t
 RUN: mkdir -p %t
 RUN: %cpp_compiler %S/ShallowOOMDeepCrash.cpp -o %t/ForkSIGUSR
 
-RUN: %run %t/ForkSIGUSR -fork=3 -rss_limit_mb=128 -ignore_crashes=1 2>&1 | tee %t/log & :
+RUN: %run %t/ForkSIGUSR -fork=3 -rss_limit_mb=128 -ignore_crashes=1 2>%t/log & export PID=$!
 RUN: sleep 3
-RUN: pkill -SIGUSR2 -f %t/ForkSIGUSR
+RUN: kill -SIGUSR2 $PID
 RUN: sleep 6
 RUN: cat %t/log | FileCheck %s
 
index 9b55b85..83c00a2 100644 (file)
@@ -15,9 +15,9 @@ RUN: echo e > %t/C2/e
 RUN: echo f > %t/C2/f
 RUN: echo g > %t/C2/g
 
-RUN: %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>&1 | tee %t/log & :
+RUN: %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>%t/log 2>%t/log & export PID=$!
 RUN: sleep 3
-RUN: pkill -SIGUSR2 -f %t/LFSIGUSR
+RUN: pkill -SIGUSR2 -P $PID
 RUN: sleep 3
 RUN: cat %t/log | FileCheck %s
 RUN: grep C2/g %t/MCF