Compiling with full debugging I got
Program received signal SIGSEGV, Segmentation fault.
boost::numeric::odeint::detail::for_each8<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, boost::numeric::odeint::default_operations::scale_sum7<double, double, double, double, double, double, double> > (op=..., first8=0, first7=<error reading variable: Cannot access memory at address 0x8>, first6=<error reading variable: Cannot access memory at address 0x8>, first5=<error reading variable: Cannot access memory at address 0x8>, first4=<error reading variable: Cannot access memory at address 0x8>, first3=0, first2=0, last1=..., first1=0) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/algebra/detail/for_each.hpp:90
90 op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ );
(gdb) bt
#0 boost::numeric::odeint::detail::for_each8<__gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double const*, std::vector<double, std::allocator<double> > >, boost::numeric::odeint::default_operations::scale_sum7<double, double, double, double, double, double, double> > (op=..., first8=0, first7=<error reading variable: Cannot access memory at address 0x8>, first6=<error reading variable: Cannot access memory at address 0x8>, first5=<error reading variable: Cannot access memory at address 0x8>, first4=<error reading variable: Cannot access memory at address 0x8>, first3=0, first2=0, last1=..., first1=0) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/algebra/detail/for_each.hpp:90
#1 boost::numeric::odeint::range_algebra::for_each8<std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, std::vector<double, std::allocator<double> > const, boost::numeric::odeint::default_operations::scale_sum7<double, double, double, double, double, double, double> > (op=..., s8=..., s7=std::vector of length 0, capacity 0, s6=std::vector of length 0, capacity 0, s5=std::vector of length 0, capacity 0, s4=std::vector of length 0, capacity 0, s3=..., s2=..., s1=std::vector of length 1, capacity 1 = {...}) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/algebra/range_algebra.hpp:83
#2 boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>::calc_state<std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> > > (t_new=0, deriv_new=..., t_old=0, deriv_old=..., x_old=..., x=std::vector of length 1, capacity 1 = {...}, t=6.4432420282839148e-273, this=0x7fffffffa290) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp:267
#3 boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>::calc_state<std::vector<double, std::allocator<double> > > (x=std::vector of length 1, capacity 1 = {...}, t=6.4432420282839148e-273, this=0x7fffffffa290) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp:354
#4 boost::numeric::odeint::checked_stepper<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, boost::numeric::odeint::max_step_checker, boost::numeric::odeint::dense_output_stepper_tag>::calc_state<std::vector<double, std::allocator<double> > > (x=std::vector of length 1, capacity 1 = {...}, t=6.4432420282839148e-273, this=<synthetic pointer>) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/integrate/check_adapter.hpp:164
#5 boost::numeric::odeint::detail::integrate_times<boost::numeric::odeint::checked_stepper<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, boost::numeric::odeint::max_step_checker, boost::numeric::odeint::dense_output_stepper_tag>, std::reference_wrapper<stan::math::coupled_ode_system<crash_model_namespace::ode_variadic2_functor__, double, std::vector<double, std::allocator<double> > const&> >, std::vector<double, std::allocator<double> >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double, boost::numeric::odeint::checked_observer<stan::math::ode_rk45_tol_impl<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0>(char const*, crash_model_namespace::ode_variadic2_functor__ const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, double, std::vector<double, std::allocator<double> > const&, double, double, long, std::ostream*, std::vector<double, std::allocator<double> > const&)::{lambda(std::vector<double, std::allocator<double> > const&, double)#3}, boost::numeric::odeint::max_step_checker> >(boost::numeric::odeint::checked_stepper<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, boost::numeric::odeint::max_step_checker, boost::numeric::odeint::dense_output_stepper_tag>, std::reference_wrapper<stan::math::coupled_ode_system<crash_model_namespace::ode_variadic2_functor__, double, std::vector<double, std::allocator<double> > const&> >, std::vector<double, std::allocator<double> >&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double, boost::numeric::odeint::checked_observer<stan::math::ode_rk45_tol_impl<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0>(char const*, crash_model_namespace::ode_variadic2_functor__ const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, double, std::vector<double, std::allocator<double> > const&, double, double, long, std::ostream*, std::vector<double, std::allocator<double> > const&)::{lambda(std::vector<double, std::allocator<double> > const&, double)#3}, boost::numeric::odeint::max_step_checker>, boost::numeric::odeint::dense_output_stepper_tag) (observer=..., dt=0.10000000000000001, end_time=0, start_time=6.4432420282839148e-273, start_state=std::vector of length 1, capacity 1 = {...}, system=..., stepper=...) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/integrate/detail/integrate_times.hpp:149
#6 boost::numeric::odeint::integrate_times<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, std::reference_wrapper<stan::math::coupled_ode_system<crash_model_namespace::ode_variadic2_functor__, double, std::vector<double, std::allocator<double> > const&> >, std::vector<double, std::allocator<double> >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double, stan::math::ode_rk45_tol_impl<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0>(char const*, crash_model_namespace::ode_variadic2_functor__ const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, double, std::vector<double, std::allocator<double> > const&, double, double, long, std::ostream*, std::vector<double, std::allocator<double> > const&)::{lambda(std::vector<double, std::allocator<double> > const&, double)#3}, boost::numeric::odeint::max_step_checker>(boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<double, std::allocator<double> >, double, std::vector<double, std::allocator<double> >, double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::range_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, std::reference_wrapper<stan::math::coupled_ode_system<crash_model_namespace::ode_variadic2_functor__, double, std::vector<double, std::allocator<double> > const&> >, std::vector<double, std::allocator<double> >&, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, __gnu_cxx::__normal_iterator<double*, std::vector<double, std::allocator<double> > >, double, stan::math::ode_rk45_tol_impl<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0>(char const*, crash_model_namespace::ode_variadic2_functor__ const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, double, std::vector<double, std::allocator<double> > const&, double, double, long, std::ostream*, std::vector<double, std::allocator<double> > const&)::{lambda(std::vector<double, std::allocator<double> > const&, double)#3}, boost::numeric::odeint::max_step_checker) (checker=..., observer=..., dt=0.10000000000000001, times_end=..., times_start=..., start_state=std::vector of length 1, capacity 1 = {...}, system=..., stepper=...) at stan/lib/stan_math/lib/boost_1.78.0/boost/numeric/odeint/integrate/integrate_times.hpp:53
#7 stan::math::ode_rk45_tol_impl<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0> (function_name=function_name@entry=0x5555556948d9 "ode_rk45", f=..., y0_arg=Eigen::Matrix<double,1,1,ColMajor> (data ptr: 0x5555557203f0) = {...}, t0=<optimized out>, t0@entry=0, ts=std::vector of length 1, capacity 1 = {...}, relative_tolerance=<optimized out>, relative_tolerance@entry=9.9999999999999995e-07, absolute_tolerance=<optimized out>, absolute_tolerance@entry=9.9999999999999995e-07, max_num_steps=<optimized out>, max_num_steps@entry=1000000, msgs=0x7fffffffac30) at stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:145
#8 0x000055555558cbec in stan::math::ode_rk45<crash_model_namespace::ode_variadic2_functor__, Eigen::Matrix<double, -1, 1, 0, -1, 1>, double, double, std::vector<double, std::allocator<double> >, (void*)0> (msgs=0x7fffffffac30, ts=std::vector of length 1, capacity 1 = {...}, t0=0, y0=Eigen::Matrix<double,1,1,ColMajor> (data ptr: 0x5555557203f0) = {...}, f=...) at stan/lib/stan_math/stan/math/prim/functor/ode_rk45.hpp:254
#9 crash_model_namespace::u<double, double, double, double, (void*)0> (z=<optimized out>, faketheta=std::vector of length 5, capacity 5 = {...}, pstream__=0x7fffffffac30, x_i=..., x_r=..., xc=<optimized out>) at ../../ml/stanc3/crash.hpp:171
#10 0x00005555555a6c61 in crash_model_namespace::u_functor__::operator()<double, double, double, double, (void*)0> (pstream__=<optimized out>, x_i=..., x_r=..., faketheta=..., xc=<synthetic pointer>: <optimized out>, z=@0x7fffffffa5f0: 6.4432420282839148e-273, this=<optimized out>) at ../../ml/stanc3/crash.hpp:205
#11 integrate_1d_adapter<crash_model_namespace::u_functor__>::operator()<double, double, double> (x_i=..., x_r=..., theta=..., msgs=<optimized out>, xc=<synthetic pointer>: <optimized out>, x=@0x7fffffffa5f0: 6.4432420282839148e-273, this=<optimized out>) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d_adapter.hpp:24
#12 stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0>(integrate_1d_adapter<crash_model_namespace::u_functor__> const&, double, double, double, std::ostream*, std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::vector<int, std::allocator<int> > const&)::{lambda(auto:1 const&, auto:2 const&)#1}::operator()<double, double>(double const&, double const&) const (xc=<synthetic pointer>: <optimized out>, x=@0x7fffffffa5f0: 6.4432420282839148e-273, __closure=<optimized out>) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d.hpp:187
#13 stan::math::integrate<stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0>(integrate_1d_adapter<crash_model_namespace::u_functor__> const&, double, double, double, std::ostream*, std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::vector<int, std::allocator<int> > const&)::{lambda(auto:1 const&, auto:2 const&)#1}>(stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0>(integrate_1d_adapter<crash_model_namespace::u_functor__> const&, double, double, double, std::ostream*, std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::vector<int, std::allocator<int> > const&)::{lambda(auto:1 const&, auto:2 const&)#1} const&, double, double, double)::{lambda(double, double)#4}::operator()(double, double) const (__closure=<optimized out>, __closure=<optimized out>, xc=<optimized out>, x=<optimized out>) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d.hpp:141
#14 _ZZN5boost4math10quadrature9tanh_sinhIdNS0_8policies6policyINS3_14default_policyES5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_EEE9integrateIZN4stan4math9integrateIZNSA_17integrate_1d_implI20integrate_1d_adapterIN21crash_model_namespace11u_functor__EEJSt6vectorIdSaIdEESJ_SH_IiSaIiEEELPv0EEEdRKT_dddPSoDpRKT0_EUlSP_RKT0_E_EEdSP_dddEUlddE2_EEKDTclcl7declvalISN_EEcl7declvalIdEEcl7declvalIdEEEESN_dddPdS12_PmENKUlddE_clEdd (z=<optimized out>, zc=<optimized out>, __closure=<optimized out>) at stan/lib/stan_math/lib/boost_1.78.0/boost/math/quadrature/tanh_sinh.hpp:244
#15 _ZZN5boost4math10quadrature9tanh_sinhIdNS0_8policies6policyINS3_14default_policyES5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_EEE9integrateIZN4stan4math9integrateIZNSA_17integrate_1d_implI20integrate_1d_adapterIN21crash_model_namespace11u_functor__EEJSt6vectorIdSaIdEESJ_SH_IiSaIiEEELPv0EEEdRKT_dddPSoDpRKT0_EUlSP_RKT0_E_EEdSP_dddEUlddE2_EEKDTclcl7declvalISN_EEcl7declvalIdEEcl7declvalIdEEEESN_dddPdS12_PmENKUlddE_clEdd (__closure=<optimized out>, z=<optimized out>, zc=<optimized out>) at stan/lib/stan_math/lib/boost_1.78.0/boost/math/quadrature/tanh_sinh.hpp:241
#16 0x00005555555a6e1b in _ZNK5boost4math10quadrature6detail16tanh_sinh_detailIdNS0_8policies6policyINS4_14default_policyES6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_S6_EEE9integrateIZNS1_9tanh_sinhIdS7_E9integrateIZN4stan4math9integrateIZNSE_17integrate_1d_implI20integrate_1d_adapterIN21crash_model_namespace11u_functor__EEJSt6vectorIdSaIdEESN_SL_IiSaIiEEELPv0EEEdRKT_dddPSoDpRKT0_EUlST_RKT0_E_EEdST_dddEUlddE2_EEKDTclcl7declvalISR_EEcl7declvalIdEEcl7declvalIdEEEESR_dddPdS16_PmEUlddE_EES14_SR_S16_S16_PKcdddS17_ (this=0x55555571fa70, f=..., error=error@entry=0x7fffffffa7a8, L1=L1@entry=0x7fffffffa7b0, function=0x55555569498c "tanh_sinh<%1%>::integrate", left_min_complement=left_min_complement@entry=8.9002954340288055e-308, right_min_complement=right_min_complement@entry=8.9002954340288055e-308, tolerance=tolerance@entry=1.4901161193847656e-08, levels=levels@entry=0x7fffffffa7b8) at stan/lib/stan_math/lib/boost_1.78.0/boost/math/quadrature/detail/tanh_sinh_detail.hpp:238
#17 0x000055555558d883 in _ZN5boost4math10quadrature9tanh_sinhIdNS0_8policies6policyINS3_14default_policyES5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_S5_EEE9integrateIZN4stan4math9integrateIZNSA_17integrate_1d_implI20integrate_1d_adapterIN21crash_model_namespace11u_functor__EEJSt6vectorIdSaIdEESJ_SH_IiSaIiEEELPv0EEEdRKT_dddPSoDpRKT0_EUlSP_RKT0_E_EEdSP_dddEUlddE2_EEKDTclcl7declvalISN_EEcl7declvalIdEEcl7declvalIdEEEESN_dddPdS12_Pm (levels=0x7fffffffa7b8, L1=0x7fffffffa7b0, error=0x7fffffffa7a8, tolerance=1.4901161193847656e-08, b=<optimized out>, a=<optimized out>, f=..., this=0x7fffffffa7e0) at stan/lib/stan_math/lib/boost_1.78.0/boost/math/quadrature/tanh_sinh.hpp:251
#18 stan::math::integrate<stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0>(integrate_1d_adapter<crash_model_namespace::u_functor__> const&, double, double, double, std::ostream*, std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::vector<int, std::allocator<int> > const&)::{lambda(auto:1 const&, auto:2 const&)#1}>(stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0>(integrate_1d_adapter<crash_model_namespace::u_functor__> const&, double, double, double, std::ostream*, std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::vector<int, std::allocator<int> > const&)::{lambda(auto:1 const&, auto:2 const&)#1} const&, double, double, double) (relative_tolerance=1.4901161193847656e-08, b=<optimized out>, a=0, f=...) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d.hpp:152
#19 stan::math::integrate_1d_impl<integrate_1d_adapter<crash_model_namespace::u_functor__>, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0> (f=..., b=<optimized out>, msgs=<optimized out>, relative_tolerance=1.4901161193847656e-08, a=0) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d.hpp:186
#20 0x00005555555d3566 in stan::math::integrate_1d<crash_model_namespace::u_functor__> (relative_tolerance=1.4901161193847656e-08, msgs=0x7fffffffac30, x_i=std::vector of length 1, capacity 1 = {...}, x_r=std::vector of length 1, capacity 1 = {...}, theta=std::vector of length 5, capacity 5 = {...}, b=<optimized out>, a=0, f=...) at stan/lib/stan_math/stan/math/prim/functor/integrate_1d.hpp:245
#21 crash_model_namespace::crash_model::log_prob_impl<false, true, std::vector<double, std::allocator<double> >, std::vector<int, std::allocator<int> >, (void*)0, (void*)0> (this=0x555555720d20, params_r__=..., params_i__=..., pstream__=0x7fffffffac30) at ../../ml/stanc3/crash.hpp:381
#22 0x000055555564b801 in stan::model::model_base::log_prob<false, true, double> (msgs=0x7fffffffac30, params_i=std::vector of length 0, capacity 0, params_r=std::vector of length 4, capacity 4 = {...}, this=0x555555720d20) at stan/src/stan/model/model_base.hpp:549
#23 stan::services::util::initialize<true, stan::model::model_base, stan::io::var_context, 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> > > (model=..., init=..., rng=..., init_radius=init_radius@entry=2, print_timing=print_timing@entry=true, logger=..., init_writer=...) at stan/src/stan/services/util/initialize.hpp:129
#24 0x000055555566a691 in stan::services::sample::hmc_nuts_diag_e_adapt<stan::model::model_base> (model=..., init=..., init_inv_metric=..., random_seed=random_seed@entry=1770809485, chain=chain@entry=1, init_radius=init_radius@entry=2, num_warmup=num_warmup@entry=1000, num_samples=1000, num_thin=1, save_warmup=false, refresh=100, stepsize=stepsize@entry=1, stepsize_jitter=stepsize_jitter@entry=0, max_depth=10, delta=delta@entry=0.80000000000000004, gamma=gamma@entry=0.050000000000000003, kappa=kappa@entry=0.75, t0=t0@entry=10, init_buffer=75, term_buffer=50, window=25, interrupt=..., logger=..., init_writer=..., sample_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
..., diagnostic_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
...) at stan/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp:73
#25 0x000055555566d315 in stan::services::sample::hmc_nuts_diag_e_adapt<stan::model::model_base> (diagnostic_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
..., sample_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
..., init_writer=..., logger=..., interrupt=..., window=25, term_buffer=50, init_buffer=75, t0=10, kappa=0.75, gamma=0.050000000000000003, delta=0.80000000000000004, max_depth=10, stepsize_jitter=0, stepsize=1, refresh=100, save_warmup=false, num_thin=1, num_samples=1000, num_warmup=1000, init_radius=2, chain=1, random_seed=1770809485, init=..., model=...) at stan/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp:151
#26 stan::services::sample::hmc_nuts_diag_e_adapt<stan::model::model_base, std::shared_ptr<stan::io::var_context>, stan::callbacks::writer, stan::callbacks::unique_stream_writer<std::ostream>, stan::callbacks::unique_stream_writer<std::ostream> > (model=..., num_chains=num_chains@entry=1, init=std::vector of length 1, capacity 1 = {...}, random_seed=random_seed@entry=1770809485, init_chain_id=init_chain_id@entry=1, init_radius=init_radius@entry=2, num_warmup=num_warmup@entry=1000, num_samples=1000, num_thin=1, save_warmup=false, refresh=100, stepsize=stepsize@entry=1, stepsize_jitter=stepsize_jitter@entry=0, max_depth=10, delta=delta@entry=0.80000000000000004, gamma=gamma@entry=0.050000000000000003, kappa=kappa@entry=0.75, t0=t0@entry=10, init_buffer=75, term_buffer=50, window=25, interrupt=..., logger=..., init_writer=std::vector of length 1, capacity 1 = {...}, sample_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
std::vector of length 1, capacity 1 = {...}, diagnostic_writer=warning: RTTI symbol not found for class 'stan::callbacks::unique_stream_writer<std::ostream>'
std::vector of length 1, capacity 1 = {...}) at stan/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp:340
#27 0x00005555555fb04b in cmdstan::command (argc=<optimized out>, argv=<optimized out>) at src/cmdstan/command.hpp:991
#28 0x00005555555881aa in main (argc=<optimized out>, argv=<optimized out>) at src/cmdstan/main.cpp:6
Which suggested to me that the ODE call is accessing memory it shouldn’t somehow. My guess is that you have arrays of different sizes which need to be the same somewhere, I’m still poking around