File: README.valgrind

package info (click to toggle)
dbus 1.12.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 10,960 kB
  • sloc: ansic: 99,636; xml: 8,213; sh: 5,754; makefile: 1,716; python: 159; cpp: 22
file content (24 lines) | stat: -rw-r--r-- 831 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.