summaryrefslogtreecommitdiff
path: root/README.valgrind
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2012-10-12 22:04:11 +0530
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-11-09 15:27:27 +0000
commitad6e1b0420d5da61459a5532d61f03a61e6c8b14 (patch)
treea1209791815d9fba0df50491471832f3c11005a4 /README.valgrind
parentd9f470a7f434f13d43f36d0023f108c2d2ed2bd9 (diff)
downloaddbus-ad6e1b0420d5da61459a5532d61f03a61e6c8b14.tar.gz
Add documentation on running clients with Valgrind
Quick documentation on how Valgrind can be run in clients without triggering false positives. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55933 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'README.valgrind')
-rw-r--r--README.valgrind24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.valgrind b/README.valgrind
new file mode 100644
index 00000000..c13f5304
--- /dev/null
+++ b/README.valgrind
@@ -0,0 +1,24 @@
+Running D-Bus clients with Valgrind
+====
+
+When running programs using libdbus in Valgrind, some special care needs to be
+taken so as to avoid incorrect detection of leaks in libdbus. To avoid these
+false positives, do the following:
+
+* Grab a copy of the D-Bus source code
+
+* Run configure with the --enable-developer and --with-valgrind options
+
+* Run make
+
+* Either make sure your code calls dbus_shutdown() (at least while running in
+ Valgrind) or set DBUS_MESSAGE_CACHE=0 in your environment
+
+* Run Valgrind on your program with the /path/to/dbus/source/dbus/.libs in your
+ LD_LIBRARY_PATH
+
+Your Valgrind log should now be free of any (spurious) libdbus-related leaks.
+
+For the curious, the DBUS_MESSAGE_CACHE=0 is required because by
+default, libdbus uses a recyclable pool of message structs. These help
+performance a bit.