MCPcopy Create free account
hub / github.com/HexHive/NASS / SetSignalHandler

Function SetSignalHandler

fuzz/libfuzzer/FuzzerUtilPosix.cpp:117–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void SetSignalHandler(const FuzzingOptions& Options) {
118 // setitimer is not implemented in emscripten.
119 if (Options.HandleAlrm && Options.UnitTimeoutSec > 0 && !LIBFUZZER_EMSCRIPTEN)
120 SetTimer(Options.UnitTimeoutSec / 2 + 1);
121 if (Options.HandleInt)
122 SetSigaction(SIGINT, InterruptHandler);
123 if (Options.HandleTerm)
124 SetSigaction(SIGTERM, InterruptHandler);
125 if (Options.HandleSegv)
126 SetSigaction(SIGSEGV, SegvHandler);
127 if (Options.HandleBus)
128 SetSigaction(SIGBUS, CrashHandler);
129 if (Options.HandleAbrt)
130 SetSigaction(SIGABRT, CrashHandler);
131 if (Options.HandleIll)
132 SetSigaction(SIGILL, CrashHandler);
133 if (Options.HandleFpe)
134 SetSigaction(SIGFPE, CrashHandler);
135 if (Options.HandleXfsz)
136 SetSigaction(SIGXFSZ, FileSizeExceedHandler);
137 if (Options.HandleUsr1)
138 SetSigaction(SIGUSR1, GracefulExitHandler);
139 if (Options.HandleUsr2)
140 SetSigaction(SIGUSR2, GracefulExitHandler);
141}
142
143void SleepSeconds(int Seconds) {
144 sleep(Seconds); // Use C API to avoid coverage from instrumented libc++.

Callers 1

FuzzerDriverFunction · 0.70

Calls 2

SetTimerFunction · 0.85
SetSigactionFunction · 0.85

Tested by

no test coverage detected