AudioRtpSession nullptr exception (seems a multi-thread issue)
Scenario
None, it was on a auto-answer device
Backtrace
#0 0x00007fffe8d9ad54 in jami::MediaDecoder::getStream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) const
(this=0x0, name="a:remote") at media/media_decoder.cpp:832
#1 0x00007fffe8de95a1 in jami::AudioReceiveThread::getInfo() const (this=0x619000be3280) at ./media/audio/audio_receive_thread.cpp:137
#2 0x00007fffe8dece71 in jami::AudioRtpSession::deinitRecorder(std::shared_ptr<jami::MediaRecorder>&)
(this=0x61c000bb4090, rec=std::shared_ptr<jami::MediaRecorder> (use count 1, weak count 1) = {...}) at ./media/audio/audio_rtp_session.cpp:357
#3 0x00007fffe8eced41 in jami::SIPCall::deinitRecorder() (this=0x61a000f6de90) at ./sip/sipcall.cpp:3210
#4 0x00007fffe8ec93be in jami::SIPCall::stopAllMedia() (this=0x61a000f6de90) at ./sip/sipcall.cpp:2221
#5 0x00007fffe8ebfbc0 in operator()(pjsip_transport_state, pjsip_transport_state_info const*) const
(__closure=0x602000346db0, state=PJSIP_TP_STATE_DISCONNECTED) at ./sip/sipcall.cpp:496
#6 0x00007fffe8ed70da in std::__invoke_impl<void, jami::SIPCall::setSipTransport(const std::shared_ptr<jami::SipTransport>&, const std::string&)::<lambda(pjsip_transport_state, const pjsip_transport_state_info*)>&, pjsip_transport_state, const pjsip_transport_state_info*>(std::__invoke_other, struct {...} &)
(__f=...) at /usr/include/c++/12/bits/invoke.h:61
#7 0x00007fffe8ed55b1 in std::__invoke_r<void, jami::SIPCall::setSipTransport(const std::shared_ptr<jami::SipTransport>&, const std::string&)::<lambda(pjsip_transport_state, const pjsip_transport_state_info*)>&, pjsip_transport_state, const pjsip_transport_state_info*>(struct {...} &) (__fn=...)
at /usr/include/c++/12/bits/invoke.h:111
#8 0x00007fffe8ed3c71 in std::_Function_handler<void(pjsip_transport_state, const pjsip_transport_state_info*), jami::SIPCall::setSipTransport(const std::shared_ptr<jami::SipTransport>&, const std::string&)::<lambda(pjsip_transport_state, const pjsip_transport_state_info*)> >::_M_invoke(const std::_Any_data &, pjsip_transport_state &&, const pjsip_transport_state_info *&&)
(__functor=..., __args#0=@0x7fff01d8ded4: PJSIP_TP_STATE_DISCONNECTED, __args#1=@0x7fff01d8dec8: 0x7fff01d8e110)
at /usr/include/c++/12/bits/std_function.h:290
#9 0x00007fffe8efb830 in std::function<void (pjsip_transport_state, pjsip_transport_state_info const*)>::operator()(pjsip_transport_state, pjsip_transport_state_info const*) const (this=0x603000c74800, __args#0=PJSIP_TP_STATE_DISCONNECTED, __args#1=0x7fff01d8e110) at /usr/include/c++/12/bits/std_function.h:591
#10 0x00007fffe8ef853b in jami::SipTransport::stateCallback(pjsip_transport_state, pjsip_transport_state_info const*)
(this=0x611000a27dd0, state=PJSIP_TP_STATE_DISCONNECTED, info=0x7fff01d8e110) at ./sip/siptransport.cpp:155
#11 0x00007fffe8ef8b20 in jami::SipTransportBroker::transportStateChanged(pjsip_transport*, pjsip_transport_state, pjsip_transport_state_info const*)
(this=0x60e00014fa20, tp=0x62501149f170, state=PJSIP_TP_STATE_DISCONNECTED, info=0x7fff01d8e110) at ./sip/siptransport.cpp:243
#12 0x00007fffe8ee9bdc in jami::tp_state_callback(pjsip_transport*, pjsip_transport_state, pjsip_transport_state_info const*)
(tp=0x62501149f170, state=PJSIP_TP_STATE_DISCONNECTED, info=0x7fff01d8e110) at ./sip/sipvoiplink.cpp:587
#13 0x00007fffe8c4178b in operator()() const (__closure=0x61200039fde0) at jamidht/channeled_transport.cpp:190
#14 0x00007fffe8c42c44 in std::__invoke_impl<void, jami::tls::ChanneledSIPTransport::start()::<lambda()>&>(std::__invoke_other, struct {...} &) (__f=...)
at /usr/include/c++/12/bits/invoke.h:61
#15 0x00007fffe8c4278c in std::__invoke_r<void, jami::tls::ChanneledSIPTransport::start()::<lambda()>&>(struct {...} &) (__fn=...)
at /usr/include/c++/12/bits/invoke.h:111
#16 0x00007fffe8c422e6 in std::_Function_handler<void(), jami::tls::ChanneledSIPTransport::start()::<lambda()> >::_M_invoke(const std::_Any_data &)
(__functor=...) at /usr/include/c++/12/bits/std_function.h:290
#17 0x00007fffe89c0b70 in std::function<void ()>::operator()() const (this=0x61200039fde0) at /usr/include/c++/12/bits/std_function.h:591
#18 0x00007fffe8b5db5f in jami::ChannelSocket::stop() (this=0x603001bc32c0) at connectivity/multiplexed_socket.cpp:1055
#19 0x00007fffe8b62295 in jami::MultiplexedSocket::Impl::clearSockets() (this=0x61700070ba00) at connectivity/multiplexed_socket.cpp:103
#20 0x00007fffe8b62401 in jami::MultiplexedSocket::Impl::shutdown() (this=0x61700070ba00) at connectivity/multiplexed_socket.cpp:121
#21 0x00007fffe8b5967f in jami::MultiplexedSocket::Impl::eventLoop() (this=0x61700070ba00) at connectivity/multiplexed_socket.cpp:242
#22 0x00007fffe8b61b9f in jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}::operator()() const (__closure=0x602001332118) at connectivity/multiplexed_socket.cpp:68
#23 0x00007fffe8b6f766 in std::__invoke_impl<void, jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}>(std::__invoke_other, jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}&&) (__f=...)
at /usr/include/c++/12/bits/invoke.h:61
#24 0x00007fffe8b6f729 in std::__invoke<jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}>(jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}&&) (__fn=...)
at /usr/include/c++/12/bits/invoke.h:96
#25 0x00007fffe8b6f6d6 in std::thread::_Invoker<std::tuple<jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x602001332118)
at /usr/include/c++/12/bits/std_thread.h:252
#26 0x00007fffe8b6f688 in std::thread::_Invoker<std::tuple<jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}> >::operator()() (this=0x602001332118)
at /usr/include/c++/12/bits/std_thread.h:259
#27 0x00007fffe8b6f632 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<jami::MultiplexedSocket::Impl::Impl(jami::MultiplexedSocket&, dht::Hash<32ul> const&, std::unique_ptr<jami::TlsSocketEndpoint, std::default_delete<jami::TlsSocketEndpoint> >)::{lambda()#1}> > >::_M_run() (this=0x602001332110)
at /usr/include/c++/12/bits/std_thread.h:210
#28 0x00007fffe80dbb03 in execute_native_thread_routine () at /lib64/libstdc++.so.6
#29 0x00007fffe7c8cded in start_thread () at /lib64/libc.so.6
#30 0x00007fffe7d12370 in clone3 () at /lib64/libc.so.6
In: jami::AudioRtpSession::deinitRecorder(std::shared_ptr<jami::MediaRecorder>&)
receiveThread_ is nullptr, so it was de-allocated between line 356/357