Skip to content
Prev 14194 / 63424 Next

need help debugging on Windows

Thanks to Duncan and Brian for the pointers.  I was able to run gdb under
XP, but it didn't help much.  What eventually helped is valgrind (on Linux
on ia32)!  It indicated memory leaks, and here's how the leaks occurred:

The main C function called from R has a loop over trees, and calls a
function that grows regression trees.  That function, in turns, calls a
function that loop over variables and find the best one to split on.  I
Calloc()'ed arrays in the beginning of those functions and Free() them at
the end.  What I forgot is that there were conditional return in the middle
of those functions, bypassing the Free().

Best,
Andy
http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR

I've found both the MinGW and Cygwin versions of gdb work, and use it
under insight.  It's rather painful compared to other Windows
debuggers, but it does the job.  I've never been able to get ddd
going.

Duncan Murdoch