mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
restored timeout handling (with SIGALRM for now)
This commit is contained in:
@ -225,6 +225,20 @@ static s32 write_to_file(u8 *path, u8 *mem, u32 len) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Handle timeout signal. */
|
||||||
|
|
||||||
|
static void handle_timeout(int sig) {
|
||||||
|
|
||||||
|
(void)sig;
|
||||||
|
|
||||||
|
child_timed_out = 1;
|
||||||
|
|
||||||
|
if (child_pid > 0) kill(child_pid, SIGKILL);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Execute target application. Returns exec checksum, or 0 if program
|
/* Execute target application. Returns exec checksum, or 0 if program
|
||||||
times out. */
|
times out. */
|
||||||
|
|
||||||
@ -904,6 +918,11 @@ static void setup_signal_handlers(void) {
|
|||||||
sigaction(SIGINT, &sa, NULL);
|
sigaction(SIGINT, &sa, NULL);
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
sigaction(SIGTERM, &sa, NULL);
|
||||||
|
|
||||||
|
/* Exec timeout notifications. */
|
||||||
|
|
||||||
|
sa.sa_handler = handle_timeout;
|
||||||
|
sigaction(SIGALRM, &sa, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display usage hints. */
|
/* Display usage hints. */
|
||||||
|
Reference in New Issue
Block a user