From 067c344312a89b888040aece1b69eaa66b37ea31 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 1 Apr 2015 16:56:05 +0100 Subject: [PATCH] Add special case for valgrind to avoid early children termination. --- src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.39.5