We are having a problem that seems to be unrelated to all the other problems we are having. When executing a toy model with StanHeaders 2.21.x on Linux with clang++-10
, we are getting
https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-ASAN/StanHeaders/00check.log
==437132==ERROR: AddressSanitizer: container-overflow on address 0x60800000b8e8 at pc 0x0000004a8eda bp 0x7fff4fa94a90 sp 0x7fff4fa94258
READ of size 24 at 0x60800000b8e8 thread T0
#0 0x4a8ed9 in __asan_memcpy /data/gannet/ripley/Sources2/LLVM/10.0.0/llvm-10.0.0.src/projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
#1 0x7f949b17d9cb in std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/string:1870:7
#2 0x7f949b17d9cb in void std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >::construct<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/memory:1876:31
#3 0x7f949b17d6cd in void std::__1::allocator_traits<std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::__construct_backward_with_exception_guarantees<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >>(std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) /usr/local/bin/ā¦/include/c++/v1/memory:1724:15
#4 0x7f949b17c5d9 in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::__swap_out_circular_buffer(std::__1::__split_buffer<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >&>&) /usr/local/bin/ā¦/include/c++/v1/vector:952:5
#5 0x7f949b17e157 in void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::__push_back_slow_path<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/vector:1627:5
#6 0x7f949b2a6103 in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::push_back(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/vector:1655:9
#7 0x7f949b2a6103 in stan::mcmc::base_nuts<stan::model::model_base, stan::mcmc::diag_e_metric, stan::mcmc::expl_leapfrog, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> > >::get_sampler_param_names(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/mcmc/hmc/nuts/base_nuts.hpp:210:11
#8 0x7f949b2834b6 in void stan::services::util::mcmc_writer::write_sample_namesstan::model::model_base(stan::mcmc::sample&, stan::mcmc::base_mcmc&, stan::model::model_base&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/services/util/mcmc_writer.hpp:72:13
#9 0x7f949b2aaef9 in void stan::services::util::run_adaptive_sampler<stan::mcmc::adapt_diag_e_nuts<stan::model::model_base, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> > >, stan::model::model_base, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> > >(stan::mcmc::adapt_diag_e_nuts<stan::model::model_base, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> > >&, stan::model::model_base&, std::__1::vector<double, std::__1::allocator >&, int, int, int, int, bool, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> >&, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&, stan::callbacks::writer&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/services/util/run_adaptive_sampler.hpp:63:10
#10 0x7f949b2aa5ce in int stan::services::sample::hmc_nuts_diag_e_adaptstan::model::model_base(stan::model::model_base&, stan::io::var_context&, stan::io::var_context&, unsigned int, unsigned int, double, int, int, int, bool, int, double, double, int, double, double, double, double, unsigned int, unsigned int, unsigned int, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&, stan::callbacks::writer&, stan::callbacks::writer&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/services/sample/hmc_nuts_diag_e_adapt.hpp:98:3
#11 0x7f949b245676 in int stan::services::sample::hmc_nuts_diag_e_adaptstan::model::model_base(stan::model::model_base&, stan::io::var_context&, unsigned int, unsigned int, double, int, int, int, bool, int, double, double, int, double, double, double, double, unsigned int, unsigned int, unsigned int, stan::callbacks::interrupt&, stan::callbacks::logger&, stan::callbacks::writer&, stan::callbacks::writer&, stan::callbacks::writer&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/services/sample/hmc_nuts_diag_e_adapt.hpp:150:10
#12 0x7f949b245676 in rstan::(anonymous namespace)::command(rstan::stan_args&, stan::model::model_base, Rcpp::Vector<19, Rcpp::PreserveStorage>&, std::__1::vector<unsigned long, std::__1::allocator > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > > const&, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> >&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/stan_fit.cpp:654:25
#13 0x7f949b243298 in rstan::stan_fit::call_sampler(Rcpp::Vector<19, Rcpp::PreserveStorage>) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/stan_fit.cpp:1137:15
#14 0x7f948b89e8fb in rstan::stan_fit_proxy::call_sampler(Rcpp::Vector<19, Rcpp::PreserveStorage>) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/stan_fit_rccp.cpp:53:17
#15 0x7f948b8a046d in Rcpp::CppMethod1<rstan::stan_fit_proxy, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage> >::operator()(rstan::stan_fit_proxy*, SEXPREC**) /data/gannet/ripley/R/test-clang/Rcpp/include/Rcpp/module/Module_generated_CppMethod.h:111:55
ā¦
0x60800000b8e8 is located 72 bytes inside of 96-byte region [0x60800000b8a0,0x60800000b900)
allocated by thread T0 here:
#0 0x4d921d in operator new(unsigned long) /data/gannet/ripley/Sources2/LLVM/10.0.0/llvm-10.0.0.src/projects/compiler-rt/lib/asan/asan_new_delete.cpp:99:3
#1 0x7f949b17bebb in std::__1::__libcpp_allocate(unsigned long, unsigned long) /usr/local/bin/ā¦/include/c++/v1/new:253:10
#2 0x7f949b17bebb in std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >::allocate(unsigned long, void const*) /usr/local/bin/ā¦/include/c++/v1/memory:1864:37
#3 0x7f949b17bebb in std::__1::allocator_traits<std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::allocate(std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >&, unsigned long) /usr/local/bin/ā¦/include/c++/v1/memory:1581:21
#4 0x7f949b17bebb in std::__1::__split_buffer<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >&) /usr/local/bin/ā¦/include/c++/v1/__split_buffer:318:29
#5 0x7f949b17e0d0 in void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::__push_back_slow_path<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/vector:1623:49
#6 0x7f949b2a6025 in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >::push_back(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) /usr/local/bin/ā¦/include/c++/v1/vector:1655:9
#7 0x7f949b2a6025 in stan::mcmc::base_nuts<stan::model::model_base, stan::mcmc::diag_e_metric, stan::mcmc::expl_leapfrog, boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014u, 0u, 2147483563u>, boost::random::linear_congruential_engine<unsigned int, 40692u, 0u, 2147483399u> > >::get_sampler_param_names(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >&) /tmp/RtmpsDMsn6/R.INSTALL19d602a7612d3/rstan/src/./stan/mcmc/hmc/nuts/base_nuts.hpp:208:11
HINT: if you donāt care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0.
If you suspect a false positive see also: AddressSanitizerContainerOverflow Ā· google/sanitizers Wiki Ā· GitHub.
SUMMARY: AddressSanitizer: container-overflow /data/gannet/ripley/Sources2/LLVM/10.0.0/llvm-10.0.0.src/projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy
Shadow bytes around the buggy address:
0x0c107fff96c0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c107fff96d0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c107fff96e0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c107fff96f0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c107fff9700: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c107fff9710: fa fa fa fa 00 00 00 00 00 00 00 00 00[fc]fc fc 0x0c107fff9720: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c107fff9730: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c107fff9740: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c107fff9750: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c107fff9760: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==437132==ABORTING