(not sure whether this is better for R-devel or R-help ...)

 I am currently trying to debug someone else's package (they're
not available at the moment, and I would like it to work *now*),
which among other things allocates memory for a persistent
buffer that gets used by various functions.

 The first symptoms of a problem were that some things just
didn't work under Windows but were (apparently) fine on Linux.
I don't have all the development tools installed for Windows, so
I started messing around under Linux, adding Rprintf() statements
to the main code.

 Once I did that, strange pointer-error-like inconsistencies started
appearing -- e.g., the properties of some of the persistent variables
would change if I did debug(function).  I'm wondering if anyone
has any tips on how to tackle this -- figure out how to use valgrind?
Do straight source-level debugging (R -d gdb etc.) and look for
obvious problems?  The package uses malloc/realloc rather than
Calloc/Realloc -- does it make sense to go through the code
replacing these all and see if that fixes the problem?

 cheers
   Ben Bolker

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to