[R] how to debug a sudden exit in non-interactive mode

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Sep 3 22:02:03 CEST 2004

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

> If you look in ?debugger, especially right at the end, you will see how to
> attempt a post-mortem dump of the frams to a file.  If that gets run (and
> this might be a fatal error from C level, but it is not reporting so), you
> can reload the dump and use debugger on it.
> On Fri, 3 Sep 2004, Vadim Ogranovich wrote:
> > # Here I run it non-interactively from the shell. Note that the last
> > line, cat("after\n"), doesn't get executed. (it does get executed in the
> > interactive mode or with --no-init-file)
> > ~% R --no-save --no-restore --silent < debug.R

Also, with an invocation like that, you can run under the debugger as

  $ R -d gdb
  (gdb) run --no-save --no-restore --silent < debug.R

and maybe set a breakpoint in the error handler, or just let it run to
completion and see if it segfaults or something.

   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-help mailing list