Skip to content
Prev 312576 / 398506 Next

segfault debugging

On 12/01/2012 04:51 AM, Duncan Murdoch wrote:
valgrind is usually effective for this

   R -d valgrind -f myscript.R

but it requires an operating system where it is available (e.g., linux) and a 
quick (say less than 10's of seconds) way of reproducing the bug (because 
valgrind slows evaluation alot). So the first step is really to narrow down your 
large script to something that is easier to re-run., e.g., saving the important 
R objects to a file shortly before the problem section of your script, then 
reproducing the problem by loading those and evaluating a few steps of the code. 
The bug can still be intermittent; valgrind will likely spot the problem.

Martin