stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.04k stars 265 forks source link

Repeatedly loading / unloading rstan hard crashes R on Windows #998

Open luwidmer opened 2 years ago

luwidmer commented 2 years ago

Summary:

Repeatedly loading / unloading rstan hard crashes R on Windows

Description:

See above.

Reproducible Steps:

library(rstan)

sessionInfo() for (i in 1:1000) { cat(i, "\n") if (i > 1) { library(rstan) }

detach("package:rstan", unload=T, character.only = T); unloadNamespace("rstan") }

Current Output:

image image

Expected Output:

No crash.

RStan Version:

2.26.8

R Version:

R 4.1.3

Operating System:

Windows 10 64 bit

luwidmer commented 2 years ago

image Note that adding a gc() call after the detach statement makes this consistently crash on 2nd detach