[R-pkg-devel] help with ASAN

Steven Scott @teve@the@b@ye@|@n @end|ng |rom gm@||@com
Wed Mar 25 22:17:28 CET 2020


I'm trying to build an ASAN enabled version of my R library to help debug
errors found by CRAN on my last submission.  I'm tantalizingly close, but
need some help figuring out what's wrong with my configuration.

I'm using a docker container that I think contains a version of R built
with the right options.  I launch the docker container as so:

docker run --cap-add SYS_PTRACE -e PASSWORD=<redacted> --rm -p 8787:8787 -v
/home/steve/code/BOOM:/home/steve/code/BOOM -it rocker/r-devel-ubsan-clang
/bin/bash

In this container I have added a ~/.R/Makevars file with the following
content:
CC= clang -std=c99 -fsanitize=address -fno-omit-frame-pointer
CXX= clang++ -std=c++11 -fsanitize=address -fno-omit-frame-pointer
CXX11= clang++ -std=c++11 -fsanitize=address -fno-omit-frame-pointer
FC = gfortran -fsanitize=address

When I build my package I get:
(... expected compiler output truncated except for final compile and link
step ... )
clang++ -std=c++11 -fsanitize=address -fno-omit-frame-pointer -std=gnu++11
-I"/usr/share/R/include" -DNDEBUG -I`/usr/lib/R/bin/Rscript -e
"cat(system.file(package='Boom'))"`/include -DADD_ -DR_NO_REMAP -DRLANGUAGE
-I"/usr/local/lib/R/site-library/Boom/include"   -fpic  -g -O2
-fdebug-prefix-map=/build/r-base-MP6Q4u/r-base-3.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -g  -c splines.cc -o splines.o
clang++ -std=c++11 -fsanitize=address -fno-omit-frame-pointer -std=gnu++11
-shared -L/usr/lib/R/lib -Wl,-z,relro -o BoomSpikeSlab.so
boom_spike_slab_init.o logit_spike_slab_wrapper.o mlm_spike_slab_wrapper.o
nested_regression_wrapper.o nnet_wrapper.o poisson_spike_slab_wrapper.o
probit_spike_slab_wrapper.o quantile_spike_wrapper.o
shrinkage_regression_wrapper.o spike_slab_wrapper.o splines.o
/usr/local/lib/R/site-library/Boom/lib/libboom.a -fsanitize=address
-L/usr/lib/R/lib -lR
installing to
/usr/local/lib/R/site-library/00LOCK-BoomSpikeSlab/00new/BoomSpikeSlab/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘BoomSpikeSlab’ in
dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object
'/usr/local/lib/R/site-library/00LOCK-BoomSpikeSlab/00new/BoomSpikeSlab/libs/BoomSpikeSlab.so':

/usr/local/lib/R/site-library/00LOCK-BoomSpikeSlab/00new/BoomSpikeSlab/libs/BoomSpikeSlab.so:
undefined symbol: __asan_option_detect_stack_use_after_return
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/BoomSpikeSlab’
* restoring previous ‘/usr/local/lib/R/site-library/BoomSpikeSlab’
PACKAGE = BoomSpikeSlab

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list