From p.dalgaard at biostat.ku.dk  Tue Aug 24 16:53:41 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Aug 24 16:58:37 2004
Subject: [Rd] Need help debugging R.
In-Reply-To: <Pine.LNX.4.44.0408241536590.2117-100000@gannet.stats>
References: <Pine.LNX.4.44.0408241536590.2117-100000@gannet.stats>
Message-ID: <x2brh01tai.fsf@biostat.ku.dk>

Prof Brian Ripley <ripley@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@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Need help debugging R.
Peter Dalgaard