[Rd] Need help debugging R.

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Aug 24 16:53:41 CEST 2004


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> You need one of
> 
> 1) gctorture(TRUE)
> 
> 2) Run under valgrind to look for memory overruns.
> 
> and patience.  If it segfaults under gctorture you will probably see the 
> real culprit via gdb.
> 
> I would try under R-devel, as quite a few memory problems have been 
> plugged there.  Or at least under R-patched (ditto, but not quite all 
> those in R-devel).

Other tricks: record the gc_count value at the crash and set a break
conditional on that value, before stack corruption sets in. Or break
at the previous value, and then set the gctorture switch. Once you
figure out which memory location has inconsistent data, set a hardware
watchpoint on it. Might take quite a bit of stamina, in additeon to
the patience...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list