Valgrind has just helped me track down a nasty segfault-producing bug in a test app. This time, it turns out it was an invalid read in an XS dependency and not something in in my own distro, but I'd like to continue to use Valgrind as a troubleshooting aid going forward with my expanding C and XS code base.

Valgrind is a fantastic tool, and has helped me track down some really nasty bugs within my XS/C code. It also found problems that I wasn't even aware off:)

I've considered making my module run under Valgrind as part of the test suite, but haven't done enough analysis on the issues involved.

I see from the list archives that Valgrind has been discussed here in the past. If any of you can share your methodology for troubleshooting memory problems with valgrind (or without), I would be grateful.

Although not because of Valgrind, I ended up moving all of my memory allocation into separate global functions. So I now have:

mymodule_malloc
mymodule_free
mymodule_realloc

This made tracking memory issues with Valgrind very simple.

Cheers,

jez.


Reply via email to