# R Session Aborted

**URL:** <https://discourse.mc-stan.org/t/r-session-aborted/6655>\
**Category:** RStan\
**Created:** [November 20, 2018, 1:36am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655 "2018-11-20T01:36:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 20, 2018, 1:36am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/1 "2018-11-20T01:36:49Z")

</div>

Hi,  
I am repeatedly getting the following error when I run my stan() function. Please help to overcome the error.  
‘ **R session Aborted. R encountered a fatal error. The session was terminated** ’

If your question relates to installation please provide the following information:

- Operating System = Windows 10
- RStan Version = 2.18.2
- Output of `writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))`

```R
CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = g++ -std=c++1y

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = g++ -std=c++1y

```

- Output of `devtools::session_info("rstan")`

```R
- Session info --------------------------------------------------------------------------------------------------------------
 setting value                       
 version R version 3.5.1 (2018-07-02)
 os Windows 10 x64              
 system x86_64, mingw32             
 ui RStudio                     
 language (EN)                        
 collate English_Australia.1252      
 ctype English_Australia.1252      
 tz Australia/Brisbane          
 date 2018-11-20                  

- Packages ------------------------------------------------------------------------------------------------------------------
 package * version date lib source        
 assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.5.1)
 backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.0)
 base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.5.0)
 BH 1.66.0-1 2018-02-13 [2] CRAN (R 3.5.0)
 callr 3.0.0 2018-08-24 [1] CRAN (R 3.5.1)
 cli 1.0.1 2018-09-25 [1] CRAN (R 3.5.1)
 colorspace 1.3-2 2016-12-14 [2] CRAN (R 3.5.1)
 crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1)
 desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.1)
 digest 0.6.18 2018-10-10 [2] CRAN (R 3.5.1)
 fansi 0.4.0 2018-10-05 [2] CRAN (R 3.5.1)
 ggplot2 3.1.0 2018-10-25 [1] CRAN (R 3.5.1)
 glue 1.3.0 2018-07-17 [2] CRAN (R 3.5.1)
 gridExtra 2.3 2017-09-09 [2] CRAN (R 3.5.1)
 gtable 0.2.0 2016-02-26 [2] CRAN (R 3.5.1)
 inline 0.3.15 2018-05-18 [2] CRAN (R 3.5.1)
 labeling 0.3 2014-08-23 [2] CRAN (R 3.5.0)
 lattice 0.20-35 2017-03-25 [2] CRAN (R 3.5.1)
 lazyeval 0.2.1 2017-10-29 [2] CRAN (R 3.5.1)
 loo 2.0.0 2018-04-11 [2] CRAN (R 3.5.1)
 magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1)
 MASS 7.3-50 2018-04-30 [2] CRAN (R 3.5.1)
 Matrix 1.2-14 2018-04-13 [2] CRAN (R 3.5.1)
 matrixStats 0.54.0 2018-07-23 [2] CRAN (R 3.5.1)
 mgcv 1.8-24 2018-06-23 [2] CRAN (R 3.5.1)
 munsell 0.5.0 2018-06-12 [2] CRAN (R 3.5.1)
 nlme 3.1-137 2018-04-07 [2] CRAN (R 3.5.1)
 pillar 1.3.0 2018-07-14 [2] CRAN (R 3.5.1)
 pkgbuild 1.0.2 2018-10-16 [2] CRAN (R 3.5.1)
 plyr 1.8.4 2016-06-08 [2] CRAN (R 3.5.1)
 prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.1)
 processx 3.2.0 2018-08-16 [1] CRAN (R 3.5.1)
 ps 1.2.0 2018-10-16 [1] CRAN (R 3.5.1)
 R6 2.3.0 2018-10-04 [1] CRAN (R 3.5.1)
 RColorBrewer 1.1-2 2014-12-07 [2] CRAN (R 3.5.0)
 Rcpp 0.12.19 2018-10-01 [2] CRAN (R 3.5.1)
 RcppEigen 0.3.3.4.0 2018-02-07 [2] CRAN (R 3.5.1)
 reshape2 1.4.3 2017-12-11 [2] CRAN (R 3.5.1)
 rlang 0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1)
 rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1)
 rstan 2.18.1 2018-10-16 [2] CRAN (R 3.5.1)
 scales 1.0.0 2018-08-09 [2] CRAN (R 3.5.1)
 StanHeaders 2.18.0 2018-10-07 [2] CRAN (R 3.5.1)
 stringi 1.2.4 2018-07-20 [2] CRAN (R 3.5.1)
 stringr 1.3.1 2018-05-10 [2] CRAN (R 3.5.1)
 tibble 1.4.2 2018-01-22 [2] CRAN (R 3.5.1)
 utf8 1.1.4 2018-05-24 [2] CRAN (R 3.5.1)
 viridisLite 0.3.0 2018-02-01 [2] CRAN (R 3.5.1)
 withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1)

[1] \\CompanyName/documents/StaffHome/StaffGroups$/Name/Documents/R/win-library/3.5
[2] C:/R-3.5.1/library

```

I have been using RCloud to run Rstan before changing to Windows desktop. But often using Cloud gives me an error regarding out of memory and had to change to Windows desktop.

I would really appreciate your help

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 20, 2018, 1:42am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/2 "2018-11-20T01:42:56Z")

