[Rd] Error: C stack usage is too close to the limit

Simon Urbanek simon.urbanek at r-project.org
Sat Mar 29 20:35:05 CET 2014


On Mar 29, 2014, at 4:12 AM, Randy Lai <randy.cs.lai at gmail.com> wrote:

> I have similar experience previously. What I done was disabling stack limit checking
> 
>    R_CStackLimit = -1;
> 
> and increasing the stack size to .16*1024*1024.
> 
> Hope it helps.
> 

Well, it will result in R crashing instead :)

So be careful with this approach - you will get crashes that will seem inexplicable. Also note that calling R from different threads is unsafe unless you also make sure that the error handling doesn't cross stacks or thread boundaries. You should rather enqueue R calls to the main thread, unless you are really a guru and know how to avoid such issues across signals and errors.

Cheers,
Simon


> Randy
> 
> On Mar 28, 2014, at 2:55 PM, Florian Burkart <florian.burkart at gmail.com> wrote:
> 
>> Hi,
>> 
>> I have been using my own C++ plugin for a while.
>> 
>> On a new machine I now keep getting the
>> 
>> C stack usage is too close to the limit
>> 
>> error. I played with it and it appears to come after I printed a fixed
>> number of text to R via Rprintf (not from the main thread).
>> 
>> Didn't happen on the old machine. Old version was 2.14. Now on 3.0.3.
>> 
>> Not sure whats going on.
>> 
>> Florian
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list