2017-11-10 08:18:13 +08:00
|
|
|
# Check that libFuzzer honors SIGUSR1/SIGUSR2
|
2018-09-05 01:08:47 +08:00
|
|
|
# FIXME: Disabled on Windows for now because of reliance on posix only features
|
|
|
|
# (eg: export, "&", pkill).
|
2019-05-22 05:15:51 +08:00
|
|
|
UNSUPPORTED: darwin, windows
|
2017-11-10 08:18:13 +08:00
|
|
|
RUN: rm -rf %t
|
|
|
|
RUN: mkdir -p %t
|
|
|
|
RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR
|
|
|
|
|
|
|
|
RUN: mkdir -p %t/C1 %t/C2
|
|
|
|
RUN: echo a > %t/C2/a
|
|
|
|
RUN: echo b > %t/C2/b
|
|
|
|
RUN: echo c > %t/C2/c
|
|
|
|
RUN: echo d > %t/C2/d
|
|
|
|
RUN: echo e > %t/C2/e
|
|
|
|
RUN: echo f > %t/C2/f
|
|
|
|
RUN: echo g > %t/C2/g
|
2019-05-22 05:15:51 +08:00
|
|
|
RUN: echo h > %t/C2/g
|
|
|
|
RUN: echo i > %t/C2/g
|
|
|
|
RUN: echo j > %t/C2/g
|
|
|
|
RUN: echo k > %t/C2/g
|
|
|
|
RUN: echo l > %t/C2/g
|
|
|
|
RUN: echo m > %t/C2/g
|
|
|
|
RUN: echo n > %t/C2/g
|
|
|
|
RUN: echo o > %t/C2/g
|
2017-11-10 08:18:13 +08:00
|
|
|
|
2019-05-22 07:54:39 +08:00
|
|
|
# Run in new session so we can easily kill child processes all at once.
|
|
|
|
RUN: setsid %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>%t/log & export PID=$!
|
2017-11-10 08:18:13 +08:00
|
|
|
RUN: sleep 3
|
2019-05-22 07:54:39 +08:00
|
|
|
RUN: kill -SIGUSR2 -$(ps -o sess= $PID | grep -o '[0-9]*')
|
2019-05-22 06:48:40 +08:00
|
|
|
RUN: wait $PID || true
|
2019-05-22 08:41:54 +08:00
|
|
|
RUN: sleep 3
|
2019-05-18 03:33:31 +08:00
|
|
|
RUN: cat %t/log | FileCheck %s --dump-input=fail
|
2017-11-10 08:18:13 +08:00
|
|
|
RUN: grep C2/g %t/MCF
|
|
|
|
RUN: grep STARTED %t/MCF
|
2019-02-15 07:12:33 +08:00
|
|
|
RUN: tail -n 2 %t/MCF | grep FT
|
|
|
|
RUN: tail -n 1 %t/MCF | grep COV
|
2017-11-10 08:18:13 +08:00
|
|
|
|
|
|
|
CHECK: INFO: signal received, trying to exit gracefully
|
|
|
|
CHECK: INFO: libFuzzer: exiting as requested
|