RStudio hangs and won't run any code

I am running an R script in RStudio. Everything works fine for a few minutes but then I can't run any code, save my file, or close out of RStudio other than via Task Manager. The console does not run any code; however, I can edit the script.
This behavior happened in my old version of RStudio. It happens for RMD files as well. I have tried uninstalling and reinstalling R, RTools, and RStudio. I still have the error. I've reset the state as per: https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State

I've removed all non-essential objects from my workspace; reduced the number of packages loaded.

In task manager the RSession is using the CPU:

The code runs fine in regular R. (At least it did for the 15 minutes I played with it)

Here's the output of the log file:
31 Jan 2019 21:31:57 [rsession-Dan] ERROR r error 4 (R code execution error) [errormsg=Error: node stack overflow|||]; OCCURRED AT: class rstudio::core::Error __cdecl rstudio::r::exec::executeSafely(class rstudio_boost::function<void __cdecl(void)>) c:\jenkins\workspace\ide\windows\src\cpp\r\rexec.cpp:224; LOGGED FROM: void __cdecl rstudio::session::anonymous-namespace'::processEvents(void) c:\jenkins\workspace\ide\windows\src\cpp\session\sessionhttpmethods.cpp:98 31 Jan 2019 21:31:57 [rsession-Dan] ERROR r error 4 (R code execution error) [errormsg=Error: node stack overflow|||]; OCCURRED AT: class rstudio::core::Error __cdecl rstudio::r::exec::executeSafely(class rstudio_boost::function<void __cdecl(void)>) c:\jenkins\workspace\ide\windows\src\cpp\r\rexec.cpp:224; LOGGED FROM: void __cdecl rstudio::session::anonymous-namespace'::processEvents(void) c:\jenkins\workspace\ide\windows\src\cpp\session\sessionhttpmethods.cpp:98
31 Jan 2019 21:52:35 [rsession-Dan] ERROR r error 4 (R code execution error) [errormsg=Error in get(text, envir = .GlobalEnv) : invalid first argument|||]; OCCURRED AT: class rstudio::core::Error __cdecl rstudio::r::exec::anonymous-namespace'::evaluateExpressionsUnsafe(struct SEXPREC *,struct SEXPREC *,struct SEXPREC **,class rstudio::r::sexp::Protect *,enum rstudio::r::exec::anonymous-namespace'::EvalType) c:\jenkins\workspace\ide\windows\src\cpp\r\rexec.cpp:171; LOGGED FROM: class rstudio::core::Error __cdecl rstudio::session::modules::r_addins::`anonymous-namespace'::executeRAddin(const struct rstudio::core::json::JsonRpcRequest &,class rstudio::core::json::JsonRpcResponse *) c:\jenkins\workspace\ide\windows\src\cpp\session\modules\sessionraddins.cpp:486

RStudio Edition : Desktop or Server 
RStudio Version : 1.2.1256
OS Version        : Windows 10
R Version          :  3.5.2

Many thanks!

Thanks for the crash report. Sorry this is happening!

Is the R script (or a minimal version of it) something you'd be able to share on github issues? Unless the IDE folks are able to immediately diagnose the issue via the info you've provided in your log file, I suspect they'll want to reproduce it.

This post on StackOverflow suggests this can occur if you have a function that attempts to recursively source itself:

In general, the message node stack overflow likely implies some sort of infinite recursion, although it's hard to say where exactly that's coming from.

This topic was automatically closed 21 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.