Hi, I'm not sure if this is an Rcpp problem or an rstan problem but reading through the rstan code I don't see a reason why the rstan code should be triggering it... so I'm looking for advice about how to debug it further.
I think the right etiquette is to just give a link to the issue, but please let me know if it is better to post everything here. This is currently an open issue on the rstan issue tracker: https://github.com/stan-dev/rstan/issues/76 The upshot is that when running a Stan model through Rstan for a small amount of data the code runs fine. With a larger amount of data it segfaults the R session with a stack overflow after getting into infinite recursion immediately after a call to R_ReleaseObject... I left the rest of the details at the link (including code/data which the rstan developers have been able to replicate the issue with). The backtrace (pre infinite recursion) is below and I would appreciate any help in figuring out the next step in debugging this. Sincerely, Krzysztof #521237 0x00007ffff79bc5c8 in ?? () from /usr/lib64/R/lib/libR.so #521238 0x00007ffff79bc5c8 in ?? () from /usr/lib64/R/lib/libR.so #521239 0x00007ffff79bc5c8 in ?? () from /usr/lib64/R/lib/libR.so ---Type <return> to continue, or q <return> to quit--- #521240 0x00007ffff79bd030 in R_ReleaseObject () from /usr/lib64/R/lib/libR.so #521241 0x00007ffff0d0c67e in void std::_Destroy_aux<false>::__destroy<Rcpp::Vector<14, Rcpp::PreserveStorage>*>(Rcpp::Vector<14, Rcpp::PreserveStorage>*, Rcpp::Vector<14, Rcpp::PreserveStorage>*) () from /tmp/RtmplSIXA8/file3cc170510487.so #521242 0x00007ffff0d11391 in std::vector<Rcpp::Vector<14, Rcpp::PreserveStorage>, std::allocator<Rcpp::Vector<14, Rcpp::PreserveStorage> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<Rcpp::Vector<14, >Rcpp::PreserveStorage>*, std::vector<Rcpp::Vector<14, >Rcpp::PreserveStorage>, std::allocator<Rcpp::Vector<14, >Rcpp::PreserveStorage> > > >, Rcpp::Vector<14, Rcpp::PreserveStorage> >const&) () from /tmp/RtmplSIXA8/file3cc170510487.so #521243 >0x00007ffff0cd2748 in void rstan::(anonymous >namespace)::execute_sampling<model3cc116ebc25d_growth_model_namespace::model3cc116ebc25d_growth_model, >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> > >(rstan::stan_args&, >2147483399u> > >>model3cc116ebc25d_growth_model_namespace::model3cc116ebc25d_growth_model&, >2147483399u> > >Rcpp::Vector<19, Rcpp::PreserveStorage>&, >2147483399u> > >stan::mcmc::base_mcmc*, stan::mcmc::sample&, >2147483399u> > >std::vector<unsigned long, std::allocator<unsigned >2147483399u> > >long> > const&, std::vector<double, >2147483399u> > >long> > std::allocator<double> >&, >2147483399u> > >long> > std::basic_fstream<char, >2147483399u> > >long> > std::char_traits<char> >&, >2147483399u> > >long> > std::basic_fstream<char, >2147483399u> > >long> > std::char_traits<char> >&, >2147483399u> > >long> > std::vector<std::string, >2147483399u> > >long> > std::allocator<std::string> > const&, >2147483399u> > >long> > >boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > int, 40014u, 0u, 2147483563u>, >2147483399u> > >long> > boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > int, 40692u, 0u, 2147483399u> >&) () >2147483399u> > >long> > from /tmp/RtmplSIXA8/file3cc170510487.so >2147483399u> > >long> > #521244 0x00007ffff0cd7dca in int >2147483399u> > >long> > rstan::(anonymous >2147483399u> > >long> > >namespace)::sampler_command<model3cc116ebc25d_growth_mo---Type >2147483399u> > >long> > <return> to continue, or q <return> to quit--- >2147483399u> > >long> > del_namespace::model3cc116ebc25d_growth_model, >2147483399u> > >long> > >boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > int, 40014u, 0u, 2147483563u>, >2147483399u> > >long> > boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > int, 40692u, 0u, 2147483399u> > >2147483399u> > >long> > >(rstan::stan_args&, >2147483399u> > >long> > >>model3cc116ebc25d_growth_model_namespace::model3cc116ebc25d_growth_model&, >2147483399u> > >long> > >Rcpp::Vector<19, Rcpp::PreserveStorage>&, >2147483399u> > >long> > >std::vector<unsigned long, >2147483399u> > >long> > >std::allocator<unsigned long> > const&, >2147483399u> > >long> > >std::vector<std::string, >2147483399u> > >long> > >std::allocator<std::string> > const&, >2147483399u> > >long> > >>boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > >int, 40014u, 0u, 2147483563u>, >2147483399u> > >long> > >boost::random::linear_congruential_engine<unsigned >2147483399u> > >long> > >int, 40692u, 0u, 2147483399u> >&) () from /tmp/RtmplSIXA8/file3cc170510487.so #521245 0x00007ffff0d45d8b in rstan::stan_fit<model3cc116ebc25d_growth_model_namespace::model3cc116ebc25d_growth_model, 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> > >::call_sampler(SEXPREC*) () 2147483399u> > >from /tmp/RtmplSIXA8/file3cc170510487.so #521246 2147483399u> > >0x00007ffff0d47c06 in 2147483399u> > >Rcpp::class_<rstan::stan_fit<model3cc116ebc25d_growth_model_namespace::model3cc116ebc25d_growth_model, 2147483399u> > >boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned 2147483399u> > >int, 40014u, 0u, 2147483563u>, 2147483399u> > >boost::random::linear_congruential_engine<unsigned int, 2147483399u> > >40692u, 0u, 2147483399u> > > 2147483399u> > >>::invoke_notvoid(SEXPREC*, SEXPREC*, SEXPREC**, int) 2147483399u> > >>() from /tmp/RtmplSIXA8/file3cc170510487.so #521247 2147483399u> > >>0x00007ffff2f40fd3 in 2147483399u> > >>CppMethod__invoke_notvoid(SEXPREC*) () 2147483399u> > >>from /home/krzysiek/R/x86_64-pc-linux-gnu-library/3.1/Rcpp/libs/Rcpp.so 2147483399u> > >>#521248 0x00007ffff7951019 in ?? () 2147483399u> > >>from /usr/lib64/R/lib/libR.so #521249 0x00007ffff79918f5 in ?? () from /usr/lib64/R/lib/libR.so ---Type <return> to continue, or q <return> to quit--- #521250 0x00007ffff7994e03 in ?? () from /usr/lib64/R/lib/libR.so #521251 0x00007ffff7991717 in ?? () from /usr/lib64/R/lib/libR.so #521252 0x00007ffff7996475 in Rf_applyClosure () from /usr/lib64/R/lib/libR.so #521253 0x00007ffff799146e in ?? () from /usr/lib64/R/lib/libR.so _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