</div>

Can you tell us what the Stan program is? Are you sure it did not run out of RAM? Was this with or without first doing `Sys.setenv(LOCAL_CPP = "-mtune = native")`? Etc.

Also, it would be better if you upgraded the **rstan** 2.18.2 on CRAN, although that may not fix this issue.

---

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 20, 2018, 1:56am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/3 "2018-11-20T01:56:38Z")

</div>

Thanks for the quick reply.  
My stan program is as follows

```stan

//This is stan code for simulating fake data 

  functions {
     real[] ode(real t,
     real[] y,
     real[] params,
     real[] x_r, // x_r:real data, x_i: integer data
     int[] x_i) {

     real dydt[6];
    
     real A;
     real beta;
     real delta;
     real gamma;
     real omega;
     real sigma;
     real kappa;
     real eta;
     delta =params[1]; 
     A = x_r[1];
     beta = x_r[2];
     gamma = x_r[3];
     omega = x_r[4];
     sigma = x_r[5];
     kappa = x_r[6];
     eta = x_r[7];
     
     dydt[1] = A - beta * y[5] * y[1] - beta * y[6] * y[1];                 
     dydt[2] = beta * y[1] * y[5] - beta * y[6] * y[2]- delta * y[2];      
     dydt[3] = beta * y[6] * y[1] - beta * y[5] * y[3] ;                   
     dydt[4]= beta * y[6] * y[2] + beta * y[5] * y[3] - gamma * y[4];        
     dydt[5] = omega * y[2] + omega * (1-sigma) * y[4] - kappa * y[5];          
     dydt[6] = eta * sigma* y[4] - kappa * y[6];                         
    
  return dydt;
 }

}

data {
    int<lower=1> T; //max time
     real y0[6]; //initial condition of ode
     real t0; //initial time
     real ts[T]; //time span
     real A;
     real beta;
     real delta;
     real gamma;
     real omega;
     real sigma;
     real kappa;
     real eta;
}

transformed data {
      real params[1];
      real x_r[7];
      int x_i[0];
     
      params[1] = delta;
      x_r[1] = A;
      x_r[2] = beta;
      x_r[3] = gamma;
      x_r[4]= omega;
      x_r[5]= sigma;
      x_r[6] = kappa;
      x_r[7] = eta;
}
model {
  
}
generated quantities {
     real y_hat[T,6];
     y_hat = integrate_ode_bdf(ode, y0, t0, ts, params, x_r, x_i);
// generate fake data and add measurement error
   for (t in 1:T) {
   y_hat[t,1] = y_hat[t,1] + normal_rng(0, 0.1);
   y_hat[t,2] = y_hat[t,2] + normal_rng(0, 0.1);
   y_hat[t,3] = y_hat[t,3] + normal_rng(0, 0.1);
   y_hat[t,4] = y_hat[t,4] + normal_rng(0, 0.1);
   y_hat[t,5] = y_hat[t,5] + normal_rng(0, 0.1);
   y_hat[t,6] = y_hat[t,6] + normal_rng(0, 0.1);
  }
}

```

And R code used to run the stan program is

```R
#use typical values to simulate fake data from ode
sim_data <- list(T = 10, y0 = c(1e8, 0, 0, 0, 1, 1), t0 = 0,
                 ts = 1:10,
                 A= 1.4e6, beta = 3.8e-11, delta =3.3, gamma = 0.14, omega = 1e4, sigma = 0.5, kappa = 3.5, eta = 20000)

#simulate fake data using the system of ODEs
fit1 <- stan("myModel-sim.stan", data = sim_data,
             chains = 1, iter = 1,
             algorithm = "Fixed_param")

```

