Bug 46989 - Add support for the dmalloc memory checking tool.
Summary: Add support for the dmalloc memory checking tool.
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-05 22:40 UTC by Tanu Kaskinen
Modified: 2018-07-30 10:11 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Tanu Kaskinen 2012-03-05 22:40:30 UTC
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.
Comment 1 Tanu Kaskinen 2012-03-05 22:49:10 UTC
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.
Comment 2 GitLab Migration User 2018-07-30 10:11:20 UTC
-- 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.