The issue was due to an idiom we were using all over the place, to get a pointer to the head of a std::vector:
std::vector<char> buf;
char* pBuf = &buf[0];
This fails on Fedora 28 due to _GLIBCXX_ASSERTIONS being defined, which causes std::vector to range check on indexing operations.
Test notes
Use this Dockerfile:
FROM fedora:latest
RUN dnf install -y R pandoc gdb
# If you have weird compile problems, it might be because -j4 causes the container
# to run out of memory. You can reduce the number or coment this out if needed.
RUN echo "MAKEFLAGS=-j4" > ~/.Renviron
RUN R -e "install.packages('shiny', repos = c(CRAN='https://cloud.r-project.org'), INSTALL_opts = '--no-help --no-html')"
Build the docker image:
docker build -t r-fedora .
Run the docker image:
docker run --rm -ti -p 4321:4321 --security-opt seccomp=unconfined r-fedora /bin/bash
Run a Shiny app using:
R --quiet -e 'shiny::runExample("01_hello", host = "0.0.0.0", port = 4321L, launch.browser = FALSE)'
Then launch a web browser and point it to http://localhost:4321. It should fail and crash R.
Now install the fix:
R --quiet -e 'install.packages("remotes", repos = c(CRAN="https://cloud.r-project.org")); remotes::install_github("rstudio/httpuv@joe/bugfix/safe-addr")'
and run the Shiny app again. This time it should work.
The issue was due to an idiom we were using all over the place, to get a pointer to the head of a
std::vector
:This fails on Fedora 28 due to
_GLIBCXX_ASSERTIONS
being defined, which causesstd::vector
to range check on indexing operations.Test notes
Use this Dockerfile:
Build the docker image:
Run the docker image:
Run a Shiny app using:
Then launch a web browser and point it to http://localhost:4321. It should fail and crash R.
Now install the fix:
and run the Shiny app again. This time it should work.