The dmalloc (http://dmalloc.com/) tool is somewhat useful tool for checking memory issues. Valgrind is probably "better", but it slows things down too much in some environments. The level of "support" I'd like to have in Pulseaudio is just including dmalloc.h in pulse/xmalloc.c if HAVE_DMALLOC is defined. This is pretty useless for tracking down memory leaks, because dmalloc only reports the immediate caller of malloc(), which in case of Pulseaudio will always be pa_xmalloc(). There are checks for other errors than memory leaks, so dmalloc can still be useful. So, what needs to be done is adding this to pulse/xmalloc.c: #ifdef HAVE_DMALLOC #include <dmalloc.h> #endif In addition to that, Makefile.am of course needs some adjustment, and I'd like to have --enable-dmalloc switch in the configure script. Note that linking libdmallocth into libpulse requires dmalloc to be built with -fPIC. That isn't enabled by default in dmalloc's build system, so this needs to be mentioned in "configure --help" for the --enable-dmalloc switch. It would be nice to check in the configure script whether the installed libdmallocth.a is built with -fPIC, but I don't know how that can be done, or whether it's even possible.
If someone (likely me - I filed this bug mainly to remind myself) implements this, please add a how-to to the wiki for setting up and using dmalloc with Pulseaudio.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/255.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.