jami-daemon issueshttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues2020-09-16T17:51:39Zhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/307heap use-after-free2020-09-16T17:51:39ZSébastien Blinheap use-after-free```
=================================================================
==2366477==ERROR: AddressSanitizer: heap-use-after-free on address 0x6130000b40c8 at pc 0x7f38b551857b bp 0x7f389e31eba0 sp 0x7f389e31eb90
READ of size 8 at 0x6130000b...```
=================================================================
==2366477==ERROR: AddressSanitizer: heap-use-after-free on address 0x6130000b40c8 at pc 0x7f38b551857b bp 0x7f389e31eba0 sp 0x7f389e31eb90
READ of size 8 at 0x6130000b40c8 thread T176
#0 0x7f38b551857a in jami::DhtPeerConnector::Impl::ClientConnector::process()::{lambda(jami::tls::TlsSessionState)#2}::operator()(jami::tls::TlsSessionState) const::{lambda(unsigned long const&, DRing::DataTransferEventCode const&)#2}::operator()(unsigned long const, DRing::DataTransferEventCode const) const /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:475
#1 0x7f38b5523a9a in std::_Function_handler<void (unsigned long const&, DRing::DataTransferEventCode const&), jami::DhtPeerConnector::Impl::ClientConnector::process()::{lambda(jami::tls::TlsSessionState)#2}::operator()(jami::tls::TlsSessionState) const::{lambda(unsigned long const&, DRing::DataTransferEventCode const&)#2}>::_M_invoke(std::_Any_data const&, unsigned long const&, DRing::DataTransferEventCode const&) /usr/include/c++/9/bits/std_function.h:300
#2 0x7f38b4f8ab32 in std::function<void (unsigned long const&, DRing::DataTransferEventCode const&)>::operator()(unsigned long const&, DRing::DataTransferEventCode const&) const /usr/include/c++/9/bits/std_function.h:688
#3 0x7f38b4f7dcbe in jami::SubOutgoingFileTransfer::emit(DRing::DataTransferEventCode) const /home/amarok/Projects/jami/daemon/src/data_transfer.cpp:468
#4 0x7f38b4f7c993 in jami::SubOutgoingFileTransfer::closeAndEmit(DRing::DataTransferEventCode) const /home/amarok/Projects/jami/daemon/src/data_transfer.cpp:400
#5 0x7f38b4f7c908 in jami::SubOutgoingFileTransfer::close() /home/amarok/Projects/jami/daemon/src/data_transfer.cpp:390
#6 0x7f38b4f7e562 in jami::OutgoingFileTransfer::close() /home/amarok/Projects/jami/daemon/src/data_transfer.cpp:573
#7 0x7f38b4f82b62 in jami::DataTransferFacade::close(unsigned long const&) /home/amarok/Projects/jami/daemon/src/data_transfer.cpp:916
#8 0x7f38b54fce1c in operator() /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:820
#9 0x7f38b55075af in _M_invoke /usr/include/c++/9/bits/std_function.h:300
#10 0x7f38b57c4335 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<dht::ThreadPool::run(std::function<void ()>&&)::{lambda()#1}> > >::_M_run() (/home/amarok/Projects/jami/daemon/src/.libs/libring.so.0+0x10a3335)
#11 0x7f38b3ae93d3 (/lib64/libstdc++.so.6+0xd73d3)
#12 0x7f38b41424e1 in start_thread (/lib64/libpthread.so.0+0x94e1)
#13 0x7f38b37ea6c2 in __GI___clone (/lib64/libc.so.6+0x1016c2)
0x6130000b40c8 is located 8 bytes inside of 344-byte region [0x6130000b40c0,0x6130000b4218)
freed by thread T176 here:
#0 0x7f38b6ebf175 in operator delete(void*, unsigned long) (/lib64/libasan.so.5+0x111175)
#1 0x7f38b55262ce in std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector>::operator()(jami::DhtPeerConnector::Impl::ClientConnector*) const /usr/include/c++/9/bits/unique_ptr.h:81
#2 0x7f38b551f6de in std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> >::~unique_ptr() /usr/include/c++/9/bits/unique_ptr.h:292
#3 0x7f38b553c193 in std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >::~pair() /usr/include/c++/9/bits/stl_pair.h:208
#4 0x7f38b553c1b3 in void __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::destroy<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >(std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >*) /usr/include/c++/9/ext/new_allocator.h:153
#5 0x7f38b5539de4 in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > > >::destroy<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >(std::allocator<std::_Rb_tree_node<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >&, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >*) /usr/include/c++/9/bits/alloc_traits.h:497
#6 0x7f38b553450a in std::_Rb_tree<std::pair<dht::Hash<20ul>, unsigned long>, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >, std::_Select1st<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >*) /usr/include/c++/9/bits/stl_tree.h:642
#7 0x7f38b5529d0c in std::_Rb_tree<std::pair<dht::Hash<20ul>, unsigned long>, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >, std::_Select1st<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >*) /usr/include/c++/9/bits/stl_tree.h:650
#8 0x7f38b55369d3 in std::_Rb_tree<std::pair<dht::Hash<20ul>, unsigned long>, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >, std::_Select1st<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >) /usr/include/c++/9/bits/stl_tree.h:2511
#9 0x7f38b552fcf5 in std::_Rb_tree<std::pair<dht::Hash<20ul>, unsigned long>, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >, std::_Select1st<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::_Rb_tree_const_iterator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >) /usr/include/c++/9/bits/stl_tree.h:2525
#10 0x7f38b552686c in std::_Rb_tree<std::pair<dht::Hash<20ul>, unsigned long>, std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > >, std::_Select1st<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::erase(std::pair<dht::Hash<20ul>, unsigned long> const&) /usr/include/c++/9/bits/stl_tree.h:2536
#11 0x7f38b551f842 in std::map<std::pair<dht::Hash<20ul>, unsigned long>, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> >, std::less<std::pair<dht::Hash<20ul>, unsigned long> >, std::allocator<std::pair<std::pair<dht::Hash<20ul>, unsigned long> const, std::unique_ptr<jami::DhtPeerConnector::Impl::ClientConnector, std::default_delete<jami::DhtPeerConnector::Impl::ClientConnector> > > > >::erase(std::pair<dht::Hash<20ul>, unsigned long> const&) /usr/include/c++/9/bits/stl_map.h:1068
#12 0x7f38b54fcc3b in operator() /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:809
#13 0x7f38b55075af in _M_invoke /usr/include/c++/9/bits/std_function.h:300
#14 0x7f38b57c4335 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<dht::ThreadPool::run(std::function<void ()>&&)::{lambda()#1}> > >::_M_run() (/home/amarok/Projects/jami/daemon/src/.libs/libring.so.0+0x10a3335)
#15 0x7f38b52c0877 in dht::Hash<20ul>::to_c_str() const /home/amarok/Projects/jami/daemon/contrib/x86_64-redhat-linux/include/opendht/infohash.h:367
previously allocated by thread T183 here:
#0 0x7f38b6ebda97 in operator new(unsigned long) (/lib64/libasan.so.5+0x10fa97)
#1 0x7f38b551f5e3 in std::_MakeUniq<jami::DhtPeerConnector::Impl::ClientConnector>::__single_object std::make_unique<jami::DhtPeerConnector::Impl::ClientConnector, jami::DhtPeerConnector::Impl&, unsigned long const&, dht::Hash<20ul> const&, std::shared_ptr<dht::crypto::Certificate> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<void (jami::PeerConnection*)> const&>(jami::DhtPeerConnector::Impl&, unsigned long const&, dht::Hash<20ul> const&, std::shared_ptr<dht::crypto::Certificate> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<void (jami::PeerConnection*)> const&) /usr/include/c++/9/bits/unique_ptr.h:857
#2 0x7f38b54fc8c1 in jami::DhtPeerConnector::Impl::onAddDevice(dht::Hash<20ul> const&, unsigned long const&, std::shared_ptr<dht::crypto::Certificate> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<void (jami::PeerConnection*)> const&) /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:788
#3 0x7f38b54ffd9c in operator() /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:1016
#4 0x7f38b5508d45 in _M_invoke /usr/include/c++/9/bits/std_function.h:300
#5 0x7f38b559288c in std::function<void (std::shared_ptr<dht::crypto::Certificate> const&)>::operator()(std::shared_ptr<dht::crypto::Certificate> const&) const /usr/include/c++/9/bits/std_function.h:688
#6 0x7f38b558250e in jami::AccountManager::findCertificate(dht::Hash<20ul> const&, std::function<void (std::shared_ptr<dht::crypto::Certificate> const&)>&&) /home/amarok/Projects/jami/daemon/src/jamidht/account_manager.cpp:430
#7 0x7f38b537dd77 in jami::JamiAccount::findCertificate(dht::Hash<20ul> const&, std::function<void (std::shared_ptr<dht::crypto::Certificate> const&)>&&) /home/amarok/Projects/jami/daemon/src/jamidht/jamiaccount.cpp:2586
#8 0x7f38b55007e2 in operator() /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:1013
#9 0x7f38b5508ff5 in _M_invoke /usr/include/c++/9/bits/std_function.h:300
#10 0x7f38b55934ea in std::function<void (dht::Hash<20ul> const&)>::operator()(dht::Hash<20ul> const&) const /usr/include/c++/9/bits/std_function.h:688
#11 0x7f38b5585118 in operator() /home/amarok/Projects/jami/daemon/src/jamidht/account_manager.cpp:559
#12 0x7f38b5588d4c in _M_invoke /usr/include/c++/9/bits/std_function.h:285
#13 0x7f38b5595cc6 in std::function<bool (jami::DeviceAnnouncement&&)>::operator()(jami::DeviceAnnouncement&&) const /usr/include/c++/9/bits/std_function.h:688
#14 0x7f38b559378e in dht::DhtRunner::get<jami::DeviceAnnouncement>(dht::Hash<20ul>, std::function<bool (jami::DeviceAnnouncement&&)>, std::function<void (bool)>)::{lambda(std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&)#1}::operator()(std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&) const /home/amarok/Projects/jami/daemon/contrib/x86_64-redhat-linux/include/opendht/dhtrunner.h:112
#15 0x7f38b559a684 in std::_Function_handler<bool (std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&), dht::DhtRunner::get<jami::DeviceAnnouncement>(dht::Hash<20ul>, std::function<bool (jami::DeviceAnnouncement&&)>, std::function<void (bool)>)::{lambda(std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&)#1}>::_M_invoke(std::_Any_data const&, std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&) /usr/include/c++/9/bits/std_function.h:285
#16 0x7f38b58788e6 in std::_Function_handler<bool (std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&), dht::SecureDht::getCallbackFilter(std::function<bool (std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&)> const&, dht::Value::Filter&&)::{lambda(std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&)#1}>::_M_invoke(std::_Any_data const&, std::vector<std::shared_ptr<dht::Value>, std::allocator<std::shared_ptr<dht::Value> > > const&) (/home/amarok/Projects/jami/daemon/src/.libs/libring.so.0+0x11578e6)
Thread T176 created by T0 here:
#0 0x7f38b6de8955 in pthread_create (/lib64/libasan.so.5+0x3a955)
#1 0x7f38b3ae9698 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xd7698)
Thread T183 created by T1 here:
#0 0x7f38b6de8955 in pthread_create (/lib64/libasan.so.5+0x3a955)
#1 0x7f38b3ae9698 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xd7698)
Thread T1 created by T0 here:
#0 0x7f38b6de8955 in pthread_create (/lib64/libasan.so.5+0x3a955)
#1 0x7f38b3ae9698 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xd7698)
#2 0x7f38b4fa185c in jami::ScheduledExecutor::ScheduledExecutor() /home/amarok/Projects/jami/daemon/src/scheduled_executor.cpp:29
#3 0x7f38b4e2225e in jami::Manager::ManagerPimpl::ManagerPimpl(jami::Manager&) /home/amarok/Projects/jami/daemon/src/manager.cpp:443
#4 0x7f38b4e253d7 in jami::Manager::Manager() /home/amarok/Projects/jami/daemon/src/manager.cpp:720
#5 0x7f38b4e251a3 in jami::Manager::instance() /home/amarok/Projects/jami/daemon/src/manager.cpp:695
#6 0x7f38b4f399c0 in DRing::init(DRing::InitFlag) /home/amarok/Projects/jami/daemon/src/ring_api.cpp:57
#7 0x44c5e3 in DBusClient::initLibrary(int) /home/amarok/Projects/jami/daemon/bin/dbus/dbusclient.cpp:245
#8 0x441104 in DBusClient::DBusClient(int, bool) /home/amarok/Projects/jami/daemon/bin/dbus/dbusclient.cpp:108
#9 0x440895 in void __gnu_cxx::new_allocator<DBusClient>::construct<DBusClient, int&, bool&>(DBusClient*, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x440895)
#10 0x440675 in void std::allocator_traits<std::allocator<DBusClient> >::construct<DBusClient, int&, bool&>(std::allocator<DBusClient>&, DBusClient*, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x440675)
#11 0x44030c in std::_Sp_counted_ptr_inplace<DBusClient, std::allocator<DBusClient>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<int&, bool&>(std::allocator<DBusClient>, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x44030c)
#12 0x43fda3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<DBusClient, std::allocator<DBusClient>, int&, bool&>(DBusClient*&, std::_Sp_alloc_shared_tag<std::allocator<DBusClient> >, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x43fda3)
#13 0x43f989 in std::__shared_ptr<DBusClient, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<DBusClient>, int&, bool&>(std::_Sp_alloc_shared_tag<std::allocator<DBusClient> >, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x43f989)
#14 0x43efd5 in std::shared_ptr<DBusClient>::shared_ptr<std::allocator<DBusClient>, int&, bool&>(std::_Sp_alloc_shared_tag<std::allocator<DBusClient> >, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x43efd5)
#15 0x43e6c6 in std::shared_ptr<DBusClient> std::allocate_shared<DBusClient, std::allocator<DBusClient>, int&, bool&>(std::allocator<DBusClient> const&, int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x43e6c6)
#16 0x43de28 in std::shared_ptr<DBusClient> std::make_shared<DBusClient, int&, bool&>(int&, bool&) (/home/amarok/Projects/jami/daemon/bin/.libs/lt-dring+0x43de28)
#17 0x43cda1 in main /home/amarok/Projects/jami/daemon/bin/main.cpp:218
#18 0x7f38b37101a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
SUMMARY: AddressSanitizer: heap-use-after-free /home/amarok/Projects/jami/daemon/src/jamidht/p2p.cpp:475 in jami::DhtPeerConnector::Impl::ClientConnector::process()::{lambda(jami::tls::TlsSessionState)#2}::operator()(jami::tls::TlsSessionState) const::{lambda(unsigned long const&, DRing::DataTransferEventCode const&)#2}::operator()(unsigned long const, DRing::DataTransferEventCode const) const
Shadow bytes around the buggy address:
0x0c268000e7c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c268000e7d0: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c268000e7e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c268000e7f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c268000e800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c268000e810: fa fa fa fa fa fa fa fa fd[fd]fd fd fd fd fd fd
0x0c268000e820: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c268000e830: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c268000e840: fd fd fd fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c268000e850: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c268000e860: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==2366477==ABORTING
```Itération 21Sébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/305Swarm: remove conversation2021-06-12T11:37:12ZSébastien BlinSwarm: remove conversationImplement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-conversationImplement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-conversationSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/302Swarm: Get conversations requests & sync2021-06-12T11:37:24ZSébastien BlinSwarm: Get conversations requests & synccf https://review.jami.net/c/ring-daemon/+/15748 and https://git.jami.net/savoirfairelinux/ring-project/wikis/technical/6.2.-Sync-Protocolcf https://review.jami.net/c/ring-daemon/+/15748 and https://git.jami.net/savoirfairelinux/ring-project/wikis/technical/6.2.-Sync-ProtocolSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/301No relay (Turn) candidate in SDP with IOS when being connected in LTE/4G2021-02-17T16:19:15ZCyrille BéraudNo relay (Turn) candidate in SDP with IOS when being connected in LTE/4GSee attached file for log (with an Android comparison)[sdpios-andoid.log](/uploads/891e408417fd3059abed50184563f396/sdpios-andoid.log)
To reproduce:
Be connected on LTE/4G, make a call.
btw, why all the addresses are twice as candidate?See attached file for log (with an Android comparison)[sdpios-andoid.log](/uploads/891e408417fd3059abed50184563f396/sdpios-andoid.log)
To reproduce:
Be connected on LTE/4G, make a call.
btw, why all the addresses are twice as candidate?BacklogMohamed ChibaniKateryna KostiukSébastien BlinMohamed Chibanihttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/299Swarm: remove a user from the conversation2021-04-19T13:28:58ZSébastien BlinSwarm: remove a user from the conversation+ Implement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-device-from-a-conversation
+ Add tests+ Implement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-device-from-a-conversation
+ Add testsSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/298Swarm: Remove a device from the conversation2022-07-13T17:35:28ZSébastien BlinSwarm: Remove a device from the conversation+ Implement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-device-from-a-conversation
+ Add tests+ Implement https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#remove-a-device-from-a-conversation
+ Add testsSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/297Swarm: implement DRT (after first version)2023-04-28T19:42:53ZSébastien BlinSwarm: implement DRT (after first version)https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#drt-name-will-change
# In progress
+ add tests for mobile DRT
+ Client: remove limit of 8 participants
+ Test in real environment
# TODO:
+ D...https://git.jami.net/savoirfairelinux/ring-project/wikis/Group-chat-feature-(design-draft)#drt-name-will-change
# In progress
+ add tests for mobile DRT
+ Client: remove limit of 8 participants
+ Test in real environment
# TODO:
+ Debug last locks
+ Cleanup code
+ Finish last tests
+ Document on docs.jami.netSwarm-chatSébastien BlinFadi ShehadehSébastien Blin2023-02-28https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/296Swarm: see for file transfers (NEEDS DESIGN)2021-06-12T11:37:07ZSébastien BlinSwarm: see for file transfers (NEEDS DESIGN)Swarm-chatSébastien BlinAdrien BéraudSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/295Swarm: add a test for sending a message to multiple participants at once2021-06-12T11:37:27ZSébastien BlinSwarm: add a test for sending a message to multiple participants at onceScenario:
Alice creates a conversation with 8 members
Then sends a messages
All devices should receives the whole conversationScenario:
Alice creates a conversation with 8 members
Then sends a messages
All devices should receives the whole conversationSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/294Swarm: default branch should not be "master" but "main"2021-02-19T17:12:18ZSébastien BlinSwarm: default branch should not be "master" but "main"Swarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/293Swarm: multi-device management2020-09-18T19:50:25ZSébastien BlinSwarm: multi-device managementhttps://git.jami.net/savoirfairelinux/ring-project/wikis/technical/6.2.-Sync-Protocol
Related patch: https://review.jami.net/c/ring-daemon/+/15584https://git.jami.net/savoirfairelinux/ring-project/wikis/technical/6.2.-Sync-Protocol
Related patch: https://review.jami.net/c/ring-daemon/+/15584Swarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/292Swarm: Fix build on jenkins2020-12-23T19:37:25ZSébastien BlinSwarm: Fix build on jenkinsPatches are not building for nowPatches are not building for nowSwarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/291Swarm: redo code for gitserver2021-04-19T14:20:32ZSébastien BlinSwarm: redo code for gitserverThis commit is ugly
# TODO
+ [x] Remove ioPool and only use callbacks
+ [x] Support shutdown
+ [ ] Multiple want and improve negotiation
+ [ ] Recheck answerToWantOrder();
+ [ ] Support depth request (https://github.com/git/git/blo...This commit is ugly
# TODO
+ [x] Remove ioPool and only use callbacks
+ [x] Support shutdown
+ [ ] Multiple want and improve negotiation
+ [ ] Recheck answerToWantOrder();
+ [ ] Support depth request (https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt#L256)Swarm-chatSébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/288Connectivity: be more resilient if a TURN server is not available2021-12-29T21:18:42ZSébastien BlinConnectivity: be more resilient if a TURN server is not available# Reproduce steps
+ In the settings change the turn address to something that will not work but resolvable (ex: enconn.fr)
+ Try to do a call
# Expected results
+ The call should work as soon as possible with the TURN ignored
# Curre...# Reproduce steps
+ In the settings change the turn address to something that will not work but resolvable (ex: enconn.fr)
+ Try to do a call
# Expected results
+ The call should work as soon as possible with the TURN ignored
# Current result
+ The client try to connect to the TURN server for each ICE and result with a timeout of several seconds (~20 on linux) for each ICE negotiations making the call just unusable
# Why?
When making a call, the first step is to gather all candidates and send this message through the DHT (or direct p2p connection if available). But to gather the TURN candidate, pjsip needs to connect to it and ask for a new session. For TCP connections, the connect() will take a lot of time to timeout (depending on /proc/sys/net/ipv4/tcp_syn_retries), for UDP I didn't dig enough to fully understand what pjsip is waiting, but I think it's something related to that candidate allocation.
# Solutions
Several solutions can be created:
1. (pjsip specific) A new timer for TURN candidate creation can be created inside pjsip, to be able to ignore TURN candidates if it's taking too long. Because Jami is a real time communication app, if the allocation is taking more than 3 seconds, this means that we are taking too much time and it's not acceptable.
2. (system + pjsip specific) Manually set the connection timeout on the sockets. For TCP, we need to do a setsockopt on TCP_SYNCNT. 2 SYN retries is acceptable imho (that's about 3 seconds. First packet + 1 retry). A solution need to be created for platforms not supporting this op. For UDP as I didn't dig enough, I don't really know what's really blocking so this will need further investigation
3. (best solution imho) Support the RFC for Trickle ICE. I don't really like 1 or 2 because sometimes TURN can work and we will ignore that fact if it's taking too long. Trickle ICE will allow us to send candidates as soon as it's gathered. This means we will be able to send separately host candidates, UPnP, relays like TURN. This is clearly the solution that will take the more time to implement, but the best solution imho.
Note for 3: the drawback I see is that, because we will send candidates separately, this will generate multiple values on the DHT instead of one. Which is a bit bad.Backloghttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/285crash when canceling incoming file transfer2020-08-29T17:23:58ZAdrien Béraudcrash when canceling incoming file transferObserved on Android:
```
172 15458-15458/cx.ring I/AccountService: cancelDataTransfer() id=-8467903417826486931
173 15458-15660/cx.ring I/libdring: Channel down for incoming transfer with id(677444582472270729)
174 15458-15660/cx.ring D...Observed on Android:
```
172 15458-15458/cx.ring I/AccountService: cancelDataTransfer() id=-8467903417826486931
173 15458-15660/cx.ring I/libdring: Channel down for incoming transfer with id(677444582472270729)
174 15458-15660/cx.ring D/libdring: [FTP] file closed, rx 6684468 on 1084020092
175 15458-15553/cx.ring D/DaemonService: dataTransferEvent: transferId=-8467903417826486931, eventCode=7
175 15458-15553/cx.ring D/AccountService: Data Transfer TRANSFER_UNJOINABLE_PEER 7
--------- beginning of crash
175 15458-15546/cx.ring A/libc: FORTIFY: fwrite: null FILE*
175 15458-15553/cx.ring D/AccountService: Data Transfer 7 6684468/1084020092
177 15458-15546/cx.ring A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15546 (DRing), pid 15458 (cx.ring)
177 15458-15458/cx.ring D/DataTransferService: OnDestroy(), Service has been destroyed
181 15458-15553/cx.ring D/NotificationServiceImpl: handleDataTransferNotification, a data transfer event is in progress
182 15458-15553/cx.ring W/NotificationServiceImpl: showFileTransferNotification 616241383 TRANSFER_UNJOINABLE_PEER
242 15458-15791/cx.ring D/libdring: [ice:0x73afebb000] ioqueue error 120004: Interrupted system call
242 15922-15922/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
242 15458-15812/cx.ring D/libdring: [ice:0x73c4128800] ioqueue error 120004: Interrupted system call
252 15458-15557/cx.ring E/libdring: pjsip_endpt_handle_events failed with error Interrupted system call
262 1024-1024/? I//system/bin/tombstoned: received crash request for pid 15546
265 15922-15922/? I/crash_dump64: performing dump of process 15458 (target tid = 15546)
273 15922-15922/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
273 15922-15922/? A/DEBUG: Build fingerprint: 'google/coral/coral:10/QQ3A.200805.001/6578210:user/release-keys'
273 15922-15922/? A/DEBUG: Revision: 'MP1.0'
273 15922-15922/? A/DEBUG: ABI: 'arm64'
273 15922-15922/? A/DEBUG: Timestamp: 2020-08-27 13:55:13-0400
273 15922-15922/? A/DEBUG: pid: 15458, tid: 15546, name: DRing >>> cx.ring <<<
273 15922-15922/? A/DEBUG: uid: 10284
273 15922-15922/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
273 15922-15922/? A/DEBUG: Abort message: 'FORTIFY: fwrite: null FILE*'
273 15922-15922/? A/DEBUG: x0 0000000000000000 x1 0000000000003cba x2 0000000000000006 x3 00000074022e8ee0
273 15922-15922/? A/DEBUG: x4 0000008000808080 x5 0000008000808080 x6 0000008000808080 x7 0000000000000020
273 15922-15922/? A/DEBUG: x8 00000000000000f0 x9 5a1a961060fa0972 x10 0000000000000001 x11 0000000000000000
273 15922-15922/? A/DEBUG: x12 fffffff0fffffbdf x13 00000d3344b6f2df x14 000a3f5eb012a9fb x15 0000000006b36728
273 15922-15922/? A/DEBUG: x16 00000074f24088c0 x17 00000074f23e60c0 x18 00000074014ba000 x19 0000000000003c62
273 15922-15922/? A/DEBUG: x20 0000000000003cba x21 00000000ffffffff x22 00000074022e9750 x23 00000074022eb020
273 15922-15922/? A/DEBUG: x24 0000000000000008 x25 00000074022eb020 x26 000000745e5c54b0 x27 0000000000000002
273 15922-15922/? A/DEBUG: x28 00000074022e94e0 x29 00000074022e8f80
273 15922-15922/? A/DEBUG: sp 00000074022e8ec0 lr 00000074f239af48 pc 00000074f239af74
300 15922-15922/? A/DEBUG: backtrace:
300 15922-15922/? A/DEBUG: #00 pc 0000000000081f74 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 8de865099c99977483c8947f9b7937e9)
300 15922-15922/? A/DEBUG: #01 pc 00000000000a746c /apex/com.android.runtime/lib64/bionic/libc.so (__fortify_fatal(char const*, ...)+116) (BuildId: 8de865099c99977483c8947f9b7937e9)
300 15922-15922/? A/DEBUG: #02 pc 00000000000dd054 /apex/com.android.runtime/lib64/bionic/libc.so (fwrite+296) (BuildId: 8de865099c99977483c8947f9b7937e9)
300 15922-15922/? A/DEBUG: #03 pc 00000000004cca7c /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (std::__ndk1::basic_filebuf<char, std::__ndk1::char_traits<char>>::sync()+288)
300 15922-15922/? A/DEBUG: #04 pc 00000000004cc1f8 /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (std::__ndk1::basic_filebuf<char, std::__ndk1::char_traits<char>>::close()+100)
300 15922-15922/? A/DEBUG: #05 pc 00000000006d10fc /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (std::__ndk1::basic_ofstream<char, std::__ndk1::char_traits<char>>::close()+40)
300 15922-15922/? A/DEBUG: #06 pc 000000000076ac30 /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (jami::IncomingFileTransfer::close()+188)
300 15922-15922/? A/DEBUG: #07 pc 000000000076afbc /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (jami::DataTransferFacade::Impl::cancel(jami::DataTransfer&)+36)
300 15922-15922/? A/DEBUG: #08 pc 000000000076bfac /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (jami::DataTransferFacade::cancel(unsigned long const&)+140)
300 15922-15922/? A/DEBUG: #09 pc 0000000000396cb8 /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (DRing::cancelDataTransfer(unsigned long const&)+48)
300 15922-15922/? A/DEBUG: #10 pc 000000000035e714 /data/app/cx.ring-rfyP99rfYUYhO-o4pCexhw==/lib/arm64/libring.so (Java_cx_ring_daemon_RingserviceJNI_cancelDataTransfer+20)
368 850-2933/? I/WifiHAL: event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xa
```Itération 21Sébastien BlinSébastien Blinhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/281Rendez-vous: Incoming calls should not trigger any ringtone2020-08-22T17:36:38ZSébastien BlinRendez-vous: Incoming calls should not trigger any ringtoneBecause the rendez-vous automatically answer and the host should not know if a rendez-vous is used or not, ringtone should not be started for rendez-vous accounts.Because the rendez-vous automatically answer and the host should not know if a rendez-vous is used or not, ringtone should not be started for rendez-vous accounts.Itération 21Mohamed ChibaniMohamed Chibanihttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/280Video not freezing if call is on hold2020-08-18T23:16:13ZAline Gondim SantosVideo not freezing if call is on holdIf there's a call between A and B and A receives/does another call to C, B continues to see A's image. The video is not freezing.If there's a call between A and B and A receives/does another call to C, B continues to see A's image. The video is not freezing.Itération 21https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/279RendezVous: The host can hear the rendez vous even when detached2020-08-22T11:16:47ZSébastien BlinRendezVous: The host can hear the rendez vous even when detached# Reproduce steps
To determine, but it's the case after some rdv
# Current result
The host can hear the rendez vous even when detached
# Expected result
The host should not hear the rendez-vous# Reproduce steps
To determine, but it's the case after some rdv
# Current result
The host can hear the rendez vous even when detached
# Expected result
The host should not hear the rendez-vousItération 21Mohamed ChibaniMohamed Chibanihttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/276Unable to record a conference call2020-09-10T18:43:09ZCyrille BéraudUnable to record a conference callRecord stops as soon I add a participant to a conferenceRecord stops as soon I add a participant to a conferenceItération 21Pierre LespagnolMohamed ChibaniPierre Lespagnolhttps://git.jami.net/savoirfairelinux/jami-daemon/-/issues/242Video encoding - Dynamically change the resolution of the encoded frames2022-01-18T22:20:21ZMohamed ChibaniVideo encoding - Dynamically change the resolution of the encoded framesBacklogMohamed ChibaniMohamed Chibani