[Rd] problem with glm (PR#452)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
20 Feb 2000 13:30:07 +0100


Brad McNeney <mcneney@cs.sfu.ca> writes:

> I'll see what I can do about getting a more reproducible error. 
> 
> Any tips on what to look for if I'm running R within GDB? I don't have
> much experience with the debugger. I mostly just use it to see where my
> programs are dying. But R is not -- it just gives strange error messages.

One technique is to set a breakpoint at the line that displays the
error, then you can inspect the condition that caused it (you may have
to go "up" a couple of times to get into an interesting environment.)

Sometimes, it turns out that a variable contains something that it
shouldn't due to memory corruption and then you may have to set a
breakpoint earlier in the code and then maybe a watchpoint on the
memory location.

Another thing that is useful even without gdb is to investigate the
output of traceback() and maybe set 

options(error=quote(DUMP <<- sys.status()))

which allows you to subsequently investigate any active environment at
the time of the error, e.g. using ls(envir=DUMP$sys.frames[[3]]), and
get("x",envir=DUMP$sys.frames[[3]]).

(Newer snapshots have a more elaborate dump.frames function, but the
above should do). 

-- 
   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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._