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

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 3 20:51:10 CEST 2004


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:

> Hi,
>  
> I have a piece of R code that calls mgcv::gam. The code runs fine in the
> interactive mode, but terminates R w/o a single message when run
> non-interactively. Though I think I should be able to locate the problem
> by brute force I'd appreciate an advise how to do it more intelligently
> using R debugging tools.
>  
> At this time I only know that it has something to do with me loading my
> custom library, vor, in .Rprofile.
>  
> I use R-1.9.1 on RH7.3.
>  
> Following the posting guide I include an example (note that it may work
> for you fine since you don't have my .Rprofile). 
>  
> This is debug.R file:
> #=============
> dataLength <- 1e3
> y <-rnorm(dataLength)
> x <- rnorm(dataLength)
>  
> library("mgcv")
>  
> cat("before\n")
>   
> xy.gam <- gam(y ~ s(x), knots=list(place.knots(x, 25)), fit=FALSE)
>  
> cat("after\n")
> 
>  
>  
> # 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
> .First.lib of vor 
> > dataLength <- 1e3
> > y <-rnorm(dataLength)
> > x <- rnorm(dataLength)
> > 
> > library("mgcv")
> This is mgcv 1.0-9 
> > 
> > cat("before\n")
> before
> >   
> > xy.gam <- gam(y ~ s(x), knots=list(place.knots(x, 25)), fit=FALSE)
> ~% 
>  
>  
> Thanks,
> Vadim
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list