Re: [Rd] Stack checking, core dumps, and embedding R

From: Thomas Friedrichsmeier <>
Date: Mon 17 Apr 2006 - 13:20:46 GMT

Excuse me please, for being impatient, but I'm worried this issue may not be considered important enough to be fixed in R 2.3.0 at this late point of time. So let me re-state this:

In the current state, R will *not work at all* when run in a thread on linux.

I do not know how many embedding applications run R in a separate thread, and are affected by this. I know that at least rkward does, and it will not run.

Reconsidering the proposals I made yesterday, after some sleep, let me propose this corrected fix (insert into src/unix/system.c, at line 179, right above "if(R_CStackStart == -1) R_CStackLimit = -1; /* never set */"):

    if (abs (R_CStackStart - (uintptr_t) &i) > 20000) {

	/* Very unlikely we're this far away from the stack start at this
	point in the code. Disable checking */
	R_CStackStart = -1;


For all I care, set the safety margin to 50000 or even more. This heuristic is only meant to catch cases where the detected value for R_CStackStart is *obviously wrong*, most importantly in case of threads.

In this case all it will do is to disable the check. I can see no other side-effect.

Once again, excuse me for being impatient, but *please* consider this for inclusion in R 2.3.0.

Thomas mailing list
Received on Mon Apr 17 23:20:22 2006

This archive was generated by hypermail 2.1.8 : Mon 17 Apr 2006 - 20:17:51 GMT