mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 01:12:59 +00:00
[libFuzzer] handle SIGTERM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264338 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2f8286bd50
commit
d32f138d30
@ -338,6 +338,7 @@ static int FuzzerDriver(const std::vector<std::string> &Args,
|
||||
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;
|
||||
|
@ -75,6 +75,7 @@ FUZZER_FLAG_INT(handle_abrt, 1, "If 1, try to intercept SIGABRT.")
|
||||
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.")
|
||||
|
||||
|
@ -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();
|
||||
|
@ -106,6 +106,7 @@ void SetSigAbrtHandler() { SetSigaction(SIGABRT, CrashHandler); }
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user