From 32591b750fa52047d0b359c3fc02e9cf41631331 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Wed, 22 Feb 2017 11:40:01 +0530 Subject: [PATCH] MDEV-11718 5.5 rpl and federated tests massively fail in buildbot with valgrind Problem:- When MariaDB is compiled with jemalloc support, And we run mtr valgrind test, valgrind interferes with libjemalloc and returns false errors. Solution:- Run valgrind with --soname-synonyms=somalloc=libjemalloc* or --soname-synonyms=somalloc=NONE depending on whether we are dynamically linking or statically linking. Signed-off-by: Sachin Setiya --- mysql-test/mysql-test-run.pl | 9 +++++++++ mysql-test/valgrind.supp | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7bbbcead665..4229ceedb4d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -6193,6 +6193,15 @@ sub valgrind_arguments { mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) if -f "$glob_mysql_test_dir/valgrind.supp"; + my $temp= `ldd $ENV{MTR_BINDIR}/sql/mysqld | grep 'libjemalloc'`; + if ($temp) + { + mtr_add_arg($args, "--soname-synonyms=somalloc=libjemalloc*"); + } + else + { + mtr_add_arg($args, "--soname-synonyms=somalloc=NONE"); + } } # Add valgrind options, can be overriden by user diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 154031feb0d..4448f2a069a 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1074,3 +1074,13 @@ ... fun:pthread_create* } + +{ + Memory Leak in loader and valgrind malloc + Memcheck:Leak + match-leak-kinds:reachable + obj:*/vgpreload_memcheck*.so + ... + obj:*/ld-*.so + ... +}