Carla Client core throwing "bad_weak_ptr"

Hi everyone,

Ever since I started using CARLA i used the ROS bridge in conjunction with it. I love all of the stuff you’ve created and it works like a charm, almost. One error I have been encountering since 0.9.6 (when I started) was that when I remove actors (most commonly ego actor with lots of sensors) there is roughly a 50/50 chance that the simulator throws with a “bad_weak_ptr” error.
I hoped this would be resolved over time, since I also saw others commenting on it, but no luck. I still have these issues, I’ve tried to work it out myself but is seems to have something to do with your core stream/shared_pointer lifecycle handling, and I didn’t wanna mess with that code :wink:

I am working with Linux, tried multiple systems, everywhere the same result. I have now implemented my own C++ ros bridge for Carla, and am experiencing the exact same issue like the python bridge. This hints towards it being a general core library issue.

Here is the immediate very cryptic gdb result:

terminate called after throwing an instance of ‘std::bad_weak_ptr’
what(): bad_weak_ptr

Thread 16 “carla_ros_bridg” received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffc3fff700 (LWP 22474)]
__GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:51
51 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff5604801 in __GI_abort () at abort.c:79
#2 0x00007ffff5ff7957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff5ffdab6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff5ffdaf1 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff5ffdd24 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00005555556cd348 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count (this=, __r=…) at /usr/bin/…/lib/gcc/x86_64-linux-gnu/7.5.0/…/…/…/…/include/c++/7.5.0/bits/shared_ptr_base.h:170
#7 std::__shared_ptr<carla::streaming::detail::tcp::Client, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<carla::streaming::detail::tcp::Client, void> (this=, __r=…)
at /usr/bin/…/lib/gcc/x86_64-linux-gnu/7.5.0/…/…/…/…/include/c++/7.5.0/bits/shared_ptr_base.h:1147
#8 std::shared_ptrcarla::streaming::detail::tcp::Client::shared_ptr<carla::streaming::detail::tcp::Client, void> (this=, __r=…)
at /usr/bin/…/lib/gcc/x86_64-linux-gnu/7.5.0/…/…/…/…/include/c++/7.5.0/bits/shared_ptr.h:266
#9 std::enable_shared_from_thiscarla::streaming::detail::tcp::Client::shared_from_this (this=) at /usr/bin/…/lib/gcc/x86_64-linux-gnu/7.5.0/…/…/…/…/include/c++/7.5.0/bits/shared_ptr.h:640
#10 carla::streaming::detail::tcp::Client::ReadData (this=) at …/…/LibCarla/source/carla/streaming/detail/tcp/Client.cpp:158
#11 0x00005555556cf9a7 in carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}::operator()(boost::system::error_code, unsigned long) const (this=, ec=…) at …/…/LibCarla/source/carla/streaming/detail/tcp/Client.cpp:118
#12 boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>::operator()() (this=) at …/boost-1.72.0-c8-install/include/boost/asio/detail/bind_handler.hpp:164
#13 boost::asio::asio_handler_invoke<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&, …) (function=…) at …/boost-1.72.0-c8-install/include/boost/asio/handler_invoke_hook.hpp:69
#14 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&, {lambda(boost::system::error_code)#1}&) (
function=…, context=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#15 boost::asio::detail::asio_handler_invoke<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}, boost::system::error_code, unsigned long>(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&, boost::asio::detail::binder2<{lambda(boost::system::error_code)#1}, boost::system::error_code, unsigned long>) (function=…, this_handler=) at …/boost-1.72.0-c8-install/include/boost/asio/detail/bind_handler.hpp:207
#16 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code, unsigned long)#1}>(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&, {lambda(boost::system::error_code, unsigned long)#1}&) (function=…, context=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#17 boost::asio::detail::strand_service::dispatch<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long> >(boost::asio::detail::strand_service::strand_impl
&, boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&) (this=0x555556086f50,
impl=, handler=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/impl/strand_service.hpp:62
#18 boost::asio::io_context::strand::initiate_dispatch::operator()<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&&, boost::asio::io_context::strand*) const (this=,
handler=…, self=) at …/boost-1.72.0-c8-install/include/boost/asio/io_context_strand.hpp:343
#19 boost::asio::async_result<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, void ()>::initiate<boost::asio::io_context::strand::initiate_dispatch, {lambda(boost::system::error_code, unsigned long)#1}, boost::asio::async_result<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, void ()>::initiate*>(boost::asio::io_context::strand::initiate_dispatch&&, {lambda(boost::system::error_code, unsigned long)#1}&&, boost::asio::async_result<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, void ()>::initiate*&&) (initiation=…, token=…, args=) at …/boost-1.72.0-c8-install/include/boost/asio/async_result.hpp:151
#20 boost::asio::async_initiate<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>, void (), boost::asio::io_context::strand::initiate_dispatch, void ()()> (initiation=…, token=…, args=)
at …/boost-1.72.0-c8-install/include/boost/asio/async_result.hpp:363
#21 boost::asio::io_context::strand::dispatch<boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long> >(boost::asio::detail::binder2<carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::system::error_code, unsigned long>&&) (this=, handler=…)
at …/boost-1.72.0-c8-install/include/boost/asio/io_context_strand.hpp:189
#22 boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running>::operator()<boost::system::error_code, unsigned long>(boost::system::error_code const&, unsigned long const&) (this=,
—Type to continue, or q to quit—
arg1=…, arg2=) at …/boost-1.72.0-c8-install/include/boost/asio/detail/wrapped_handler.hpp:99
#23 boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const
, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >::operator()(boost::system::error_code const&, unsigned long, int) (this=0x7fffc3ffe0a8, ec=…, bytes_transferred=, start=)
at …/boost-1.72.0-c8-install/include/boost/asio/impl/write.hpp:338
#24 0x00005555556d048f in boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>::operator()() (this=)
at …/boost-1.72.0-c8-install/include/boost/asio/detail/bind_handler.hpp:164
#25 boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>::operator()() (this=) at …/boost-1.72.0-c8-install/include/boost/asio/detail/wrapped_handler.hpp:191
#26 boost::asio::asio_handler_invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}> >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>&, …) (function=…) at …/boost-1.72.0-c8-install/include/boost/asio/handler_invoke_hook.hpp:69
#27 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>, {lambda(boost::system::error_code)#1}>(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>&, {lambda(boost::system::error_code)#1}&) (function=…, context=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#28 boost::asio::detail::asio_handler_invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running>, {lambda(boost::system::error_code)#1}>(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>&, boost::asio::detail::rewrapped_handler<boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running>, {lambda(boost::system::error_code)#1}>) (function=…, this_handler=) at …/boost-1.72.0-c8-install/include/boost/asio/detail/wrapped_handler.hpp:275
#29 boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const
, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> > >(boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>&, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >&) (function=…, context=…)
at …/boost-1.72.0-c8-install/include/boost/asio/detail/handler_invoke_helpers.hpp:37
#30 boost::asio::detail::handler_work<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}>, boost::asio::system_executor, boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long> >::complete<boost::asio::detail::write_op<—Type to continue, or q to quit—
boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> > >(boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >&, boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >&) (this=, function=…, handler=…)
at …/boost-1.72.0-c8-install/include/boost/asio/detail/handler_work.hpp:100
#31 boost::asio::detail::completion_handler<boost::asio::detail::rewrapped_handler<boost::asio::detail::binder2<boost::asio::detail::write_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor>, boost::asio::const_buffers_1, boost::asio::const_buffer const*, boost::asio::detail::transfer_all_t, boost::asio::detail::wrapped_handler<boost::asio::io_context::strand, carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}, boost::asio::detail::is_continuation_if_running> >, boost::system::error_code, unsigned long>, {lambda(boost::system::error_code)#1}> >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long) (owner=0x555556077530, base=)
at …/boost-1.72.0-c8-install/include/boost/asio/detail/completion_handler.hpp:70
#32 0x00005555556d9f3d in boost::asio::detail::scheduler_operation::complete (this=, owner=, ec=…, bytes_transferred=0) at …/boost-1.72.0-c8-install/include/boost/asio/detail/scheduler_operation.hpp:40
#33 boost::asio::detail::strand_service::do_complete (owner=0x555556077530, base=0x7fff80089820, ec=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/impl/strand_service.ipp:168
#34 0x0000555555662da0 in boost::asio::detail::scheduler_operation::complete (this=, owner=0x555556077530, ec=…, bytes_transferred=)
at …/boost-1.72.0-c8-install/include/boost/asio/detail/scheduler_operation.hpp:40
#35 boost::asio::detail::scheduler::do_run_one (this=0x555556077530, lock=…, this_thread=…, ec=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/impl/scheduler.ipp:447
#36 0x0000555555662801 in boost::asio::detail::scheduler::run (this=0x555556077530, ec=…) at …/boost-1.72.0-c8-install/include/boost/asio/detail/impl/scheduler.ipp:200
#37 0x00005555556663ee in boost::asio::io_context::run (this=) at …/boost-1.72.0-c8-install/include/boost/asio/impl/io_context.ipp:63
#38 carla::ThreadPool::Run (this=) at …/…/LibCarla/cmake/…/source/carla/ThreadPool.h:63
#39 0x00007ffff602866f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#40 0x00007ffff62fb6db in start_thread (arg=0x7fffc3fff700) at pthread_create.c:463
#41 0x00007ffff56e588f in clone () at …/sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)