When I ran this on RCloud it gave me the following error, which I think says ran out of RAM as you said.

```R
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/file52fa66d38f76-ce4303.cpp
clang: note: diagnostic msg: /tmp/file52fa66d38f76-ce4303.sh
clang: note: diagnostic msg: 

********************
make: *** [file52fa66d38f76.o] Error 254
In addition: Warning message:
In system(cmd, intern = !verbose) :
  running command '/opt/R/3.5.0/lib/R/bin/R CMD SHLIB file52fa66d38f76.cpp 2> file52fa66d38f76.cpp.err.txt' had status 1

```

The stan program worked fine in RCloud early today. The error from Cloud is given after using Cloud for sometime most of the days.

The error from desktop is given without using  
Sys.setenv(LOCAL\_CPP = “-mtune = native”)

Thanks

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 20, 2018, 2:14am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/4 "2018-11-20T02:14:28Z")

</div>

This looks similar to a crash we saw on Windows last week when using `algebra_solver`. Unfortunately, we have not figured out why it is happening yet. RStudio Cloud will probably work at this time of night.

---

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [November 20, 2018, 11:48pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/5 "2018-11-20T23:48:05Z")

</div>

@bgoodri ,  
I am trying to run the above stan code from RCloud today and still getting the above error regarding CompileCode. Is there anyway I could overcome this error. Please help. I really need to speedup my simulation, and most of the time getting the CompileCode error is slowing down things.

Thanks

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 21, 2018, 5:16am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/6 "2018-11-21T05:16:31Z")

</div>

I’ll try to figure it out tomorrow

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 28, 2018, 1:54pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/7 "2018-11-28T13:54:54Z")

</div>

Haven’t figured it out yet but am still working on it

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [November 29, 2018, 5:18pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/8 "2018-11-29T17:18:51Z")

</div>

I still haven’t figured out the Windows bug, but I can get the example to compile on RStudio Cloud now (which has recently upgraded its compiler).

I had to add

```
LDFLAGS += -fuse-ld=gold

```

to the Makevars\_Stan file in addition to changing the CXX\* lines from `clang++` to `clang++-5.0` and adding `-flto=thin` to the CXX\*FLAGS lines.

---

<div class="post-metadata">

