Closed iago-pssjd closed 1 year ago
This happens when PROTECT()
and UNPROTECT()
are unbalanced in C code. They may become unbalanced because there is an uneven number of them in the code (which should not be the case) or when some code is executed while a PROTECT/UNPROTECT block is being executed. To prevent this, on Unix (Linux, Mac OS, BSD, etc.) there is a function suggested by Simon Urbanek (please, seek his name in src/nvimcom.c) that postpones the execution of the code until R is ready. This solution is not available for R on Windows.
In my experience, R crashes not long after C stack error message.
Thanks! @jalvesaq
This solution is not available for R on Windows.
Ok, therefore I will close the issue.
In my experience, R crashes not long after C stack error message.
Indeed, this is being my experience too.
The more frequent the communication between (Neo)Vim and R, the higher the chance of Nvim-R asking R to execute a command while it is still busy doing something else. The suspects are:
nvimcom
seemed to be stable when I tried Nvim-R on a Windows virtual machine for the last time (some months ago), but I have never tried nvim-cmp
on Windows. If you could identify what feature (or plugin, in the case of cmp-nvim-r) is causing the C stack error, I would disable that feature/plugin for Windows.
I will check if I have cmp-nvim-r installed and if I don't get this issue after cleaning it (and I'll let you know). I didn't have activated the Object Browser. What I do sometimes is resizing (g)ViM windows. May have it some relation?
Yes, when the terminal is resized, Nvim-R sends a message to nvimcom to check the new width in the environment variable COLUMNS
. Then, nvimcom will run the command options(width=X)
, where X
is the value of COLUMNS
.
Actually, the documentation says that on Windows the command is sent to R Console, and not to nvimcom.
I confirm you I did not have installed cmp-nvim-r
. I will try not resizing windows while R code is being executed and let's see if I don't get this issue.
There are many places in the Vim code that I check if (Neo)Vim was compiled on Windows --- has("win32")
--- when in fact I should check if R was compiled on Windows. I don't know if someone can run Nvim-R within a Unix version of Gvim (from a Linux subsystem) and a native Windows version of R. If yes, then Nvim-R will wrongly assume that R was also compiled on Unix.
Sometimes (at least, possibly only, on Windows) I get errors of this kind, for example:
when I change ViM mode to
insert mode
, wherefit
is a fitted model in my code and I did not useslotNames
.Another example is after trying to use
\rh
on a function in my R code,Why may it happen?