From 2c4f7c6b6549f8b95845f1838dd0dc710c9e8304 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 29 Dec 2007 15:49:28 +0000 Subject: [PATCH] Add "check" framework support. Fixes bug #505622 (Guillaume Desmottes). svn path=/trunk/; revision=509 --- .gitignore | 1 + configure.ac | 25 +- m4/.gitignore | 2 + m4/Makefile.am | 0 acinclude.m4 => m4/acinclude.m4 | 0 m4/empathy-args.m4 | 19 + m4/empathy-valgrind.m4 | 31 ++ rules/check.mak | 120 ++++++ tests/.gitignore | 3 + tests/Makefile.am | 27 ++ tests/check-empathy-utils.c | 29 ++ tests/check-helpers.c | 63 +++ tests/check-helpers.h | 43 ++ tests/check-libempathy.h | 6 + tests/check-main.c | 40 ++ tests/dlopen.supp | 127 ++++++ tests/valgrind.supp | 711 ++++++++++++++++++++++++++++++++ 17 files changed, 1245 insertions(+), 2 deletions(-) create mode 100644 m4/.gitignore create mode 100644 m4/Makefile.am rename acinclude.m4 => m4/acinclude.m4 (100%) create mode 100644 m4/empathy-args.m4 create mode 100644 m4/empathy-valgrind.m4 create mode 100644 rules/check.mak create mode 100644 tests/.gitignore create mode 100644 tests/check-empathy-utils.c create mode 100644 tests/check-helpers.c create mode 100644 tests/check-helpers.h create mode 100644 tests/check-libempathy.h create mode 100644 tests/check-main.c create mode 100644 tests/dlopen.supp create mode 100644 tests/valgrind.supp diff --git a/.gitignore b/.gitignore index 0aa2d30c..069396fb 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ ltmain.sh missing mkinstalldirs omf.make +compile diff --git a/configure.ac b/configure.ac index c86b1190..4f164ac7 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,7 @@ MISSION_CONTROL_REQUIRED=4.37 # AC_DEFINE(G_DISABLE_DEPRECATED, 1, [Disable deprecated GLib symbols]) # AC_DEFINE(LIBTELEPATHY_DISABLE_DEPRECATED, 1, [Disable deprecated libtelepathy symbols]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(.) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define) @@ -210,11 +211,24 @@ AM_CONDITIONAL(HAVE_NOTHERE, test "x$have_nothere" = "xyes") # Tests # ----------------------------------------------------------- AC_ARG_ENABLE(tests, - AS_HELP_STRING([--enable-tests=@<:@no/yes@:>@], + AS_HELP_STRING([--enable-tests=@<:@no/yes/auto@:>@], [build tests]), , enable_tests=no) -AM_CONDITIONAL(HAVE_TESTS, test "x$enable_tests" = "xyes") +if test "x$enable_tests" != "xno"; then + PKG_CHECK_MODULES(CHECK, + [ + check >= 0.9.4 + ], have_check="yes", have_check="no") +else + have_check=no +fi + +if test "x$enable_tests" = "xyes" -a "x$have_check" != "xyes"; then + AC_MSG_ERROR([Couldn't find check dependencies.]) +fi + +AM_CONDITIONAL(HAVE_TESTS, test "x$have_check" = "xyes") # ----------------------------------------------------------- # Python Bindings @@ -267,6 +281,12 @@ fi AM_CONDITIONAL(HAVE_VOIP, test "x$enable_voip" = "xyes") +# Checks for the 'check' unit testing library +PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], + [ HAVE_CHECK=yes ], + [ HAVE_CHECK=no ] ) +AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes") + # ----------------------------------------------------------- AC_OUTPUT([ @@ -280,6 +300,7 @@ AC_OUTPUT([ libempathy-gtk/Makefile libempathy-gtk/libempathy-gtk.pc src/Makefile + m4/Makefile megaphone/Makefile megaphone/src/Makefile megaphone/data/Makefile diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 00000000..e429342b --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,2 @@ +gtk-doc.m4 +intltool.m4 diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 00000000..e69de29b diff --git a/acinclude.m4 b/m4/acinclude.m4 similarity index 100% rename from acinclude.m4 rename to m4/acinclude.m4 diff --git a/m4/empathy-args.m4 b/m4/empathy-args.m4 new file mode 100644 index 00000000..3daacbab --- /dev/null +++ b/m4/empathy-args.m4 @@ -0,0 +1,19 @@ +dnl configure-time options for Empathy + +dnl EMPATHY_ARG_VALGRIND + +AC_DEFUN([EMPATHY_ARG_VALGRIND], +[ + dnl valgrind inclusion + AC_ARG_ENABLE(valgrind, + AC_HELP_STRING([--enable-valgrind],[enable valgrind checking and run-time detection]), + [ + case "${enableval}" in + yes|no) enable="${enableval}" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;; + esac + ], + [enable=no]) + + EMPATHY_VALGRIND($enable, [2.1]) +]) diff --git a/m4/empathy-valgrind.m4 b/m4/empathy-valgrind.m4 new file mode 100644 index 00000000..7a44e103 --- /dev/null +++ b/m4/empathy-valgrind.m4 @@ -0,0 +1,31 @@ +dnl Detect Valgrind location and flags + +AC_DEFUN([EMPATHY_VALGRIND], +[ + enable=$1 + if test -n "$2"; then + valgrind_req=$2 + else + valgrind_req="2.1" + fi + + PKG_CHECK_MODULES(VALGRIND, valgrind > "$valgrind_req", + have_valgrind_runtime="yes", have_valgrind_runtime="no") + + AC_PATH_PROG(VALGRIND_PATH, valgrind) + + # Compile the instrumentation for valgrind only if the valgrind + # libraries are installed and the valgrind executable is found + if test "x$enable" = xyes && + test "$have_valgrind_runtime" = yes && + test -n "$VALGRIND_PATH" ; + then + AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used]) + AC_MSG_NOTICE(using compile-time instrumentation for valgrind) + fi + + AC_SUBST(VALGRIND_CFLAGS) + AC_SUBST(VALGRIND_LIBS) + + AM_CONDITIONAL(HAVE_VALGRIND, test -n "$VALGRIND_PATH") +]) diff --git a/rules/check.mak b/rules/check.mak new file mode 100644 index 00000000..bbb9819f --- /dev/null +++ b/rules/check.mak @@ -0,0 +1,120 @@ +LOOPS = 10 +CLEANFILES += valgrind.*.log + +# run any given test by running make test.check +# if the test fails, run it again at at least debug level 2 +%.check: % + @$(TESTS_ENVIRONMENT) \ + $* || \ + $(TESTS_ENVIRONMENT) \ + $* + +# run any given test in a loop +%.torture: % + @for i in `seq 1 $(LOOPS)`; do \ + $(TESTS_ENVIRONMENT) \ + $*; done + +# run any given test in an infinite loop +%.forever: % + @while true; do \ + $(TESTS_ENVIRONMENT) \ + $* || break; done + +# valgrind any given test by running make test.valgrind +%.valgrind: % + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + G_DEBUG=gc-friendly \ + libtool --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --leak-resolution=high --num-callers=20 \ + ./$* 2>&1 | tee "valgrind.$*.log" + @if grep "==" "valgrind.$*.log" > /dev/null 2>&1; then \ + exit 1; \ + fi + +# valgrind any given test and generate suppressions for it +%.valgrind.gen-suppressions: % + $(TESTS_ENVIRONMENT) \ + CK_DEFAULT_TIMEOUT=360 \ + G_SLICE=always-malloc \ + G_DEBUG=gc-friendly \ + libtool --mode=execute \ + $(VALGRIND_PATH) -q \ + $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --leak-resolution=high --num-callers=20 \ + --gen-suppressions=all \ + ./$* 2>&1 | tee suppressions.log + +# valgrind any given test until failure by running make test.valgrind-forever +%.valgrind-forever: % + @while $(MAKE) $*.valgrind; do \ + true; done + +# gdb any given test by running make test.gdb +%.gdb: % + $(TESTS_ENVIRONMENT) \ + CK_FORK=no \ + libtool --mode=execute \ + gdb $* + +# torture tests +torture: $(TESTS) + @echo "Torturing tests ..." + for i in `seq 1 $(LOOPS)`; do \ + $(MAKE) check || \ + (echo "Failure after $$i runs"; exit 1) || \ + exit 1; \ + done + @banner="All $(LOOPS) loops passed"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo $$dashes; echo $$banner; echo $$dashes + +# forever tests +forever: $(TESTS) + @echo "Forever tests ..." + while true; do \ + $(MAKE) check || \ + (echo "Failure"; exit 1) || \ + exit 1; \ + done + +# valgrind all tests +valgrind: $(TESTS) + @echo "Valgrinding tests ..." + @failed=0; \ + for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \ + $(MAKE) $$t.valgrind; \ + if test "$$?" -ne 0; then \ + echo "Valgrind error for test $$t"; \ + failed=`expr $$failed + 1`; \ + whicht="$$whicht $$t"; \ + fi; \ + done; \ + if test "$$failed" -ne 0; then \ + echo "$$failed tests had leaks or errors under valgrind:"; \ + echo "$$whicht"; \ + false; \ + fi + +help: + @echo "make check -- run all checks" + @echo "make torture -- run all checks $(LOOPS) times" + @echo "make (dir)/(test).check -- run the given check once" + @echo "make (dir)/(test).forever -- run the given check forever" + @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times" + @echo + @echo "make (dir)/(test).gdb -- start up gdb for the given test" + @echo + @echo "make valgrind -- valgrind all tests" + @echo "make (dir)/(test).valgrind -- valgrind the given test" + @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever" + @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions" + @echo " and save to suppressions.log" + @echo "make inspect -- inspect all plugin features" + diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..edf30324 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,3 @@ +check-main +contact-manager +*.log diff --git a/tests/Makefile.am b/tests/Makefile.am index 8c6094c9..29ed270e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,9 @@ +CLEANFILES= + +include $(top_srcdir)/rules/check.mak + +SUPPRESSIONS=valgrind.supp dlopen.supp + AM_CPPFLAGS = \ -I$(top_srcdir) \ $(EMPATHY_CFLAGS) \ @@ -13,3 +19,24 @@ bin_PROGRAMS = \ contact_manager_SOURCES = contact-manager.c +if HAVE_CHECK +check_PROGRAMS = check-main +TESTS = check-main +check_main_SOURCES = \ + check-main.c \ + check-helpers.c \ + check-helpers.h \ + check-libempathy.h \ + check-empathy-utils.c + +check_main_LDADD = \ + @CHECK_LIBS@ \ + $(top_builddir)/libempathy-gtk/libempathy-gtk.la \ + $(top_builddir)/libempathy/libempathy.la \ + $(AM_LDFLAGS) + +check_main_CFLAGS = \ + @CHECK_CFLAGS@ \ + $(AM_CFLAGS) + +endif diff --git a/tests/check-empathy-utils.c b/tests/check-empathy-utils.c new file mode 100644 index 00000000..faf26105 --- /dev/null +++ b/tests/check-empathy-utils.c @@ -0,0 +1,29 @@ +#include +#include +#include + +#include +#include "check-helpers.h" +#include "check-libempathy.h" + +#include + +START_TEST (test_empathy_substring) +{ + gchar *tmp; + + tmp = empathy_substring ("empathy", 2, 6); + fail_if (tmp == NULL); + fail_if (strcmp (tmp, "path") != 0); + + g_free (tmp); +} +END_TEST + +TCase * +make_empathy_utils_tcase (void) +{ + TCase *tc = tcase_create ("empathy-utils"); + tcase_add_test (tc, test_empathy_substring); + return tc; +} diff --git a/tests/check-helpers.c b/tests/check-helpers.c new file mode 100644 index 00000000..1bb14cde --- /dev/null +++ b/tests/check-helpers.c @@ -0,0 +1,63 @@ +/* + * check-helpers.c - Source for some check helpers + * Copyright (C) 2007 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "check-helpers.h" + +static gboolean expecting_critical = FALSE; +static gboolean received_critical = FALSE; + +static void +check_helper_log_critical_func (const gchar *log_damain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) +{ + + if (!expecting_critical) + { + fail("Unexpected critical message: %s\n", message); + } + + g_assert (log_level & G_LOG_LEVEL_CRITICAL); + + received_critical = TRUE; +} + +gboolean +got_critical (void) +{ + return received_critical; +} + +void +expect_critical (gboolean expected) +{ + expecting_critical = expected; + received_critical = FALSE; +} + +void +check_helpers_init (void) +{ + g_log_set_handler (NULL, G_LOG_LEVEL_CRITICAL, + check_helper_log_critical_func, NULL); +} diff --git a/tests/check-helpers.h b/tests/check-helpers.h new file mode 100644 index 00000000..b71b3b65 --- /dev/null +++ b/tests/check-helpers.h @@ -0,0 +1,43 @@ +/* + * check-helpers.c - Source for some check helpers + * Copyright (C) 2007 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __CHECK_HELPERS_H__ +#define __CHECK_HELPERS_H__ + +#include +#include + +void +check_helpers_init (void); + +void +expect_critical (gboolean expected); + +gboolean +got_critical (void); + +#define fail_unless_critical(expr, ...) \ +G_STMT_START { \ + expect_critical (TRUE); \ + expr; \ + _fail_unless (got_critical (), __FILE__, __LINE__, \ + "Expected g_critical, got none", ## __VA_ARGS__, NULL); \ + expect_critical (FALSE); \ +} G_STMT_END; + +#endif /* #ifndef __CHECK_HELPERS_H__ */ diff --git a/tests/check-libempathy.h b/tests/check-libempathy.h new file mode 100644 index 00000000..1f330258 --- /dev/null +++ b/tests/check-libempathy.h @@ -0,0 +1,6 @@ +#ifndef __CHECK_LIBEMPATHY__ +#define __CHECK_LIBEMPATHY__ + +TCase * make_empathy_utils_tcase (void); + +#endif /* #ifndef __CHECK_LIBEMPATHY__ */ diff --git a/tests/check-main.c b/tests/check-main.c new file mode 100644 index 00000000..6dcfe323 --- /dev/null +++ b/tests/check-main.c @@ -0,0 +1,40 @@ +#include +#include +#include +#include + +#include + +#include "check-helpers.h" +#include "check-libempathy.h" + +#include "config.h" + +static Suite * +make_libempathy_suite (void) +{ + Suite *s = suite_create ("libempathy"); + + suite_add_tcase (s, make_empathy_utils_tcase ()); + + return s; +} + +int +main (void) +{ + int number_failed = 0; + Suite *s; + SRunner *sr; + + check_helpers_init (); + g_type_init (); + + s = make_libempathy_suite (); + sr = srunner_create (s); + srunner_run_all (sr, CK_NORMAL); + number_failed += srunner_ntests_failed (sr); + srunner_free (sr); + + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/tests/dlopen.supp b/tests/dlopen.supp new file mode 100644 index 00000000..f6300a3a --- /dev/null +++ b/tests/dlopen.supp @@ -0,0 +1,127 @@ +{ + + Addrcheck,Memcheck:Cond + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Addr4 + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Cond + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Addr4 + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libc-2.5.so + fun:_dl_sym + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlsym +} +{ + + Addrcheck,Memcheck:Cond + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libc-2.5.so + fun:_dl_sym + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlsym +} +{ + + Addrcheck,Memcheck:Addr1 + fun:malloc + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Addr1 + fun:malloc + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Addr1 + fun:malloc + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + fun:dlopen +} +{ + + Addrcheck,Memcheck:Addr4 + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so + obj:/lib/ld-2.5.so + obj:/lib/i686/cmov/libdl-2.5.so +} diff --git a/tests/valgrind.supp b/tests/valgrind.supp new file mode 100644 index 00000000..29bb0454 --- /dev/null +++ b/tests/valgrind.supp @@ -0,0 +1,711 @@ +### this file contains suppressions for valgrind when running +### the gibber/telepathy-salut unit tests based on the gstreamer one + +### syscall suppressions + +{ + + Memcheck:Param + clone(parent_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(child_tidptr) + fun:clone + fun:clone +} + +{ + + Memcheck:Param + clone(tlsinfo) + fun:clone + fun:clone +} + +### glibc suppressions + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +# glibc does not deallocate thread-local storage + +{ + + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@* +} + +# I get an extra stack entry on x86/dapper +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.3.*.so + fun:_dl_allocate_tls + fun:pthread_create@@* +} + + +{ + + Memcheck:Cond + fun:strstr + fun:__pthread_initialize_minimal + obj:/lib/libpthread-*.so + obj:/lib/libpthread-*.so + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + +# a thread-related free problem in glibc from Edgard +{ + __libc_freeres_rw_acess + Memcheck:Addr4 + obj:* + obj:* + obj:* + obj:* + obj:* + fun:__libc_freeres +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +# g_module_open-related problems +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:dl_open_worker + obj:/lib/ld-2.3.*.so + fun:_dl_open + fun:dlopen_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:do_sym + fun:_dl_sym + fun:dlsym_doit + obj:/lib/ld-2.3.*.so + fun:_dlerror_run + fun:dlsym + fun:g_module_symbol + fun:g_module_open +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.*.so + obj:/lib/libc-2.3.*.so + fun:mbsnrtowcs + fun:vfprintf + fun:vsprintf + fun:sprintf + obj:/lib/libc-2.3.*.so +} + +# valgrind doesn't allow me to specify a suppression for Addr1, Addr2, Addr4 +# as Addr*, so 3 copies for that; and then 2 of each for that pesky memcpy +{ + + Memcheck:Addr1 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr1 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr2 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} +{ + + Memcheck:Addr4 + fun:memcpy + fun:_dl_signal_error + fun:_dl_map_object_deps + fun:dl_open_worker + fun:_dl_catch_error + fun:_dl_open + fun:dlopen_doit + fun:_dl_catch_error + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 + fun:g_module_open +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.*.so + obj:/lib/libc-2.3.*.so + obj:/lib/ld-2.3.*.so + fun:_dl_open + obj:/lib/libdl-2.3.*.so + obj:/lib/ld-2.3.*.so + obj:/lib/libdl-2.3.*.so + fun:dlopen + fun:g_module_open +} + +{ + + Memcheck:Addr4 + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libc-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/tls/i686/cmov/libdl-2.3.6.so + fun:dlopen +} + +### glib suppressions +{ + + Memcheck:Cond + fun:g_parse_debug_string + obj:/usr/lib*/libglib-2.0.so.* + fun:g_slice_alloc + fun:g_slice_alloc0 +} + +{ + + Memcheck:Leak + fun:malloc + fun:g_malloc + fun:g_strdup + fun:g_quark_from_string + obj:* + obj:* + fun:g_type_register_fundamental + obj:* + fun:g_type_init_with_debug_flags + fun:g_type_init +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + obj:* + obj:* + fun:g_type_register_fundamental +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + obj:* + obj:* + fun:g_type_init_with_debug_flags +} + +{ + + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_slice_alloc + obj:* + obj:* + fun:g_type_init_with_debug_flags +} + +#pthread memleaks + +{ + Thread creation leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_initialize_minimal +} + +{ + Thread management leak + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + Thread management leak 2 + Memcheck:Leak + fun:memalign + fun:_dl_allocate* + fun:_dl_allocate* + fun:__pthread_* +} + +{ + pthread_create Syscall param write(buf) points to uninitialised byte(s) + Memcheck:Param + write(buf) + fun:pthread_create@@GLIBC_2.2.5 + fun:g_thread_create* + +} + +# nss_parse_* memleak (used by g_option_context_parse) +{ + nss_parse_* memleak + Memcheck:Leak + fun:malloc + fun:nss_parse_service_list + fun:__nss_database_lookup +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.3.6.so +} + +{ + + Memcheck:Param + futex(uaddr2) + fun:pthread_once + obj:/lib/libc-2.3.6.so + obj:/lib/libc-2.3.6.so + fun:setlocale + fun:init_pre + fun:g_option_context_parse +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.3.6.so + obj:/lib/ld-2.3.6.so + fun:_dl_open + obj:/lib/libdl-2.3.6.so + obj:/lib/ld-2.3.6.so + obj:/lib/libdl-2.3.6.so + fun:dlopen + fun:g_module_open +} +# this exists in a bunch of different variations, hence the short tail/trace +{ + + Memcheck:Addr4 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} +{ + + Memcheck:Addr8 + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +# More edgy suppressions (Mike) +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:dlopen_doit + obj:/lib/ld-2.4.so + fun:_dlerror_run + fun:dlopen@@GLIBC_2.1 +} + +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + fun:do_sym + fun:_dl_sym +} + +# This one's overly general, but there's zero other information in the stack +# trace - just these five lines! +{ + + Memcheck:Cond + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so + obj:/lib/ld-2.4.so +} + +{ + + Memcheck:Leak + fun:calloc + obj:/lib/ld-2.4.so + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +{ + + Memcheck:Leak + fun:calloc + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am_linux + obj:/usr/lib/libcdio.so.6.0.1 + fun:cdio_open_am +} + +# TLS leaks for feisty/x86 +{ + + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 +} + +{ + + Memcheck:Addr8 + obj:/lib/ld-2.5.so +} + +{ + + Memcheck:Leak + fun:malloc + obj:/lib/libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_home_dir +} +{ + + Memcheck:Leak + fun:malloc + obj:/lib/libc-*.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_user_name +} -- 2.39.2