Displaying 20 results from an estimated 25 matches for "r_cstacklimit".
2007 Jun 28
1
How to set R_CStackLimit
Hi,
I have tried to disable stack checking by set R_CStackLimit to -1. However,
it always crashes my win32 multiple threads program. I am using R-2.5.0. My
code looks like:
#include <Rversion.h>
#if (R_VERSION >= R_Version(2,3,0))
#define R_INTERFACE_PTRS 1
#define CSTACK_DEFNS 1
#include <Rinterface.h>
#endif
and then, add below line to my...
2007 Jun 01
3
Question on the R's C stack limit
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R 2.5 into my
application. In the R-exts document, it says:"Note that R's own front ends
use a stack size of 10Mb". I desire to know: is it possible to decrease this
stack size
by modifying R's source code? If it's possible, which part of the source
code is responsible for the issue?
Thank
2007 Aug 29
1
Modifying R_CheckStack for a speed increase
...15% faster
(compared to a virgin R-2.5.1 on my Windows XP machine):
N = 1e7
foo <- function(x)
{
for (i in 1:N)
x <- x + 1
x
}
foo(0)
The crux of the modification is to change the following line in
R_CheckStack()
if(R_CStackLimit != -1 && usage > 0.95 * R_CStackLimit) {...
to
if(usage > R_CStackLen) { ...
Details and modified sources can be found at
ftp://ftp.sonic.net/pub/users/milbo.
Regards,
Stephen
http://milbo.users.sonic.net
2019 May 19
4
most robust way to call R API functions from a secondary thread
...hread (see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Threading-issues); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread
4) R sets signal handlers for several signals and some of them make use of the R API; hence, issues 1) - 3) apply; signal masks can be used to block delivery...
2009 May 21
1
"Error: C stack usage is too close to the limit" (can't understand explanations of how to fix this)
Apparently the way to deal with this error message is to set
R_CStackLimit = (uintptr_t)-1
I tried typing this in the R console, but it says Error: object
"R_CStackLimit" not found.
So where do I type it? In one of the initialization files that R uses when
it starts up?
I can't find the answer anywhere. Please note that I don't understand words
like &quo...
2007 Jul 06
1
How to disable R's C stack checking
Hi all,
I'm developing an application on Mac OS X Darwin which embeds R.
However, the application always crashes due to the C stack checking.
I know that R_CStackLimit can be set to -1 to disable the stack
checking, but I don't know where to put the code "R_CStackLimit=-1".
Please give some instructions.
Thank you very much!
Here is my compiler infomation:
$g++ -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/...
2015 Aug 20
2
Child thread libR.so
...------------------------------------------------------
> Hi everyone!
> I meet one problem when embedding R in C code, when I run the the
> R code in one child thread ,
> it always print error info:
> Error: C stack usage is too close to the limit
>
> I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C
> stack check as the R-exts doc say,
> but it still does not work, the error info still exist.
>
That is the way to do it (and other project use it successfully) - the
fact that it doesn't work means that you probably do it at the wrong
place (you mu...
2019 May 20
1
most robust way to call R API functions from a secondary thread
...7spOVuz2IVEo0P_II3ZtSbw0TU2NmaE&s=J_TMw2gu43dxB_EX2vHbtF4Zr4bIAFR8RSFzvbRV6jE&e=); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread
>> 4) R sets signal handlers for several signals and some of them make use of the R API; hence, issues 1) - 3) apply; signal masks can be used to block d...
2016 Feb 01
1
Wrong config check for __libc_stack_end
...0);
R_CStackStart = (uintptr_t) base;
}
#else
if(R_running_as_main_program) {
/* This is not the main program, but unless embedded it is
near the top, 5540 bytes away when checked. */
R_CStackStart = (uintptr_t) &i + (6000 * R_CStackDir);
}
#endif
if(R_CStackStart == -1) R_CStackLimit = -1; /* never set */
/* printf("stack limit %ld, start %lx dir %d \n", R_CStackLimit,
R_CStackStart, R_CStackDir); */
}
#endif
so I'd hope that typically R_CStackStart would be set usefully
also when the __libc_stack_end is not available.
If not, that would mean tha...
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
...hread (see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Threading-issues); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread
>
> 4) R sets signal handlers for several signals and some of them make use of the R API; hence, issues 1) - 3) apply; signal masks can be used to block...
2019 May 20
0
most robust way to call R API functions from a secondary thread
...7spOVuz2IVEo0P_II3ZtSbw0TU2NmaE&s=J_TMw2gu43dxB_EX2vHbtF4Zr4bIAFR8RSFzvbRV6jE&e=); in particular, any function that does allocations, e.g. via allocVector3() might end up calling it via GC -> finalizer -> ... -> eval; the only way around this problem which I could find is to adjust R_CStackLimit, which is outside of the official API; it can be set to -1 to disable the check or be changed to a value appropriate for the current thread
>
> 4) R sets signal handlers for several signals and some of them make use of the R API; hence, issues 1) - 3) apply; signal masks can be used to block...
2009 May 19
2
About " Error: C stack usage is too close to the limit"
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-exts doc say,
but it still does not work, the error info still exist.
Besides it is interesting that if i put the R code in the main thread(don't create any thread), it work, and the E-exts doc say that "Embedded R is designed...
2015 Aug 25
0
Child thread libR.so
...checking */
const char *init_argv[] = {"MyFront", "--vanilla", "--slave"};
Rf_initialize_R(sizeof (init_argv) / sizeof (init_argv[0]),
(char**) init_argv);
/* Disable stack limit checking since it is incompatible being
loaded on a child thread
*/
R_CStackLimit = (uintptr_t)-1;
R_Interactive = TRUE; /* Rf_initialize_R set this based on isatty */
setup_Rmainloop();
/* end of Rf_initEmbeddedR */
/*
* transposeVector above uses the R builtin function aperm instead of
* looking it up every time we need deal with transposing a mult...
2010 Apr 30
2
RInside & child threads
...in the
remaining child threads, so that I could access any "R" function associated
with the
environment initialized.
When I run my program, I always get "C Stack limit too huge" errors.
I looked at the "Writing R Extensions" manual, and it pointed to
initializing the R_CStackLimit variable to "-1", and
that this initialization need to be made after the RInside constructor is
called. I did that, but it still does not work.
Can you please let me know how do we accomplish this task?
Thanks very much,
Jai
[[alternative HTML version deleted]]
2015 Aug 24
0
Child thread libR.so
I did some poking around with GDB and confirmed that the advice of
setting R_CStackLimit after init, which is echoed in the "threading
issues" section of the R-exts help document, isn't entirely useful
because init apparently loads the main package which trips over the
broken stack checking.
Stack trace:
#0 R_SignalCStackOverflow (usage=140732197147604) at errors.c:81...
2006 Nov 15
0
INSTALL R-2.4.0 on Compaq Tru64 UNIX V5.1B
...ake' command,the following are the error messages:
gcc -I. -I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H -mieee-with-inexact -g -O2 -std=gnu99 -c dynload.c -o
dynload.o
In file included from dynload.c:33:
../../src/include/Defn.h:554: parse error before "R_CStackLimit"
../../src/include/Defn.h:554: warning: type defaults to `int' in
declaration of `R_CStackLimit'
../../src/include/Defn.h:554: warning: data definition has no type or
storage class
../../src/include/Defn.h:555: parse error before "R_CStackStart"
../../src/include/Defn.h:555:...
2010 Aug 20
1
error heatmap and stack overflow
Hello,
Im trying to create a heatmap with a dataset (38 x 15037) but get the
error below:
Error: protect(): protection stack overflow
Execution halted
or
Error: C stack usage is too close to the limit
Execution halted
I tried to increase the stack size by changing:
extern uintptr_t R_CStackLimit
but my systems manager said that R by default uses all the memory
available to it from the operating system. Our machine has 128G. I
also use options(expressions = 100000) but I still get the above
errors. Can anyone help? Im I trying to change the wrong thing or is
there anything else I...
2020 Jun 25
0
R 4.0.1-4.0.2 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7
...check is somehow skipped. (Perhaps optimized away?)
The evaluation depth limit is checked in src/main/eval.c, line 705 [*],
followed by stack size check. Can you attach the debugger and take a
look at the values of R_EvalDepth and R_Expressions while executing the
text? What about R_CStackStart and R_CStackLimit? What is the stack
size limit (ulimit -s?) on the machine running this test?
--
Best regards,
Ivan
[*]
https://github.com/wch/r-source/blob/8d7ac4699fba640d030703fa010b66bf26054cbd/src/main/eval.c#L705
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not avail...
2009 May 18
0
About " Error: C stack usage is too close to the limit"
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc say,
but it still does not work.
it is interesting that if i put the R code in the main thread(don't create any thread), it work.
so, can anybody give some help or suggestion about this problem,
any response will be ap...
2009 May 19
0
About " Error: C stack usage is too close to the limit"--resend
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-ext doc say,
but it still does not work.
it is interesting that if i put the R code in the main thread(don't create any thread), it work.
so, can anybody give some help or suggestion about this problem,
any response will be ap...