question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C stack size too small

See original GitHub issue

Hey,

first off thanks for radian, it looks nice and mostly works great!

I have some code with recursion and nested functions which I can’t run in radian:

Error: C stack usage  1915264 is too close to the limit

but can run without issue in R.exe (64bit). Radians C stack seems to be much smaller than the normal R terminal’s. radian.exe:

size    current  direction eval_depth
   1914470      16008          1          2

vs. R.exe

 size    current  direction eval_depth 
  63737856      11288          1          2 

As far as I could find out this is a compiler setting that needs to be adjusted? Or is there a way to change this via cli flag or something?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
assignUsercommented, May 30, 2022

I can confirm that this only happens with R 4.2 but not with R 4.1.3 with the same unchanged radian version (0.6.0).

As the stack usage can be alleviated by changing the python executable it seems to be some interplay between python and R 4.2? Maybe the issue is with rchitect? @randy3k

1reaction
assignUsercommented, May 18, 2022

I used this workaround to increase the default stack size.

@colinpmillar

Read more comments on GitHub >

github_iconTop Results From Across the Web

C/C++ maximum stack size of program on mainstream OSes
In Visual Studio the default stack size is 1 MB i think, so with a recursion depth of 10,000 each stack frame can...
Read more >
How much stack usage is too much?
It depends on your operating system. On Windows, the typical maximum size for a stack is 1MB, whereas it is 8MB on a...
Read more >
STACKSIZE (Sun Studio 12 Update 1: C User's Guide)
If the stack size is too small for a thread to run, the program will abort with a segmentation fault.
Read more >
Stack size invisibility in C and the effects on "portability"
The alternative was to fault when you overflowed the smaller stack when that data was imported. It does mean if there's an infinite...
Read more >
What is Stack Size?
The default Ingres stack size is 65536 bytes or 64 KB. In general the default Ingres stack_size of 65536 is too small. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found