[R] Re : stack overflow when loading workspace

Duncan Murdoch murdoch at stats.uwo.ca
Sat Sep 12 23:27:12 CEST 2009


On 12/09/2009 5:04 PM, sebed1110-divers at yahoo.fr wrote:
> Hi,
> 
> the error message is "Error: protect(): protection stack overflow"

63000 objects is far more than most people would use, so you may have 
hit an internal limit.  The "protection stack" is used internally by R 
to temporarily mark objects as "in use" even if they haven't been 
assigned anywhere; overflows usually signal a bug in some code.  By 
default, it is limited to 50000 entries, and it's very rare that any 
code would generate more than that number of temporary objects. 
However, if you have 63000 objects, it's conceivable that they are all 
protected at some point during loading.

The easiest way to fix this may be not to produce so many objects.  I 
suspect that they aren't all meaningful to you, you probably produced 
them automatically.  So why not store them within a list, or some other 
structure?  That's the normal way to program in R.

If you can't do that, you may be able to read your file by recompiling R 
with a larger stack limit.  The line to change is in src/include/Defn.h 
around line 214, currently

#define	R_PPSSIZE	50000L

Change that to a larger number and you might get lucky.

Duncan Murdoch

> 
> Edwige.
> 
> 
> 
> 
> ________________________________
> 
>> Dear all,
>>
>> I can't load my workspace of 25Mo on R version 2.9.2, because of "
> But I saved it normally (save.image()), and I didn't get any notification...
>> Does anyone know what that can be due to? Is there any limitation of number of objects (+/-63000)?
> 
> 
> 
> At least, the error message would be helpful.
> 
> Uwe Ligges
> 
>> Thanks
>>
>> Edwige Polus.
>>
>>
>>
>>           [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 
>       
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list