Open ltalluto opened 9 months ago
Updating to add that I've managed to get it working by switching compilers. My .R/Makevars included the line:
CXX=/opt/local/bin/clang++ -fopenmp
This points to clang 14.0.6 installed via macports. Commenting this line out and reinstalling rstan from source via CRAN eliminates the crashes (using the system C++ compiler).
Leaving this issue open in case you want to investigate the crashes further, but happily resolved on my end.
Summary:
Models that contain runtime errors crash my R session across many versions of rstan.
Description:
Any model that contains a runtime error is crashing my R session. Models compile fine. If no runtime errors occur models sample fine in most cases, although I am also experiencing somewhat random crashes. For example using
cholesky_decompose
will sometimes also produce a crash, this is less reproducible. I have tried the current CRAN versions (2.32.5), development versions(2.33.1.9000), and have tried downgrading to rstan 2.21.8 with StanHeaders 2.26.28, all of them produce the same crash. My mac is an M1 on Sonoma 14.3.1, R version 4.3.2. An older intel mac on Ventura 13.6.4 has expected behaviour with no crashes. I can confirm that rstan was working normally as of late December, something must have changed since then.
Reproducible Steps:
This code reliably produces a crash on all of the versions mentioned above. Expected output is a runtime error due to the missing 'x' variable in the last line.
RStan Version:
Tried with 2.33.1.9000, 2.32.5, and 2.21.8.
R Version:
4.3.2
Operating System:
macOS 14.3.1.