From: Mathieu Desnoyers Date: Thu, 18 Oct 2012 20:41:20 +0000 (-0400) Subject: Add valgrind suppression file for libpopt X-Git-Tag: v1.0.0-rc6~1 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6aa249b5fbead5507a40500d29ef1640832eb2fc Add valgrind suppression file for libpopt Signed-off-by: Mathieu Desnoyers --- diff --git a/Makefile.am b/Makefile.am index 308ee16e..7a636128 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include types lib formats converter tests doc +SUBDIRS = include types lib formats converter tests doc extras dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ std-ext-lib.txt diff --git a/configure.ac b/configure.ac index 118b8d39..24a9db60 100644 --- a/configure.ac +++ b/configure.ac @@ -106,5 +106,7 @@ AC_CONFIG_FILES([ lib/prio_heap/Makefile include/Makefile tests/Makefile + extras/Makefile + extras/valgrind/Makefile ]) AC_OUTPUT diff --git a/doc/development.txt b/doc/development.txt index f18070c1..7b6c9e35 100644 --- a/doc/development.txt +++ b/doc/development.txt @@ -2,9 +2,20 @@ This document describes some principles that should be respected when developing in Babeltrace. Memory usage : + Since Babeltrace exports a library, we need to make sure that all allocated memory is freed, we do not want any memory leaks. Since Babeltrace uses the glib, it is necessary to assist a little valgrind when trying to identify memory leaks. + +libpopt has issues with inconsistency between versions. Namely, libpopt +0.16 allocates memory for the string returned by poptgetArg(), but not +libpopt 0.13. Therefore, we are providing a warning suppression file +that covers this case in the extras/ directory of the source code. + So the proper invocation of Babeltrace with Valgrind is : -G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full babeltrace + +G_SLICE=always-malloc G_DEBUG=gc-friendly \ + valgrind --leak-check=full \ + --suppressions=path_to_babeltrace_src/extras/valgrind/popt.supp \ + babeltrace diff --git a/extras/Makefile.am b/extras/Makefile.am new file mode 100644 index 00000000..3e142d45 --- /dev/null +++ b/extras/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = valgrind diff --git a/extras/valgrind/Makefile.am b/extras/valgrind/Makefile.am new file mode 100644 index 00000000..47dcc332 --- /dev/null +++ b/extras/valgrind/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = popt.supp diff --git a/extras/valgrind/popt.supp b/extras/valgrind/popt.supp new file mode 100644 index 00000000..61b5465a --- /dev/null +++ b/extras/valgrind/popt.supp @@ -0,0 +1,8 @@ +{ + + Memcheck:Leak + fun:malloc + fun:poptGetNextOpt + fun:main +} +