[llvm] r264338 - [libFuzzer] handle SIGTERM
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 14:03:59 PDT 2016
Author: kcc
Date: Thu Mar 24 16:03:58 2016
New Revision: 264338
URL: http://llvm.org/viewvc/llvm-project?rev=264338&view=rev
Log:
[libFuzzer] handle SIGTERM
Modified:
llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
llvm/trunk/lib/Fuzzer/FuzzerFlags.def
llvm/trunk/lib/Fuzzer/FuzzerInternal.h
llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp?rev=264338&r1=264337&r2=264338&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerDriver.cpp Thu Mar 24 16:03:58 2016
@@ -338,6 +338,7 @@ static int FuzzerDriver(const std::vecto
if (Flags.handle_ill) SetSigIllHandler();
if (Flags.handle_fpe) SetSigFpeHandler();
if (Flags.handle_int) SetSigIntHandler();
+ if (Flags.handle_term) SetSigTermHandler();
if (DoPlainRun) {
Options.SaveArtifacts = false;
Modified: llvm/trunk/lib/Fuzzer/FuzzerFlags.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerFlags.def?rev=264338&r1=264337&r2=264338&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerFlags.def (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerFlags.def Thu Mar 24 16:03:58 2016
@@ -75,6 +75,7 @@ FUZZER_FLAG_INT(handle_abrt, 1, "If 1, t
FUZZER_FLAG_INT(handle_ill, 1, "If 1, try to intercept SIGILL.")
FUZZER_FLAG_INT(handle_fpe, 1, "If 1, try to intercept SIGFPE.")
FUZZER_FLAG_INT(handle_int, 1, "If 1, try to intercept SIGINT.")
+FUZZER_FLAG_INT(handle_term, 1, "If 1, try to intercept SIGTERM.")
FUZZER_FLAG_INT(close_fd_mask, 0, "If 1, close stdout at startup; "
"if 2, close stderr; if 3, close both.")
Modified: llvm/trunk/lib/Fuzzer/FuzzerInternal.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerInternal.h?rev=264338&r1=264337&r2=264338&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerInternal.h (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerInternal.h Thu Mar 24 16:03:58 2016
@@ -92,6 +92,7 @@ void SetSigAbrtHandler();
void SetSigIllHandler();
void SetSigFpeHandler();
void SetSigIntHandler();
+void SetSigTermHandler();
std::string Base64(const Unit &U);
int ExecuteCommand(const std::string &Command);
size_t GetPeakRSSMb();
Modified: llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp?rev=264338&r1=264337&r2=264338&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerUtil.cpp Thu Mar 24 16:03:58 2016
@@ -106,6 +106,7 @@ void SetSigAbrtHandler() { SetSigaction(
void SetSigIllHandler() { SetSigaction(SIGILL, CrashHandler); }
void SetSigFpeHandler() { SetSigaction(SIGFPE, CrashHandler); }
void SetSigIntHandler() { SetSigaction(SIGINT, InterruptHandler); }
+void SetSigTermHandler() { SetSigaction(SIGTERM, InterruptHandler); }
int NumberOfCpuCores() {
FILE *F = popen("nproc", "r");
More information about the llvm-commits
mailing list