Displaying 20 results from an estimated 200 matches similar to: "How to set R_CStackLimit"
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
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
Greetings R developers,
R will run a little faster when executing "pure R" code if the function
R_CheckStack() is modified.
With the modification, the following code for example runs 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
}
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 "DLL" or
2019 May 19
4
most robust way to call R API functions from a secondary thread
Hi,
As the subject suggests, I am looking for the most robust way to call an (arbitrary) function from the R API from another but the main POSIX thread in a package's code.
I know that, "[c]alling any of the R API from threaded code is ?for experts only? and strongly discouraged. Many functions in the R API modify internal R data structures and might corrupt these data structures if
2019 May 20
1
most robust way to call R API functions from a secondary thread
Stepan,
Andreas gave a lot more thought into what you question in your reply. His question was how you can avoid what you where proposing and have proper threading under safe conditions. Having dealt with this before, I think Andreas' write up is pretty much the most complete analysis I have seen. I'd wait for Luke to chime in as the ultimate authority if he gets to it.
The
2016 Feb 01
1
Wrong config check for __libc_stack_end
>>>>> Simon Urbanek <simon.urbanek at r-project.org>
>>>>> on Mon, 1 Feb 2016 08:36:56 -0500 writes:
> On Feb 1, 2016, at 4:16 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
[..............]
>> Back to R: I'm not familiar with that part of the code, neither
>> the configuration, nor the usage (in
2015 Aug 20
2
Child thread libR.so
So I'm working on a custom front end to R, in one mode of the front
end I dynamically load libR.so into a child worker thread. I'm very
careful to make sure it is loaded by a single thread and loaded only
once, but since it is a child thread it violates assumptions made by
the stack size checking inside of R and I get innumerable errors along
the lines of
Error: C stack usage
2010 Apr 30
2
RInside & child threads
Hi Folks,
I am creating a multi-threaded C++ application that initializes RInside in
one of the child thread.
I would also like to access support interfaces like Rcpp::Environment 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
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
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
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
Your analysis looks pretty complete to me and your solutions seems
plausible. That said, I don't know that I would have the level of
confidence yet that we haven't missed an important point that I would
want before going down this route.
Losing stack checking is risky; it might be eventually possible to
provide some support for this to be handled via a thread-local
variable. Ensuring
2019 May 20
0
most robust way to call R API functions from a secondary thread
Hi Andreas,
note that with the introduction of ALTREP, as far as I understand, calls
as "simple" as DATAPTR can execute arbitrary code (R or native). Even
without ALTREP, if you execute user-provided R code via Rf_eval and such
on some custom thread, you may end up executing native code of some
package, which may assume it is executed only from the R main thread.
Could you (1)
2010 Jun 09
2
Question on trying to build R 2.11.1 on Tru64(aka OSF1)
First I tried 'setenv R_SHELL /usr/local/bin/bash', as bash is the weapon
of choice for the faculty wishing to use R, then ran ./configure as before.
The ./configure output line
using as R_SHELL for scripts ... /usr/local/bin/bash
would seem to indicate that the R_SHELL environment variable was recognized
and acknowledged. However, I got the same build error:
gnumake[2]: Entering
2015 Aug 25
0
Child thread libR.so
Simon,
Ah, thank you! quiet right. For anyone searching for this in the
future, I changed my init fuction to:
---------- SNIP ----------------
void init_r() {
SEXP aperm_function;
/* this is our version of Rf_initEmbeddedR where we disable stack
checking */
const char *init_argv[] = {"MyFront", "--vanilla", "--slave"};
Rf_initialize_R(sizeof
2000 Aug 09
2
GenGC changes
As most R developers maybe are already aware of, R version 1.2.0
introduced a new `generational' garbage collector which means that
strings and vectors (and language objects) are handled differently from
the numerical atomic types.
>From ``Writing R Extensions'':
Earlier code was written in a style like.
VECTOR(dimnames)[0] = getAttrib(x, R_NamesSymbol);
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
#1
2009 Dec 26
1
Problem compiling R library on FC4 ( conflicting declaration in Rinterface.h and stdint.h)
Hello,
The package builds successfully on RHEL5 and OS X( 64 bit,32/64
respectively) but on FC4(32 bit) it fails with this error
g++ -m32 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -I. -g `pkg-config --cflags protobuf`
-Wall -c
2002 Oct 27
3
RODBC patchlet
[ Disclaimer: Yes, I do know that RODBC is in a state of minor limbo as far
as maintenance is concerned. But it is also useful, and used, which is why I
hope that someone might apply the small change outlined below. ]
The current version in CRAN's devel directories fails to build under R 1.6.1
(beta from Oct 27):
chibud:/home/edd/RODBC# R CMD INSTALL .
* Installing *source* package
2008 May 07
0
how to define .Renviron to work with different R-versions
Hi,
I have a simple R script for printing arguments
cat > printargs.R << EOF
args = commandArgs()
print(args)
q()
EOF
To run this script, first I set PATH to ~/src/R-2.6.2 and execute >
R --no-save < printargs.R
I want to run this script with different R versions by defining an
.Renviron file in the same directory as printargs.R
cat >