Some more frames for details:
(gdb) f 11
#11 0x00005555556cf9a7 in carla::streaming::detail::tcp::Client::Connect()::$_0::operator()() const::{lambda(boost::system::error_code)#1}::operator()(boost::system::error_code) const::{lambda(boost::system::error_code, unsigned long)#1}
::operator()(boost::system::error_code, unsigned long) const (this=, ec=…) at …/…/LibCarla/source/carla/streaming/detail/tcp/Client.cpp:118
118 ReadData();
(gdb) l
113 boost::asio::buffer(&stream_id, sizeof(stream_id)),
114 _strand.wrap([=](error_code ec, size_t DEBUG_ONLY(bytes)) {
115 if (!ec) {
116 DEBUG_ASSERT_EQ(bytes, sizeof(stream_id));
117 // If succeeded start reading data.
118 ReadData();
119 } else {
120 // Else try again.
121 log_info(“streaming client: failed to send stream id:”, ec.message());
122 Connect();


(gdb) f 10
#10 carla::streaming::detail::tcp::Client::ReadData (this=) at …/…/LibCarla/source/carla/streaming/detail/tcp/Client.cpp:158
158 auto self = shared_from_this();
(gdb) l
153 }
154 });
155 }
156
157 void Client::ReadData() {
158 auto self = shared_from_this();
159 _strand.post(this, self {
160 if (_done) {
161 return;
162 }


(gdb) f 9
#9 std::enable_shared_from_thiscarla::streaming::detail::tcp::Client::shared_from_this (this=) at /usr/bin/…/lib/gcc/x86_64-linux-gnu/7.5.0/…/…/…/…/include/c++/7.5.0/bits/shared_ptr.h:640
640 { return shared_ptr<_Tp>(this->_M_weak_this); }
(gdb) l
635 ~enable_shared_from_this() { }
636
637 public:
638 shared_ptr<_Tp>
639 shared_from_this()
640 { return shared_ptr<_Tp>(this->_M_weak_this); }
641
642 shared_ptr
643 shared_from_this() const
644 { return shared_ptr(this->_M_weak_this); }

I’d be super thankful if someone could have a look or tell me how to solve it, if it is in fact a user issue :slight_smile:
Also I suggest adding a bug section to this forum, I couldn’t really find a fitting space to post this.

Thank you very much and keep on with the great work you’re doing!

Best,
Gunther