weixin_39636102
weixin_39636102
2020-12-31 15:35

debugging experience

When debugging mqtt_cpp, the use of std::variant / boost::variant causes very very large template types to be displayed in stack traces.

It would make the debugging experience significantly better if these template types could be improved.

One way we could do that is by having an mqtt type that inherits from the template type, and use the derived type in all places.

该提问来源于开源项目:redboltz/mqtt_cpp

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

16条回答

  • weixin_39777875 weixin_39777875 4月前

    Properties are usually used as aggregation. variant is based on value semantics. So I directly place the property value as follows:

    https://wandbox.org/permlink/vwJqrzzFQUsrq8Qa

    If your inherit approach means virtual function based one, how to do that?

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    I meant simply:

    
    struct mqtt_property_varient : public mqtt::varient<list of properties here...>
    {
        using Base_t = mqtt::varient<list of properties here...>;
        using Base_t::Base_t;
        using Base_t::operator=;
    };
    </list></list>
    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Here's an example.

    I was using address sanatizer on some of my code that uses mqtt_cpp.

    There are two major pain points. Boost MultiIndex (Doubtful anything can be done with that...), and the properties from mqtt_cpp.

    When dealing with a fixed width display (e.g., no scroll bar), the size of the properties template list is overwhelming.

    
    
    =================================================================
    ==27014==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110000baa10 at pc 0x5555556af0de bp 0x7fffffffc900 sp 0x7fffffffc8f0
    READ of size 8 at 0x6110000baa10 thread T0
        #0 0x5555556af0dd in boost::multi_index::detail::ordered_index_node_impl<:multi_index::detail::null_augment_policy std::allocator> >::increment(boost::multi_index::detail::ordered_index_node_impl<:multi_index::detail::null_augment_policy std::allocator> >*&) (/root/src/cloud-connector/cloud-connector+0x15b0dd)
        #1 0x55555566f3e1 in boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::index_node_base std::allocator> > >::increment(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::index_node_base std::allocator> > >*&) (/root/src/cloud-connector/cloud-connector+0x11b3e1)
        #2 0x5555556403fa in boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >::operator++() (/root/src/cloud-connector/cloud-connector+0xec3fa)
        #3 0x555555620a62 in Broker::send_pingreq_to_all_connections() (/root/src/cloud-connector/cloud-connector+0xcca62)
        #4 0x5555555cbb0d in operator() /home/jonesmz/meshpp_frameworks/src/cloud-connector/main.cpp:1454
        #5 0x5555555d1e94 in operator() /home/jonesmz/meshpp_frameworks/inc/meshpp/asio/periodic_timer.h:46
        #6 0x5555555ddaf5 in operator() /usr/include/boost/asio/detail/bind_handler.hpp:47
        #7 0x5555555dd8aa in asio_handler_invoke<:asio::detail::binder1 time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code>, boost::system::error_code> > /usr/include/boost/asio/handler_invoke_hook.hpp:69
        #8 0x5555555dd446 in invoke<:asio::detail::binder1 time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code>, boost::system::error_code>, meshpp::asio::PeriodicTimer<func_t time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code> > /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
        #9 0x5555555dce84 in do_complete /usr/include/boost/asio/detail/wait_handler.hpp:70
        #10 0x5555555e7fb7 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) (/root/src/cloud-connector/cloud-connector+0x93fb7)
        #11 0x5555555f033d in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<:asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) (/root/src/cloud-connector/cloud-connector+0x9c33d)
        #12 0x5555555ef60d in boost::asio::detail::task_io_service::run(boost::system::error_code&) (/root/src/cloud-connector/cloud-connector+0x9b60d)
        #13 0x5555555f093b in boost::asio::io_service::run() (/root/src/cloud-connector/cloud-connector+0x9c93b)
        #14 0x5555555ce1b1 in main /home/jonesmz/meshpp_frameworks/src/cloud-connector/main.cpp:1463
        #15 0x7ffff48c7b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
        #16 0x555555594709 in _start (/root/src/cloud-connector/cloud-connector+0x40709)
    
    0x6110000baa10 is located 208 bytes inside of 240-byte region [0x6110000ba940,0x6110000baa30)
    freed by thread T0 here:
        #0 0x7ffff6efa9c0 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xf09c0)
        #1 0x5555556ec750 in __gnu_cxx::new_allocator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > >::deallocate(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*, unsigned long) (/root/src/cloud-connector/cloud-connector+0x198750)
        #2 0x5555556ac172 in boost::multi_index::multi_index_container<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::deallocate_node(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*) (/root/src/cloud-connector/cloud-connector+0x158172)
        #3 0x55555575de6b in boost::multi_index::multi_index_container<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::erase_(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*) (/root/src/cloud-connector/cloud-connector+0x209e6b)
        #4 0x55555571c5f8 in boost::multi_index::detail::index_base<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::final_erase_(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*) (/root/src/cloud-connector/cloud-connector+0x1c85f8)
        #5 0x5555556db5db in boost::multi_index::detail::ordered_index_impl<:multi_index::member std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, std::less<:variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > > >, boost::multi_index::detail::nth_layer<2, Broker::session_state, boost::multi_index::indexed_by<:multi_index::ordered_unique mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >, boost::mpl::v_item<:tag_con boost::mpl::vector0>, 0>, boost::multi_index::detail::ordered_unique_tag, boost::multi_index::detail::null_augment_policy>::erase(boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >) (/root/src/cloud-connector/cloud-connector+0x1875db)
        #6 0x555555696d1c in void Broker::close_proc<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&&, bool) (/root/src/cloud-connector/cloud-connector+0x142d1c)
        #7 0x55555565ab8e in Broker::handle_accept<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&)::{lambda(boost::system::error_code const&)#3}::operator()(boost::system::error_code const&) const (/root/src/cloud-connector/cloud-connector+0x106b8e)
        #8 0x5555556dca3f in std::_Function_handler<void const broker::handle_accept boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&)::{lambda(boost::system::error_code const&)#3}>::_M_invoke(std::_Any_data const&, boost::system::error_code const&) (/root/src/cloud-connector/cloud-connector+0x188a3f)
        #9 0x555555693cf3 in std::function<void const>::operator()(boost::system::error_code const&) const (/root/src/cloud-connector/cloud-connector+0x13fcf3)
        #10 0x5555556fa69c in mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>::handle_error(boost::system::error_code const&) (/root/src/cloud-connector/cloud-connector+0x1a669c)
        #11 0x5555556b0353 in void mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>::do_sync_write<:v5::pingreq_message>(mqtt::v5::pingreq_message&&) (/root/src/cloud-connector/cloud-connector+0x15c353)
        #12 0x55555566f920 in mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>::send_pingreq() (/root/src/cloud-connector/cloud-connector+0x11b920)
        #13 0x5555556405ae in mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>::pingreq() (/root/src/cloud-connector/cloud-connector+0xec5ae)
        #14 0x5555556206fe in auto Broker::send_pingreq_to_all_connections()::{lambda(auto:1&)#1}::operator()<:shared_ptr boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const>(std::shared_ptr<:endpoint boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const&) const (/root/src/cloud-connector/cloud-connector+0xcc6fe)
        #15 0x55555566fa47 in void std::__invoke_impl<void broker::send_pingreq_to_all_connections std::shared_ptr boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const&>(std::__invoke_other, Broker::send_pingreq_to_all_connections()::{lambda(auto:1&)#1}&&, std::shared_ptr<:endpoint boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const&) (/root/src/cloud-connector/cloud-connector+0x11ba47)
        #16 0x55555564060b in std::__invoke_result<:send_pingreq_to_all_connections std::shared_ptr boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const&>::type std::__invoke<:send_pingreq_to_all_connections std::shared_ptr boost::stream_socket_service> > >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> > const&>(Broker::send_pingreq_to_all_connections()::{lambda(auto:1&)#1}&&, (std::__invoke_result&&)...) (/root/src/cloud-connector/cloud-connector+0xec60b)
        #17 0x555555620763 in std::__detail::__variant::__gen_vtable_impl<:__detail::__variant::_multi_array std::variant boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::variant<mqtt> >, boost::io_service>, std::shared_ptr::tcp_endpoint<:asio::basic_stream_socket boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, 2ul> > > const&)>, std::tuple<:variant boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::variant<mqtt> >, boost::io_service>, std::shared_ptr::tcp_endpoint<:asio::basic_stream_socket boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, 2ul> > > const>, std::integer_sequence<unsigned long> >::__visit_invoke(Broker::send_pingreq_to_all_connections()::{lambda(auto:1&)#1}, std::variant<:shared_ptr boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::variant<mqtt> >, boost::io_service>, std::shared_ptr::tcp_endpoint<:asio::basic_stream_socket boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, 2ul> > > const) (/root/src/cloud-connector/cloud-connector+0xcc763)
        #18 0x555555620885 in decltype(auto) std::visit<:send_pingreq_to_all_connections std::variant boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::variant<mqtt> >, boost::io_service>, std::shared_ptr::tcp_endpoint<:asio::basic_stream_socket boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, 2ul> > > const&>(Broker::send_pingreq_to_all_connections()::{lambda(auto:1&)#1}&&, std::variant<:shared_ptr boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::variant<mqtt> >, boost::io_service>, std::shared_ptr::tcp_endpoint<:asio::basic_stream_socket boost::stream_socket_service> >, boost::io_service::strand>, std::mutex, 2ul> > > const&) (/root/src/cloud-connector/cloud-connector+0xcc885)
        #19 0x555555620a42 in Broker::send_pingreq_to_all_connections() (/root/src/cloud-connector/cloud-connector+0xcca42)
        #20 0x5555555cbb0d in operator() /home/jonesmz/meshpp_frameworks/src/cloud-connector/main.cpp:1454
        #21 0x5555555d1e94 in operator() /home/jonesmz/meshpp_frameworks/inc/meshpp/asio/periodic_timer.h:46
        #22 0x5555555ddaf5 in operator() /usr/include/boost/asio/detail/bind_handler.hpp:47
        #23 0x5555555dd8aa in asio_handler_invoke<:asio::detail::binder1 time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code>, boost::system::error_code> > /usr/include/boost/asio/handler_invoke_hook.hpp:69
        #24 0x5555555dd446 in invoke<:asio::detail::binder1 time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code>, boost::system::error_code>, meshpp::asio::PeriodicTimer<func_t time_t>::do_steady_timer() [with FUNC_T = main(int, char**)::<lambda>; TIME_T = boost::posix_time::ptime]::<lambda boost::system::error_code> > /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
        #25 0x5555555dce84 in do_complete /usr/include/boost/asio/detail/wait_handler.hpp:70
        #26 0x5555555e7fb7 in boost::asio::detail::task_io_service_operation::complete(boost::asio::detail::task_io_service&, boost::system::error_code const&, unsigned long) (/root/src/cloud-connector/cloud-connector+0x93fb7)
        #27 0x5555555f033d in boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<:asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&) (/root/src/cloud-connector/cloud-connector+0x9c33d)
        #28 0x5555555ef60d in boost::asio::detail::task_io_service::run(boost::system::error_code&) (/root/src/cloud-connector/cloud-connector+0x9b60d)
        #29 0x5555555f093b in boost::asio::io_service::run() (/root/src/cloud-connector/cloud-connector+0x9c93b)
    
    previously allocated by thread T0 here:
        #0 0x7ffff6ef9b10 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xefb10)
        #1 0x5555556ec709 in __gnu_cxx::new_allocator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > >::allocate(unsigned long, void const*) (/root/src/cloud-connector/cloud-connector+0x198709)
        #2 0x5555556ac124 in boost::multi_index::multi_index_container<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::allocate_node() (/root/src/cloud-connector/cloud-connector+0x158124)
        #3 0x55555578f16c in std::pair<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*, bool> boost::multi_index::multi_index_container<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::emplace_hint_<:__cxx11::basic_string std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will> >(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will>&&) (/root/src/cloud-connector/cloud-connector+0x23b16c)
        #4 0x555555760558 in std::pair<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*, bool> boost::multi_index::detail::index_base<:session_state boost::multi_index::indexed_by mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >::final_emplace_hint_<:__cxx11::basic_string std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will> >(boost::multi_index::detail::ordered_index_node<:multi_index::detail::null_augment_policy boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > >*, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will>&&) (/root/src/cloud-connector/cloud-connector+0x20c558)
        #5 0x55555571f142 in boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > > boost::multi_index::detail::ordered_index_impl<:multi_index::member std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, std::less<:__cxx11::basic_string std::char_traits>, std::allocator<char> > >, boost::multi_index::detail::nth_layer<1, Broker::session_state, boost::multi_index::indexed_by<:multi_index::ordered_unique mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >, boost::mpl::v_item<:tag_client_id boost::mpl::vector0>, 0>, boost::multi_index::detail::ordered_unique_tag, boost::multi_index::detail::null_augment_policy>::emplace_hint_impl<:__cxx11::basic_string std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will> >(boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > >, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will>&&) (/root/src/cloud-connector/cloud-connector+0x1cb142)
        #6 0x5555556dd44b in boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > > boost::multi_index::detail::ordered_index_impl<:multi_index::member std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, std::less<:__cxx11::basic_string std::char_traits>, std::allocator<char> > >, boost::multi_index::detail::nth_layer<1, Broker::session_state, boost::multi_index::indexed_by<:multi_index::ordered_unique mpl_::na>, boost::multi_index::member<:session_state std::__cxx11::basic_string std::char_traits>, std::allocator<char> >, &Broker::session_state::client_id>, mpl_::na>, boost::multi_index::ordered_unique<:multi_index::tag mpl_::na>, boost::multi_index::member<:session_state std::variant boost::asio::stream_socket_service> >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> > >, &Broker::session_state::con>, mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<:session_state> >, boost::mpl::v_item<:tag_client_id boost::mpl::vector0>, 0>, boost::multi_index::detail::ordered_unique_tag, boost::multi_index::detail::null_augment_policy>::emplace_hint<:__cxx11::basic_string std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will> >(boost::multi_index::detail::bidir_node_iterator<:multi_index::detail::ordered_index_node boost::multi_index::detail::ordered_index_node boost::multi_index::detail::index_node_base std::allocator> > > > >, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::shared_ptr<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >&, std::optional<:will>&&) (/root/src/cloud-connector/cloud-connector+0x18944b)
        #7 0x555555698ddf in bool Broker::connect_handler<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&&, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >) (/root/src/cloud-connector/cloud-connector+0x144ddf)
        #8 0x55555565ada4 in Broker::handle_accept<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&)::{lambda(std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >)#4}::operator()(std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >) const (/root/src/cloud-connector/cloud-connector+0x106da4)
        #9 0x5555556dea50 in std::_Function_handler<bool std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >), Broker::handle_accept<:endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul> >(mqtt::endpoint<:tcp_endpoint boost::asio::stream_socket_service> > >, boost::asio::io_service::strand>, std::mutex, std::lock_guard, 2ul>&)::{lambda(std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >)#4}>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>&&, bool&&, unsigned short&&, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property in std::function std::char_traits>, std::allocator<char> > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:__cxx11::basic_string std::char_traits>, std::allocator<char> > > const&, std::optional<:will>, bool, unsigned short, std::vector<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available>, std::allocator<:variant mqtt::v5::property::message_expiry_interval mqtt::v5::property::content_type mqtt::v5::property::content_type_ref mqtt::v5::property::response_topic mqtt::v5::property::response_topic_ref mqtt::v5::property::correlation_data mqtt::v5::property::correlation_data_ref mqtt::v5::property::subscription_identifier mqtt::v5::property::session_expiry_interval mqtt::v5::property::assigned_client_identifier mqtt::v5::property::assigned_client_identifier_ref mqtt::v5::property::server_keep_alive mqtt::v5::property::authentication_method mqtt::v5::property::authentication_method_ref mqtt::v5::property::authentication_data mqtt::v5::property::authentication_data_ref mqtt::v5::property::request_problem_information mqtt::v5::property::will_delay_interval mqtt::v5::property::request_response_information mqtt::v5::property::response_information mqtt::v5::property::response_information_ref mqtt::v5::property::server_reference mqtt::v5::property::server_reference_ref mqtt::v5::property::reason_string mqtt::v5::property::reason_string_ref mqtt::v5::property::receive_maximum mqtt::v5::property::topic_alias_maximum mqtt::v5::property::topic_alias mqtt::v5::property::maximum_qos mqtt::v5::property::retain_available mqtt::v5::property::user_property mqtt::v5::property::user_property_ref mqtt::v5::property::maximum_packet_size mqtt::v5::property::wildcard_subscription_available mqtt::v5::property::subscription_identifier_available mqtt::v5::property::shared_subscription_available> > >)>::operator()(std::__cxx11::basic_string<char std::char_traits>, std::allocator</char></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></char></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></char></:tcp_endpoint></:endpoint></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></bool></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></char></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></char></:tcp_endpoint></:endpoint></:variant></:variant></:will></char></:__cxx11::basic_string></char></:__cxx11::basic_string></char></char></:tcp_endpoint></:endpoint></:will></:endpoint></char></char></:multi_index::detail::ordered_index_node></:will></:endpoint></char></:__cxx11::basic_string></:tag_client_id></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:multi_index::ordered_unique></char></:__cxx11::basic_string></char></:multi_index::member></:multi_index::detail::ordered_index_node></:will></:endpoint></char></char></:multi_index::detail::ordered_index_node></:will></:endpoint></char></:__cxx11::basic_string></:tag_client_id></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:multi_index::ordered_unique></char></:__cxx11::basic_string></char></:multi_index::member></:multi_index::detail::ordered_index_node></:will></:endpoint></char></char></:multi_index::detail::null_augment_policy></:will></:endpoint></char></:__cxx11::basic_string></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::ordered_index_node></:will></:endpoint></char></char></:multi_index::detail::null_augment_policy></:will></:endpoint></char></:__cxx11::basic_string></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::ordered_index_node></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::ordered_index_node></:asio::detail::posix_mutex></lambda></lambda></func_t></lambda></lambda></:asio::detail::binder1></lambda></lambda></:asio::detail::binder1></:asio::basic_stream_socket></mqtt></:shared_ptr></:asio::basic_stream_socket></mqtt></:send_pingreq_to_all_connections></:asio::basic_stream_socket></mqtt></:shared_ptr></unsigned></:asio::basic_stream_socket></mqtt></:variant></:asio::basic_stream_socket></mqtt></:__detail::__variant::_multi_array></:send_pingreq_to_all_connections></:send_pingreq_to_all_connections></:endpoint></void></:endpoint></:shared_ptr></:tcp_endpoint></:tcp_endpoint></:v5::pingreq_message></:tcp_endpoint></:tcp_endpoint></void></:tcp_endpoint></void></:tcp_endpoint></:endpoint></:tcp_endpoint></:endpoint></:multi_index::detail::ordered_index_node></:tag_con></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:multi_index::ordered_unique></:endpoint></:variant></:endpoint></:multi_index::member></:multi_index::detail::null_augment_policy></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::null_augment_policy></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::null_augment_policy></:session_state></:endpoint></:session_state></:multi_index::tag></char></:session_state></:session_state></:multi_index::detail::null_augment_policy></:multi_index::detail::ordered_index_node></:asio::detail::posix_mutex></lambda></lambda></func_t></lambda></lambda></:asio::detail::binder1></lambda></lambda></:asio::detail::binder1></:multi_index::detail::ordered_index_node></:multi_index::detail::null_augment_policy></:multi_index::detail::null_augment_policy></:multi_index::detail::null_augment_policy></:multi_index::detail::null_augment_policy>
    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    I'm testing backtrace using gdb with Boost.Pretty.Printers and gdb iternal? std pretty printers.

    cpp
    #include <variant>
    
    struct prop_1 {};
    struct prop_2 {};
    struct prop_3 {};
    struct prop_4 {};
    struct prop_5 {};
    
    #if 1
    
    using var = std::variant<int double char prop_1 prop_2 prop_3 prop_4 prop_5>;
    
    #else
    
    using var_elems = std::variant<int double char prop_1 prop_2 prop_3 prop_4 prop_5>;
    
    struct var : var_elems {
        using var_elems::var_elems;
    };
    
    #endif
    
    void foo(var v) {
        (void)v;
    }
    
    int main() {
        var v = 1;
        v = 23.4;
        foo(v);
    }
    </int></int></variant>

    Output of if 1

    
    (gdb) bt
    #0  foo (v=std::variant<int double char prop_1 prop_2 prop_3 prop_4 prop_5> [index 1] = {...}) at variant_compiler.cpp:25
    #1  0x0000555555555263 in main () at variant_compiler.cpp:30
    </int>

    Output of if 0

    
    (gdb) bt
    #0  foo (v=...) at variant_compiler.cpp:25
    #1  0x0000555555555206 in main () at variant_compiler.cpp:30
    

    The backtrace becomes simple. But type information is lost. However I can get back the type information as follows:

    
    (gdb) p v
    $1 = {
      <:variant double char prop_1 prop_2 prop_3 prop_4 prop_5>> = std::variant<int double char prop_1 prop_2 prop_3 prop_4 prop_5> [index 1] = {23.399999999999999}, <no da ta fields>}
    </no></int></:variant>

    It is OK.

    I think that the following part is not good. It avoids

    cpp
        using Base_t::operator=;
    
    cpp
    mqtt_property_varient v  = ...;
    v = ...; // error
    

    I think that following approach is better:

    cpp
    using mqtt_property_variant_base  = mqtt::varient<list of properties here...>
    struct mqtt_property_varient : public mqtt_property_variant_base 
    {
        using mqtt_property_variant_base::mqtt_property_variant_base ;
        mqtt_property_varient(mqtt_property_varient const&) = default;
        mqtt_property_varient(mqtt_property_varient&&) = default;
        mqtt_property_varient& operator=(mqtt_property_varient const&) = default;
        mqtt_property_varient& operator=(mqtt_property_varient&&) = default;
    };
    </list>

    `

    What do you think?

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Your approach looks fine to me!

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    I wrote the fix and sent #310. But it doesn't compiled with std::variant.

    https://en.cppreference.com/w/cpp/utility/variant

    It seems that std::variant has some helper class templates such as std::variant_size.

    https://en.cppreference.com/w/cpp/utility/variant/variant_size

    I got the error the specialization of std::variant_size for mqtt::v5::property_variant is undefined.

    The template is specialized to std::variant<Types...> but not inherited class such as mqtt::v5::property_variant.

    So I add the following specialization:

    cpp
    namespace std {
        template <> struct variant_size<:v5::property_variant> : variant_size<:v5::property_variant_elem> {};
    }
    </:v5::property_variant_elem></:v5::property_variant>

    But I got similar undefined error for internal implementation class templates.

    I did the following test:

    cpp
    namespace std {
        template <> struct variant_size<:v5::property_variant> : std::integral_constant<:size_t> {};
    }
    </:size_t></:v5::property_variant>

    But I got the same error. That means I don't make a mistake about base classes of variant_size.

    Now, I stuck.

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    Here is the log https://travis-ci.org/redboltz/mqtt_cpp/jobs/552309332#L1064

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    The minimal example code that reproduces the issue:

    https://wandbox.org/permlink/sOPNNreoAWkr8pZ0

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    Here is my quick check result:

    |variant impl|result| |---|---| |boost|ok| |libc++|ok| |libstdc++|ng|

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    https://stackoverflow.com/questions/51309467/using-stdvisit-on-a-class-inheriting-from-stdvariant-libstdc-vs-libc

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90943

    https://wg21.link/LWG3052 would forbid us from supporting this.

    I don't understand why it forbids the support.

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Hrmm. Based on the discussion in the stack overflow post, and the GCC bug report, I don't think this is something that we can resolve.

    Maybe we need to wait for C++20 to be finalized before we can have an answer for future versions of the standard, but I'm skeptical that we'll be able to do anything about this with C++14 / C++17.

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    Now that mqtt_cpp is using MQTT_NS::buffer to store all of the items in the properties, maybe we can revisit this discussion.

    What do you think about doing just-in-time parsing?

    When the packet is received, we can store the data for the properties in an MQTT_NS::buffer the same way we currently do.

    That MQTT_NS::buffer can be owned by an MQTT_NS::property_cursor object (In this situation, when I say cursor i mean the word in the same sense that some database engines use it. As a handle to data that will be fetched and/or parsed on demand, but until the parsing is triggered, the data is in an unspecified state).

    The MQTT_NS::property_cursor object provides functions like:

    cpp
    struct property_cursor
    {
        std::vector<optional>> parse_all_properties() { ... };
        optional<:property_varient> parse_next() { ... };
        struct iterator
        {
            // Some implementation that parses the property data only when the value is accessed.
        };
        iterator begin();
        iterator end();
        buffer data_;
    }
    </:property_varient></optional>

    This allows us to completely avoid needing to allocate storage space for the std::vector object.

    For the test_broker, it also means that the broker never needs to parse the properties for publish messages, and can just send them to the subscribers directly. No deserialization / parsing, but also no serialization. Just moving blobs of data around (Much more efficient!!)

    It also means that code that uses mqtt_cpp can decide if they want to parse the properties or not, on their own.

    For example: I have several MQTTv5 messages that do transmit properties (because all of my message send the same list of properties, always), but the code that receives the properties never use them. Right now, mqtt_cpp is parsing the properties, and allocating a std::vector, even though I don't want it to, and don't use the result.

    It also means that I would be able to do something like this (note, c++17 syntax, but can achieve the same result in C++14, too):

    cpp
    v5::property_cursor cursor(data from boost::asio);
    std::optional<:correlation_data> corrData;
    for(auto property : cursor)
    {
        corrData = std::visit[](auto & prop) -> std::optional<:correlation_data>
        {
            if constexpr(std::is_same_v<decltype v5::correlation_data>)
            { return prop; }
            else
            { return std::nullopt(); }
        }
        if(corrData)
        {
            // We're only looking for one specific property. Exit early.
            break;
        }
    }
    </decltype></:correlation_data></:correlation_data>

    In the above code, parsing only happens when the property is evaluated, or the iterator is dereferenced (and returns std::nullopt, if it can't be parsed, to indicate failure).

    If I'm only interested in a specific property, I don't need to pay the runtime cost of 1) Allocating storage for std::vector, or 2) Parsing all properties. I only have to pay for parsing the properties until I find the one I want.

    And, of course, it also means that the debug function signatures is much much smaller.

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    I'm not sure if you saw this, did you have any thoughts on it?

    点赞 评论 复制链接分享
  • weixin_39777875 weixin_39777875 4月前

    , sorry I looked over https://github.com/redboltz/mqtt_cpp/issues/297#issuecomment-527242751. Is it for debugging experience? It seems that different improvement idea from debugging.

    I will create new issue for that.

    点赞 评论 复制链接分享
  • weixin_39636102 weixin_39636102 4月前

    It's for 1) Smaller function signatures (e.g., no mqtt::variant needed as parameter in most functions) 2) Less allocations -- potentially faster code

    Ok, we can discuss in new issue.

    点赞 评论 复制链接分享

相关推荐