From: Vsevolod Stakhov Date: Wed, 1 Apr 2015 15:56:05 +0000 (+0100) Subject: Add special case for valgrind to avoid early children termination. X-Git-Tag: 0.9.0~356 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=067c344312a89b888040aece1b69eaa66b37ea31;p=rspamd.git Add special case for valgrind to avoid early children termination. --- diff --git a/src/main.c b/src/main.c index 904a9b1e1..b77b4d63d 100644 --- a/src/main.c +++ b/src/main.c @@ -1494,7 +1494,14 @@ main (gint argc, gchar **argv, gchar **env) sigaction (SIGINT, &signals, NULL); sigprocmask (SIG_UNBLOCK, &signals.sa_mask, NULL); /* Set alarm for hard termination */ - set_alarm (HARD_TERMINATION_TIME); + if (getenv ("G_SLICE") != NULL) { + /* Special case if we are likely running with valgrind */ + set_alarm (HARD_TERMINATION_TIME * 10); + } + else { + set_alarm (HARD_TERMINATION_TIME); + } + /* Wait for workers termination */ g_hash_table_foreach_remove (rspamd_main->workers, wait_for_workers, NULL);