-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to README and Dockerfile following sibbling repo
- Loading branch information
1 parent
15b76b1
commit 7e98259
Showing
2 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,17 @@ LABEL org.label-schema.license="GPL-2.0" \ | |
maintainer="Dirk Eddelbuettel <[email protected]>" | ||
|
||
## Remain current | ||
RUN apt-get update -qq \ | ||
&& apt-get dist-upgrade -y | ||
RUN apt update -qq \ | ||
&& apt dist-upgrade -y | ||
|
||
## From the Build-Depends of the Debian R package, plus subversion, and clang-3.8 | ||
## Compiler flags from https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt | ||
## | ||
## Also add git autotools-dev automake so that we can build littler from source | ||
## libclang-rt-16-dev now required | ||
## | ||
RUN apt-get update -qq \ | ||
&& apt-get install -t unstable -y --no-install-recommends \ | ||
RUN apt update -qq \ | ||
&& apt install -t unstable -y --no-install-recommends \ | ||
automake \ | ||
autotools-dev \ | ||
bash-completion \ | ||
|
@@ -134,5 +134,7 @@ RUN cd /usr/local/bin \ | |
&& ln -s Rscriptdevel RDscript | ||
|
||
## Install littler | ||
RUN ASAN_OPTIONS=detect_leaks=0 R --slave -e "install.packages('littler')" \ | ||
&& ASAN_OPTIONS=detect_leaks=0 RD --slave -e "install.packages('littler')" | ||
RUN ASAN_OPTIONS='detect_leaks=0' R --slave -e "install.packages('littler')" \ | ||
&& ASAN_OPTIONS='detect_leaks=0' RD --slave -e "install.packages('littler')" | ||
|
||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
|
||
## R-devel SAN using Clang: R development binaries with Sanitizer support | ||
|
||
The [Writing R Extensions manual](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html) | ||
details in [Section 4.3](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Checking-memory-access) | ||
how to check memory access. Two sections are devoted to | ||
[Using the Address Sanitizer](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Address-Sanitizer) | ||
and to | ||
[Using the Undefined Behaviour Sanitizer](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Undefined-Behaviour-Sanitizer). | ||
|
||
Both require a particularly instrumented binary of R. This repository | ||
provides a Docker container with such a binary, based on the R-devel sources. | ||
|
||
This repository uses clang; a [sibling repository](https://github.com/rocker-org/r-devel-san) uses gcc. | ||
|
||
**Note**: This container must be run with `docker run --cap-add SYS_PTRACE`, otherwise instrumented processes fail to start due to lacking permissions. Alternatively, an instrumented process can be run with `ASAN_OPTIONS=detect_leaks=0`, but this turns off leak detection. | ||
The [Writing R Extensions manual](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html) details | ||
in [Section 4.3](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Checking-memory-access) | ||
how to check memory access. Two sections are devoted to [Using the Address | ||
Sanitizer](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Address-Sanitizer) and to | ||
[Using the Undefined Behaviour | ||
Sanitizer](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Undefined-Behaviour-Sanitizer). | ||
|
||
Both require a particularly instrumented binary of R. This repository provides a Docker container | ||
with such a binary, based on the R-devel sources. | ||
|
||
This repository uses clang; a [sibling repository](https://github.com/rocker-org/r-devel-san) uses | ||
gcc. | ||
|
||
**Note**: At least under some Docker versions, this container must be run with `docker run --cap-add | ||
SYS_PTRACE`, otherwise instrumented processes fail to start due to lacking | ||
permissions. Alternatively, an instrumented process can be run with `ASAN_OPTIONS=detect_leaks=0`, | ||
but this turns off leak detection. | ||
|
||
Note that the instrumented version of `R` is available on the path as `Rdevel`, symbolically linked | ||
as `RD`, and that the instrumented versions of `Rscript` is `Rscriptdevel` with symbolic link | ||
`RDscript`. Based on the R-devel sources, they use the sanitizer setup that is the focuse here | ||
whereas the `R` and `Rscript` binaries come from the standard binary package and correspond to | ||
R-release *without* any sanitizer instrumentation. So use `RD` and `RDscript` to inspect undefined | ||
behavior. | ||
|
||
The [sanitiziers](https://github.com/eddelbuettel/sanitizers) package by | ||
[Dirk](https://github.com/eddelbuettel) (also on CRAN | ||
[here](https://cran.r-project.org/web/packages/sanitizers/index.html)) contains 'known bad' behavior | ||
detected by sanitizers, It can be used to validate the setup as it should detect the errors under | ||
`RD` and `RDscript`---but not under `R` and `Rscript` which are not instrumented. If in doubt, use | ||
this to familiarise yourself with the sanitizer behavior. | ||
|
||
The (newer, larger) [r-debug](https://github.com/wch/r-debug) by [Winston](https://github.com/wch/) | ||
is also available with even more build configs and is also recommended. | ||
|
||
## Rocker-Org | ||
|
||
This repository is part of [Rocker-Org](https://github.com/rocker-org) where | ||
[Rocker](https://github.com/rocker-org/rocker) -- Docker containers of | ||
interest for R users -- is being developed. | ||
|
||
All this is work in progress; talk to @eddelbuettel and @cboettig about how | ||
to get involved. | ||
All this is work in progress; talk to [Dirk](https://github.com/eddelbuettel) or | ||
[Carl](https://github.com/cboettig) about how to get involved. | ||
|
||
Documentation is being added at the [Rocker Wiki](https://github.com/rocker-org/rocker/wiki). |