commit a5bd97a: [Minor] Add leak explanation

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 10 13:56:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-10 14:31:32 +0100
URL: https://github.com/rspamd/rspamd/commit/a5bd97a363284ce99d43054a5b4ac57b83534327

[Minor] Add leak explanation

---
 src/libserver/worker_util.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index a8ee92ec9..40f448954 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1582,7 +1582,12 @@ rspamd_set_crash_handler (struct rspamd_main *rspamd_main)
 	stack_t ss;
 	memset (&ss, 0, sizeof ss);
 
-	/* Allocate special stack, NOT freed at the end so far */
+	/*
+	 * Allocate special stack, NOT freed at the end so far
+	 * It also cannot be on stack as this memory is used when
+	 * stack corruption is detected. Leak sanitizer blames about it but
+	 * I don't know any good ways to stop this behaviour.
+	 */
 	ss.ss_size = MAX (SIGSTKSZ, 8192 * 4);
 	ss.ss_sp = g_malloc0 (ss.ss_size);
 	sigaltstack (&ss, NULL);


More information about the Commits mailing list