[R] Repeatable, But Time Varying R GUI Crash

Marilyn & Rich Short rm.short at comcast.net
Thu Aug 6 22:11:45 CEST 2009


Hello,

I'm having a problem in R. The R GUI is crashing with a message to 
contact Microsoft for the solution. I've contacted Microsoft and they 
are of no help. Below is a distilled set of code that will cause the 
crash. As you will see, there are two do-loops within which is a "load" 
command. The crash usually occurs after 200*400 (=80,000) to 
2,000*400(=800,000) iterations.

Do you have any suggestions on work-arounds?

Once you start the function with the  "problem2()" command, the function 
will print to the screen once every 400 iterations. You can monitor the 
progress by clicking the scroll button. The R GUI should crash somewhere 
between i=200 and i=2000. Although the problem is repeatable, the time 
at which the crash occurs is random.

Thanks in advance for your attention,

Rich Short

I'm using Windows XP, SP3 and R 2.9.1.
Here is my session info:

> sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

(The problem occurs on my Vista machine as well.)
*******************************************

# This script induces the R GUI to crash.

problem2 = function(){

junk = mat.or.vec(8,40)

junk[] = 1

mjunk = mat.or.vec(8,40)

mjunk[] = -1

PathA = tempdir()

conX = paste(PathA,"junkx",sep="\\")

conY = paste(PathA,"junky",sep="\\")

outJunk = file(conX, open="wb")

save(junk, file=outJunk)

close(outJunk)

outJunkY = file(conY, open="wb")

save(mjunk, file=outJunkY)

close(outJunkY)

sign = 1

for(i in 1:4000){

for(ii in 1:400){

sign = -sign

if(sign<0){

load(file=conX)

}else{

load(file=conY)

}

sum = junk[1,5] + mjunk[3,30]

}

cat(" junk = ",junk[1,5],sep="")

cat(" mjunk = ",mjunk[3,30],sep="")

cat(" sum = ",sum,sep="")

cat(" i = ",i,"\n",sep="")

}

}




More information about the R-help mailing list