[R] debug an error that incapacitates R?

Liviu Andronic landronimirc at gmail.com
Sun Dec 13 11:31:34 CET 2009


Dear all
How should I attempt debugging this error?
> sosInit()
Error: invalid connection

When this happens R refuses to run anything:
> 2+2
Error: invalid connection
> sessionInfo ()
Error in stdout() : invalid connection


Debugging it seems impossible.
> options(error=recover)
> sosInit()
Error: invalid connection
Error during wrapup: invalid connection


The error also "crashes" browser().
Browse[1]> n
debug at /home/liviu/Devel/Rcmdr-dev/Rcmdr.sos/RcmdrPlugin.sos-0.1-0/R/sosInit.R#51:
doItAndPrint(paste("## Launching RSiteSearch, please be patient.."))
Browse[2]>
Error in function ()  : invalid connection
Error: invalid connection
>

To reproduce the example, you would need to source the following file [1]. Then
require(Rcmdr)
require(sos)
sosInit()

and in the box enter a string similar to "asdf ; HTMLgrid". If you
enter simple strings such as "asdf", the function will perform as
expected and R will not become non-responsive.
[1] http://s000.tinyupload.com/index.php?file_id=15379960405416742593

Please let me know of any ideas that would help tackle this one. Thank you
Liviu


This is a sessionInfo() prior to running the crash-function.
> sessionInfo()
R version 2.10.0 (2009-10-26)
x86_64-pc-linux-gnu

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
 [1] datasets  grid      splines   graphics  stats     utils     grDevices
 [8] tcltk     methods   base

other attached packages:
 [1] fortunes_1.3-6           RcmdrPlugin.HH_1.1-25    HH_2.1-32
 [4] leaps_2.9                multcomp_1.1-2           mvtnorm_0.9-8
 [7] lattice_0.17-26          RcmdrPlugin.sos_0.1-0    RcmdrPlugin.Export_0.3-0
[10] Hmisc_3.7-0              survival_2.35-7          xtable_1.5-6
[13] Rcmdr_1.5-4              car_1.2-16               relimp_1.0-1
[16] sos_1.1-7                brew_1.0-3               hints_1.0.1-1

loaded via a namespace (and not attached):
[1] cluster_1.12.1




More information about the R-help mailing list