From 1d9a675c023f24f440a8cd355f9585e5fe5d6d8a Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Sun, 15 Sep 2024 12:12:16 +0300 Subject: [PATCH] enable heap corruption detection in tests --- tests/support/server.tcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 43b74d06133..4bef89e5c57 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -289,7 +289,8 @@ proc spawn_server {config_file stdout stderr args} { # ASAN_OPTIONS environment variable is for address sanitizer. If a test # tries to allocate huge memory area and expects allocator to return # NULL, address sanitizer throws an error without this setting. - set pid [exec /usr/bin/env ASAN_OPTIONS=allocator_may_return_null=1 {*}$cmd >> $stdout 2>> $stderr &] + # MALLOC_CHECK_ tells glibc to warn and abort on heap corruptions (e.g. use after free) + set pid [exec /usr/bin/env MALLOC_CHECK_=3 ASAN_OPTIONS=allocator_may_return_null=1 {*}$cmd >> $stdout 2>> $stderr &] } if {$::wait_server} {