**Author:** ![dhunfini](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/dhunfini/32/16362_2.png) [@dhunfini](https://discourse.mc-stan.org/u/dhunfini)\
**Post date:** [December 3, 2018, 12:36am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/9 "2018-12-03T00:36:04Z")

</div>

Thanks @bgoodri .

I can run the code on desktop (Windows 10) but using _integrate\_ode\_rk45()_ instead of _integrate\_ode\_bdf()_. I also had to use _Sys.setenv(LOCAL\_CPPFLAGS = ‘-march=native’)_ in the R file for the stan code to run.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [December 3, 2018, 12:49am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/10 "2018-12-03T00:49:58Z")

</div>

Interesting. That helps narrow it down a bit.

---

<div class="post-metadata">

**Author:** ![Ziyi\_Chen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ziyi_chen/32/4681_2.png) [@Ziyi\_Chen](https://discourse.mc-stan.org/u/Ziyi_Chen)\
**Post date:** [May 11, 2019, 7:56pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/11 "2019-05-11T19:56:03Z")

</div>

@bgoodri  
Have you solved it now?

I installed rstan from [https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started) (I think it is the latest), and run on **Windows 10**. I also got R session abort as shown below, even if I use only 1 chain, warmup=5, iter=10, and takes small memory.

Sometimes when running 4 chains in parallel, It said “Error reading from connection”.

However, the same code runs well on my **mac** system.

Thank you.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/a/a14a427c42cd4aab499d95196c3e2244c451329c.png)

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [May 11, 2019, 9:09pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/12 "2019-05-11T21:09:58Z")

</div>

No, but anything that works serially but does not work in parallel is likely (if not due to running out of RAM) some sort of antivirus like thing that shuts a program down if it launches multiple threads.

---

<div class="post-metadata">

**Author:** ![Ziyi\_Chen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ziyi_chen/32/4681_2.png) [@Ziyi\_Chen](https://discourse.mc-stan.org/u/Ziyi_Chen)\
**Post date:** [May 11, 2019, 9:14pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/13 "2019-05-11T21:14:47Z")

</div>

@bgoodri  
R also aborts with 1 chain (no parallel).

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [May 11, 2019, 9:30pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/14 "2019-05-11T21:30:36Z")

</div>

Some of the ODE functions cause problems on Windows. Other than that, it is hard to say. Do the functions in **rstanarm** work? That would indicate whether there is a problem running compiled code on your machine.

---

<div class="post-metadata">

**Author:** ![Ziyi\_Chen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ziyi_chen/32/4681_2.png) [@Ziyi\_Chen](https://discourse.mc-stan.org/u/Ziyi_Chen)\
**Post date:** [May 11, 2019, 11:01pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/15 "2019-05-11T23:01:47Z")

</div>

It may take time to try.  
Before that, I found another interesting issue:

On another Windows computer, the first time runs well, while at the second time, R said

> STARTING SAMPLER FOR MODEL ‘GMMBLCA\_constrained\_Givens\_fixC\_noZ20190428’ NOW.  
> Error in unserialize(socklist[[n]]) : error reading from connection  
> In addition: Warning messages:  
> 1: In sink() : no sink to remove  
> 2: In sink() : no sink to remove  
> 3: In rnorm(n = max.num.nonGauss \* max.GMM.num, mean = log(sigma.free.init[, :  
> NAs produced  
> 4: In rnorm(n = max.num.nonGauss \* max.GMM.num, mean = log(sigma.free.init[, :  
> NAs produced  
> 5: In rnorm(n = max.num.nonGauss \* max.GMM.num, mean = log(sigma.free.init[, :  
> NAs produced
> 
> Enter a frame number, or 0 to exit
> 
> 1: GMMBLCA\_fixC\_noZ\_Stan\_function(X = simData$sim.X, whiten.option = “sqrtprec”, GMMBLCA.stan.model = GMMBLCA.stan.model  
> 2: #198: sampling(object = GMMBLCA.stan.model, data = list(TT = TT, Q = num.nonGauss, C = GMM.init$Ck[1:num.nonGauss], V  
> 3: sampling(object = GMMBLCA.stan.model, data = list(TT = TT, Q = num.nonGauss, C = GMM.init$Ck[1:num.nonGauss], V = num  
> 4: .local(object, …)  
> 5: parallel::parLapplyLB(cl, X = 1:chains, fun = callFun)  
> 6: do.call(c, clusterApplyLB(cl, x = splitList(X, length(cl)), fun = lapply, fun, …), quote = TRUE)  
> 7: clusterApplyLB(cl, x = splitList(X, length(cl)), fun = lapply, fun, …)  
> 8: dynamicClusterApply(cl, fun, length(x), argfun)  
> 9: recvOneResult(cl)  
> 10: recvOneData(cl)  
> 11: recvOneData.SOCKcluster(cl)  
> 12: unserialize(socklist[[n]])

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [May 11, 2019, 11:05pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/16 "2019-05-11T23:05:07Z")

</div>

> [@Ziyi\_Chen](#):
>
> In rnorm(n = max.num.nonGauss \* max.GMM.num, mean = log(sigma.free.init[, :  
> NAs produced

It looks as if your R code is failing you.

---

<div class="post-metadata">

**Author:** ![Ziyi\_Chen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ziyi_chen/32/4681_2.png) [@Ziyi\_Chen](https://discourse.mc-stan.org/u/Ziyi_Chen)\
**Post date:** [May 11, 2019, 11:07pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/17 "2019-05-11T23:07:16Z")

</div>

@bgoodri No, I know this NA happens somewhere outside stan sampling. That does not matter.

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [May 11, 2019, 11:56pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/18 "2019-05-11T23:56:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ziyi\_Chen](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ziyi_chen/32/4681_2.png) [@Ziyi\_Chen](https://discourse.mc-stan.org/u/Ziyi_Chen)\
**Post date:** [May 13, 2019, 2:18am UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/19 "2019-05-13T02:18:40Z")

</div>

Thanks.  
Later I just changed to linux server offered by my university, installing rstan per [https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Linux](https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Linux). Then it works well.

---

<div class="post-metadata">

**Author:** ![Lucius](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/lucius/32/4302_2.png) [@Lucius](https://discourse.mc-stan.org/u/Lucius)\
**Post date:** [May 15, 2019, 3:54pm UTC](https://discourse.mc-stan.org/t/r-session-aborted/6655/20 "2019-05-15T15:54:18Z")

</div>

My problem is the same as yours. I tried to reinstall it, but I still couldn’t solve it. Have you solved it?

[Next page](https://discourse.mc-stan.org/t/r-session-aborted/6655.md?page=2)
