Skip to content

Commit

Permalink
enable heap corruption detection in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oranagra committed Sep 15, 2024
1 parent a0315d9 commit 1d9a675
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/support/server.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down

0 comments on commit 1d9a675

Please sign in to comment.