@Lucius No. I just simply changed to other computers/servers which work well.
I did not try out bgoodri’s advice, you might try:
If you call tempdir() before calling stan or sampling , there might be something in one of the .txt files in that directory that has more information about the error.
I also have the same or similar problem. I am using Win 10 and R ver 3.6. On my Laptop with same OS, R and rstan versions everything works fine, but on my PC I am also getting “R Session Aborted” when calling the sampling method.
When I’m just using a single core, the error occurs right after a few iterations, to be precise: after the fourth iteration and I have to restart the session.
Calling the method in parallel with 4 cores I just get the error
Error in unserialize(socklist[[n]]) : error reading from connection
Error in serialize(data, node$con, xdr = FALSE) :
error writing to connection
after a few iterations, but don’t have to do a session restart.
The second, third, etc. call in parallel leads to the same error above, but not before the warmup iterations end up. And it is independet of the number of iterations.
After restarting the session, calling the sampling method crashes again immediately.
I had this issue and downgrading from rstan 2.21 to 2.19.3 helped to reduce its frequency by ~95%.
Recently this problem was back (happens 1 per 30 rstan initializations, I run it in the loop) but I was able to found one use case when it happens every time: when immediately after calling stan() I switch from using monitor to using laptop monitor (I plug out the…plug). In that case laptop changes RStudio resolution and the crash happens at this precise moment. Still, from time to time it happens in other situations, not connected with resolution change. 3 cores, 2 chains, small dataset, ~ 20 parameters, Win10, Rstudio 1.4.1717, Rstan 2.19.3