Add valgrind suppression file for libpopt
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Oct 2012 20:41:20 +0000 (16:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Oct 2012 20:41:20 +0000 (16:41 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile.am
configure.ac
doc/development.txt
extras/Makefile.am [new file with mode: 0644]
extras/valgrind/Makefile.am [new file with mode: 0644]
extras/valgrind/popt.supp [new file with mode: 0644]

index 308ee16e785af05516bcc0a11b0120c3e3a752e9..7a636128d588ab980461cca49ebedf6efc302cff 100644 (file)
@@ -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
index 118b8d39223334f6f6880930968a00f646e1647b..24a9db6079d8cb1f7002b325b233ac5ea0d3ecd4 100644 (file)
@@ -106,5 +106,7 @@ AC_CONFIG_FILES([
        lib/prio_heap/Makefile
        include/Makefile
        tests/Makefile
+       extras/Makefile
+       extras/valgrind/Makefile
 ])
 AC_OUTPUT
index f18070c1e19c7c6682f51ae8e2253dbdd18c18e8..7b6c9e3527fecd01445707066ff36780a24337ae 100644 (file)
@@ -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 (file)
index 0000000..3e142d4
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = valgrind
diff --git a/extras/valgrind/Makefile.am b/extras/valgrind/Makefile.am
new file mode 100644 (file)
index 0000000..47dcc33
--- /dev/null
@@ -0,0 +1 @@
+EXTRA_DIST = popt.supp
diff --git a/extras/valgrind/popt.supp b/extras/valgrind/popt.supp
new file mode 100644 (file)
index 0000000..61b5465
--- /dev/null
@@ -0,0 +1,8 @@
+{
+       <poptGetArg-within-popt>
+       Memcheck:Leak
+       fun:malloc
+       fun:poptGetNextOpt
+       fun:main
+}
+
This page took 0.026593 seconds and 4 git commands to generate.