[gst-devel] valgrind

Richard Boulton richard at tartarus.org
Wed Apr 3 17:31:27 CEST 2002


Some of you may have heard of "valgrind".  If you havn't, I recommend
checking it out: http://developer.kde.org/~sewardj/

Basically, it runs an application in a virtual machine, monitoring all
the memory accesses (and a few other things) to detect errors such as
memory leaks, writing of unallocated memory, reading of uninitialised
memory, and invalid calls to system calls.

It's got several limitations which stop it being fully ready for use
with gstreamer: it doesn't support threads being the main one.  It also
doesn't support a couple of system calls which gstreamer uses, but
that's easy to fix so I've just submitted a patch to the valgrind author
(available at http://www.tartarus.org/~richard/valgrind-patch) which
fixes it.  With this patch, gst-launch fakesrc ! fakesink runs
successfully (though valgrind gives out what look like incorrect
diagnostic messages).

Also, I don't think it's handling the stack switching done for the
cothreads correctly at the moment.

So: why am I talking about a tool which isn't ready to use on
gstreamer?  Because it's proved very useful to me on several other
projects, and I think it would be well worth the effort to try and get
it to work nicely for gstreamer.  I'm going to try and fix a few things
up, but there are people on this list with much better experience of the
relevant areas who are likely to be able to do much better than me.

Anyway, hope that you find this useful, and look into valgrind, and have
fun at GUADEC!

-- 
Richard




More information about the gstreamer-devel mailing list