Brm fit crashes with floating point exception in Ubuntu

When trying to fit any models with brm (I’ve included the example from {brms}'s GitHub page below), the process crashes with the error Floating point exception (core dumped). This occurs in two Ubuntu 20.04 instances but not a Windows 10 instance (all with {brms} version 2.15.0). I’ve pasted the full R session below.

I have the error after reinstalling {brms}, {rstan}, and {stanheaders}.

  • Operating System: Ubuntu 20.04
  • RAM: 64 GB
  • brms Version: 2.15.0
R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(brms)
Loading required package: Rcpp
Loading 'brms' package (version 2.15.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package: ‘brms’

The following object is masked from ‘package:stats’:


> fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient), 
+             data = epilepsy, family = poisson())
Compiling Stan program...
Floating point exception (core dumped)

I solved this problem by reinstalling {StanHeaders} and {rstan} from source. Originally, I reinstalled from the Ubuntu R repo (r-cran-stanheaders, r-cran-rstan), but this didn’t fix the problem. However, I reinstalled from source (install.packages(c("StanHeaders","rstan"), type="source")) within R and everything works fine now.