stan-dev / stan-dev/rstan

segfault "memory not mapped" example(stan_model) Ubuntu 20.04

Open
#1,020 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

On a bare install of Ubuntu 20.04 + R, the example code example(stan_model, package = "rstan", run.dontrun = TRUE) produces a segfault.

Description:

The only additional information I can provide is that it only happens when exiting the R session - so possibly somewhere at or during garbage collection/cleanup?

I have also tried github releases and compiling directly from the tarball here

In hunting for similar issues I'm come across recommendations to
reinstall Rcpp and that their is a potential compiler conflict. If this is the case I still have not come across a set of MAKEVARS that satisfies this.

Reproducible Steps:

Dockerfile

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && apt install -yqq --no-install-recommends libcurl4-openssl-dev r-base-dev
RUN R -e 'install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))'
CMD ["tail", "-f", "/dev/null"]
docker build -t stan_segfault .
docker run -d --name stan_segfault stan_segfault
docker exec stan_segfault R -e 'example(stan_model, package = "rstan", run.dontrun = TRUE)'
Current Output:
*** caught segfault ***
address 0x18, cause 'memory not mapped'
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
Expected Output:

Not to segfault.

RStan Version:

2.26.13

R Version:

4.2.1 (have reproduced with all of 4.1.x - latest)

Operating System:

Ubuntu 20.04

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dockerfile and the example(stan_model, package = "rstan", run.dontrun = TRUE) command to reproduce the crash on Ubuntu 20.04. Investigate the failure that occurs when the R session exits, using the reported RStan 2.26.13 and R 4.2.1 environment. Done means the example exits without a segfault.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, r, ubuntu
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.