Error: C stack usage when compile R Markdown

I get a new error, when I try to compile an R Markdown file it appears the next message:

Error: C stack usage  7971408 is too close to the limit
Execution halted

I did some research and I found some people with the same error:

But these guys have problems with some function or something like that.
The actions I did in orden to try to solve this situation:

  • Uninstall R and RStudio, reinstall de last versions of both, reboot my computer... nothing.
  • Try to change ulimit -s, and this point is interesting because this is my ulimit -a on R terminal:
geomicrobio-mac:~ geomicrobio$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 10240
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1392
virtual memory          (kbytes, -v) unlimited

When I try to change de ulimit -s for unlimited or 65532 on R terminal, it doesn't change.

The ulimit -a of my terminal (macOS Monterey v12.0.1) is:

-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             65532
-c: core file size (blocks)         0
-v: address space (kbytes)          unlimited
-l: locked-in-memory size (kbytes)  unlimited
-u: processes                       1392
-n: file descriptors                2560

This just happen with R Markdown, I can do Shinny apps, and run scripts, etc. but I can`t compile any R Markdown despite it contains only text.

This is the info when I put base::Cstack_info() on console:

      size    current  direction eval_depth 
   7969177      14032          1          2 

My version of R:

platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          1.2                         
year           2021                        
month          11                          
day            01                          
svn rev        81115                       
language       R                           
version.string R version 4.1.2 (2021-11-01)
nickname       Bird Hippie  

If you know how to solve this I really appreciate your help.

Thank you.

Also you can delete your .Rprofile file... That saved me.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.