Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the git branch main hash 9afced7 crash #5677

Closed
lindianfeng opened this issue Jun 28, 2023 · 55 comments
Closed

the git branch main hash 9afced7 crash #5677

lindianfeng opened this issue Jun 28, 2023 · 55 comments

Comments

@lindianfeng
Copy link

What is the issue?

image

Which application of Transmission?

None

Which version of Transmission?

No response

@lindianfeng
Copy link
Author

Which application of Transmission?

@lindianfeng lindianfeng changed the title the git branch main hash 9afced725ad8226ab6213b8d96d52aefd3f78417 cre the git branch main hash 9afced725ad8226ab6213b8d96d52aefd3f78417 crash Jun 28, 2023
@lindianfeng
Copy link
Author

OS:debain 12

Transmission Version: main-dev

@tearfur
Copy link
Member

tearfur commented Jun 29, 2023

What caused the crash? Is it SEGV?

@lindianfeng
Copy link
Author

lindianfeng commented Jun 29, 2023

int frame 2
the var manager address is a invalid value

@lindianfeng
Copy link
Author

What caused the crash? Is it SEGV?

yes,it is the SEGV

@tearfur
Copy link
Member

tearfur commented Jun 29, 2023

What was Transmission doing when it crashed? Was it just starting up or shutting down?

@lindianfeng
Copy link
Author

What was Transmission doing when it crashed? Was it just starting up or shutting down?

It was not starting or shutting down,it was seeding

@tearfur
Copy link
Member

tearfur commented Jun 29, 2023

That does not make sense to me... manager only gets destroyed during shutdown, so it should not trigger a segfault after Transmsision went well into operation...

I wonder if something else wrote to manager's memory address.

@lindianfeng
Copy link
Author

This crash only occurs in the main branch, but not in the 4.0.3 branch. I try to start it with valgrind to see if there is a memory out of bounds. I will post the results here when I make progress, thank you

@lindianfeng
Copy link
Author

==15059== Warning: set address range perms: large range [0x664be028, 0x7f523858) (noaccess)
==15059== Invalid read of size 4
==15059== at 0x2D4467: state (handshake.h:160)
==15059== by 0x2D4467: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:695)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x9b077c0 is 368 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 1
==15059== at 0x2D262E: set_have_read_anything_from_peer (handshake.h:144)
==15059== by 0x2D262E: tr_handshake::read_handshake(tr_peerIo*) (handshake.cc:341)
==15059== by 0x2D4626: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:698)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== Address 0x9b077d6 is 390 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x2D2679: is_incoming (peer-io.h:255)
==15059== by 0x2D2679: is_incoming (handshake.h:155)
==15059== by 0x2D2679: tr_handshake::read_handshake(tr_peerIo*) (handshake.cc:353)
==15059== by 0x2D4626: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:698)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== Address 0x9b077a0 is 336 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 4
==15059== at 0x2D2A0A: set_state (handshake.h:170)
==15059== by 0x2D2A0A: tr_handshake::read_handshake(tr_peerIo*) (handshake.cc:356)
==15059== by 0x2D4626: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:698)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== Address 0x9b077c0 is 368 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 4
==15059== at 0x2D44C4: is_state (handshake.h:165)
==15059== by 0x2D44C4: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:760)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x9b077c0 is 368 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 1
==15059== at 0x259D50: auto (anonymous namespace)::wi::import_bits<math::wide_integer::uintwide_t<160u, unsigned int, void, false> >(std::array<std::byte, math::wide_integer::uintwide_t<160u, unsigned int, void, false>::my_width2/std::numeric_limits::digits> const&) (peer-mse.cc:35)
==15059== by 0x25A682: tr_message_stream_encryption::DH::setPeerPublicKey(std::array<std::byte, 96ul> const&) (peer-mse.cc:99)
==15059== by 0x2D3CFB: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:456)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07691 is 65 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x259DF1: auto (anonymous namespace)::wi::export_bits<math::wide_integer::uintwide_t<768u, unsigned int, void, false> >(math::wide_integer::uintwide_t<768u, unsigned int, void, false>) (peer-mse.cc:47)
==15059== by 0x25A7C8: tr_message_stream_encryption::DH::setPeerPublicKey(std::array<std::byte, 96ul> const&) (peer-mse.cc:101)
==15059== by 0x2D3CFB: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:456)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07705 is 181 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x259DF9: auto (anonymous namespace)::wi::export_bits<math::wide_integer::uintwide_t<768u, unsigned int, void, false> >(math::wide_integer::uintwide_t<768u, unsigned int, void, false>) (peer-mse.cc:47)
==15059== by 0x25A7C8: tr_message_stream_encryption::DH::setPeerPublicKey(std::array<std::byte, 96ul> const&) (peer-mse.cc:101)
==15059== by 0x2D3CFB: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:456)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b0775d is 269 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x259E3A: auto (anonymous namespace)::wi::export_bits<math::wide_integer::uintwide_t<768u, unsigned int, void, false> >(math::wide_integer::uintwide_t<768u, unsigned int, void, false>) (peer-mse.cc:47)
==15059== by 0x25A7C8: tr_message_stream_encryption::DH::setPeerPublicKey(std::array<std::byte, 96ul> const&) (peer-mse.cc:101)
==15059== by 0x2D3CFB: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:456)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07708 is 184 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 1
==15059== at 0x259F30: extract_builtin_integral_type (uintwide_t.h:2584)
==15059== by 0x259F30: operator unsigned char (uintwide_t.h:1559)
==15059== by 0x259F30: auto (anonymous namespace)::wi::export_bits<math::wide_integer::uintwide_t<768u, unsigned int, void, false> >(math::wide_integer::uintwide_t<768u, unsigned int, void, false>) (peer-mse.cc:51)
==15059== by 0x25A7C8: tr_message_stream_encryption::DH::setPeerPublicKey(std::array<std::byte, 96ul> const&) (peer-mse.cc:101)
==15059== by 0x2D3CFB: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:456)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07764 is 276 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 1
==15059== at 0x25A5B8: equal<const std::byte*, const std::byte*> (stl_algobase.h:1161)
==15059== by 0x25A5B8: __equal_aux1<const std::byte*, const std::byte*> (stl_algobase.h:1210)
==15059== by 0x25A5B8: __equal_aux<const std::byte*, const std::byte*> (stl_algobase.h:1218)
==15059== by 0x25A5B8: equal<const std::byte*, const std::byte*> (stl_algobase.h:1555)
==15059== by 0x25A5B8: operator==<std::byte, 96> (array:305)
==15059== by 0x25A5B8: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:87)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076a5 is 85 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 1
==15059== at 0x259D50: auto (anonymous namespace)::wi::import_bits<math::wide_integer::uintwide_t<160u, unsigned int, void, false> >(std::array<std::byte, math::wide_integer::uintwide_t<160u, unsigned int, void, false>::my_width2/std::numeric_limits::digits> const&) (peer-mse.cc:35)
==15059== by 0x25A4E6: tr_message_stream_encryption::generatePublicKey(std::array<std::byte, 20ul> const&) (peer-mse.cc:80)
==15059== by 0x25A60A: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== Address 0x9b07691 is 65 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A610: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076a5 is 85 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A61A: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076b5 is 101 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A624: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076c5 is 117 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A62E: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076d5 is 133 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A638: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076e5 is 149 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 8
==15059== at 0x25A642: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076f5 is 165 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A646: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:89)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076a5 is 85 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A5C1: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:92)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076b5 is 101 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A5C9: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:92)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076c5 is 117 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A5CE: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:92)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076d5 is 133 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A5D3: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:92)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076e5 is 149 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 16
==15059== at 0x25A5D8: tr_message_stream_encryption::DH::publicKey() (peer-mse.cc:92)
==15059== by 0x2D3DA5: send_public_key_and_pad<512> (handshake.h:183)
==15059== by 0x2D3DA5: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b076f5 is 165 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x2D3E00: send_public_key_and_pad<512> (handshake.h:188)
==15059== by 0x2D3E00: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:460)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== Address 0x9b077b8 is 360 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid write of size 4
==15059== at 0x2D3E46: set_state (handshake.h:170)
==15059== by 0x2D3E46: tr_handshake::read_ya(tr_peerIo*) (handshake.cc:462)
==15059== by 0x2D45F6: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:706)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== Address 0x9b077c0 is 368 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x4C63CC0: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b07705 is 181 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x4C63CCE: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b07739 is 233 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x4C63CF5: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b0770d is 189 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 8
==15059== at 0x4C63D04: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== Address 0x9b0771d is 205 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 1
==15059== at 0x484A430: memmove (vg_replace_strmem.c:1382)
==15059== by 0x4C63BD6: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07741 is 241 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059==
==15059== Invalid read of size 1
==15059== at 0x484A43D: memmove (vg_replace_strmem.c:1382)
==15059== by 0x4C63BD6: SHA1_Update (in /usr/lib/x86_64-linux-gnu/libcrypto.so.3)
==15059== by 0x2D02DF: digest<std::basic_string_view<char, std::char_traits >, std::array<std::byte, 96> > (crypto-utils.h:40)
==15059== by 0x2D02DF: tr_handshake::read_pad_a(tr_peerIo*) (handshake.cc:469)
==15059== by 0x2D45DE: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:710)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== Address 0x9b07743 is 243 bytes inside a block of size 392 free'd
==15059== at 0x484399B: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==15059== by 0x25299B: deallocate (new_allocator.h:158)
==15059== by 0x25299B: deallocate (alloc_traits.h:496)
==15059== by 0x25299B: _M_put_node (stl_tree.h:565)
==15059== by 0x25299B: _M_drop_node (stl_tree.h:632)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2495)
==15059== by 0x25299B: _M_erase_aux (stl_tree.h:2509)
==15059== by 0x25299B: std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) [clone .isra.0] (stl_tree.h:2520)
==15059== by 0x253A9A: erase (stl_map.h:1117)
==15059== by 0x253A9A: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1009)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2D1A00: done (handshake.h:150)
==15059== by 0x2D1A00: tr_handshake::read_peer_id(tr_peerIo*) (handshake.cc:439)
==15059== by 0x2D460E: tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) (handshake.cc:702)
==15059== by 0x244C7F: tr_peerIo::can_read_wrapper() (peer-io.cc:358)
==15059== by 0x248953: tr_peerIo::try_read(unsigned long) (peer-io.cc:437)
==15059== by 0x2113FE: tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) (bandwidth.cc:188)
==15059== by 0x211C26: tr_bandwidth::allocate(unsigned int) (bandwidth.cc:246)
==15059== by 0x25694E: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2203)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== Block was alloc'd at
==15059== at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==15059== by 0x254941: allocate (new_allocator.h:137)
==15059== by 0x254941: allocate (alloc_traits.h:464)
==15059== by 0x254941: _M_get_node (stl_tree.h:561)
==15059== by 0x254941: _M_create_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:611)
==15059== by 0x254941: _Auto_node<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:1636)
==15059== by 0x254941: _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_tree.h:2461)
==15059== by 0x254941: emplace_hint<const std::piecewise_construct_t&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)>&&> > (stl_map.h:638)
==15059== by 0x254941: try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::<lambda(const tr_handshake::Result&)> > (stl_map.h:743)
==15059== by 0x254941: tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) (peer-mgr.cc:1117)
==15059== by 0x17F328: addIncoming (session.cc:2169)
==15059== by 0x17F328: tr_session::onIncomingPeerConnection(int, void*) (session.cc:384)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)

@lindianfeng
Copy link
Author

==15059== Invalid write of size 8
==15059== at 0x2440ED: set_callbacks (peer-io.h:77)
==15059== by 0x2440ED: clear_callbacks (peer-io.h:83)
==15059== by 0x2440ED: tr_peerIo::clear() (peer-io.cc:205)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb68 is 35,464 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid write of size 8
==15059== at 0x2440F8: set_callbacks (peer-io.h:78)
==15059== by 0x2440F8: clear_callbacks (peer-io.h:83)
==15059== by 0x2440F8: tr_peerIo::clear() (peer-io.cc:205)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb70 is 35,472 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid write of size 8
==15059== at 0x244103: set_callbacks (peer-io.h:75)
==15059== by 0x244103: clear_callbacks (peer-io.h:83)
==15059== by 0x244103: tr_peerIo::clear() (peer-io.cc:205)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb58 is 35,448 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 4
==15059== at 0x243F27: is_tcp (peer-socket.h:101)
==15059== by 0x243F27: tr_peerIo::event_disable(short) (peer-io.cc:498)
==15059== by 0x24410E: set_enabled (peer-io.cc:539)
==15059== by 0x24410E: tr_peerIo::clear() (peer-io.cc:206)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f5537f8 is 1,816 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 1
==15059== at 0x243F42: tr_peerIo::event_disable(short) (peer-io.cc:514)
==15059== by 0x24410E: set_enabled (peer-io.cc:539)
==15059== by 0x24410E: tr_peerIo::clear() (peer-io.cc:206)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb88 is 35,496 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 4
==15059== at 0x243F27: is_tcp (peer-socket.h:101)
==15059== by 0x243F27: tr_peerIo::event_disable(short) (peer-io.cc:498)
==15059== by 0x24411B: set_enabled (peer-io.cc:539)
==15059== by 0x24411B: tr_peerIo::clear() (peer-io.cc:207)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f5537f8 is 1,816 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 1
==15059== at 0x243F32: tr_peerIo::event_disable(short) (peer-io.cc:502)
==15059== by 0x24411B: set_enabled (peer-io.cc:539)
==15059== by 0x24411B: tr_peerIo::clear() (peer-io.cc:207)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb88 is 35,496 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 4
==15059== at 0x26F6A1: is_tcp (peer-socket.h:101)
==15059== by 0x26F6A1: tr_peer_socket::close() (peer-socket.cc:55)
==15059== by 0x244127: close (peer-io.cc:198)
==15059== by 0x244127: tr_peerIo::clear() (peer-io.cc:208)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f5537f8 is 1,816 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid write of size 4
==15059== at 0x26F6B1: tr_peer_socket::close() (peer-socket.cc:69)
==15059== by 0x244127: close (peer-io.cc:198)
==15059== by 0x244127: tr_peerIo::clear() (peer-io.cc:208)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f5537f8 is 1,816 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid write of size 8
==15059== at 0x26F6B8: tr_peer_socket::close() (peer-socket.cc:70)
==15059== by 0x244127: close (peer-io.cc:198)
==15059== by 0x244127: tr_peerIo::clear() (peer-io.cc:208)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f5537d8 is 1,784 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid read of size 8
==15059== at 0x244128: reset (unique_ptr.h:200)
==15059== by 0x244128: reset (unique_ptr.h:501)
==15059== by 0x244128: close (peer-io.cc:199)
==15059== by 0x244128: tr_peerIo::clear() (peer-io.cc:208)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb80 is 35,488 bytes inside an unallocated block of size 99,760 in arena "client"
==15059==
==15059== Invalid write of size 8
==15059== at 0x24412F: reset (unique_ptr.h:201)
==15059== by 0x24412F: reset (unique_ptr.h:501)
==15059== by 0x24412F: close (peer-io.cc:199)
==15059== by 0x24412F: tr_peerIo::clear() (peer-io.cc:208)
==15059== by 0x26156A: ~tr_peerMsgsImpl (peer-msgs.cc:380)
==15059== by 0x26156A: (anonymous namespace)::tr_peerMsgsImpl::~tr_peerMsgsImpl() (peer-msgs.cc:382)
==15059== by 0x257099: tr_swarm::removePeer(tr_peer*) (peer-mgr.cc:406)
==15059== by 0x25611F: closeBadPeers (peer-mgr.cc:2070)
==15059== by 0x25611F: tr_peerMgr::reconnectPulse() (peer-mgr.cc:2133)
==15059== by 0x2569DE: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2216)
==15059== by 0x2EF870: event_persist_closure (event.c:1623)
==15059== by 0x2EF870: event_process_active_single_queue (event.c:1682)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)
==15059== Address 0x1f55bb80 is 35,488 bytes inside an unallocated block of size 99,760 in arena "client"

@lindianfeng
Copy link
Author

==15059== Invalid read of size 8
==15059== at 0x4849AD0: bcmp (vg_replace_strmem.c:1203)
==15059== by 0x1A6E89: __memcmp<std::byte, std::byte> (stl_algobase.h:105)
==15059== by 0x1A6E89: __3way<std::byte, std::byte> (stl_algobase.h:1355)
==15059== by 0x1A6E89: __lc<std::byte, std::byte> (stl_algobase.h:1344)
==15059== by 0x1A6E89: __lexicographical_compare_aux1<const std::byte*, const std::byte*> (stl_algobase.h:1382)
==15059== by 0x1A6E89: __lexicographical_compare_aux<const std::byte*, const std::byte*> (stl_algobase.h:1416)
==15059== by 0x1A6E89: lexicographical_compare<const std::byte*, const std::byte*> (stl_algobase.h:1746)
==15059== by 0x1A6E89: operator< <std::byte, 20> (array:342)
==15059== by 0x1A6E89: operator() (torrents.cc:24)
==15059== by 0x1A6E89: operator() (torrents.cc:34)
==15059== by 0x1A6E89: operator()<__gnu_cxx::__normal_iterator<tr_torrent**, std::vector<tr_torrent*> >, const std::array<std::byte, 20> > (predefined_ops.h:196)
==15059== by 0x1A6E89: __equal_range<__gnu_cxx::__normal_iterator<tr_torrent**, std::vector<tr_torrent*> >, std::array<std::byte, 20>, __gnu_cxx::__ops::_Iter_comp_val<(anonymous namespace)::CompareTorrentByHash>, __gnu_cxx::__ops::_Val_comp_iter<(anonymous namespace)::CompareTorrentByHash> > (stl_algo.h:2113)
==15059== by 0x1A6E89: equal_range<__gnu_cxx::__normal_iterator<tr_torrent**, std::vector<tr_torrent*> >, std::array<std::byte, 20>, (anonymous namespace)::CompareTorrentByHash> (stl_algo.h:2205)
==15059== by 0x1A6E89: tr_torrents::get(std::array<std::byte, 20ul> const&) (torrents.cc:53)
==15059== by 0x253915: get_existing_swarm (peer-mgr.cc:722)
==15059== by 0x253915: (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr*, tr_handshake::Result const&) (peer-mgr.cc:1003)
==15059== by 0x2CBFD4: operator() (std_function.h:591)
==15059== by 0x2CBFD4: tr_handshake::fire_done(bool) (handshake.cc:842)
==15059== by 0x2EF774: event_process_active_single_queue (event.c:1691)
==15059== by 0x2EFFEE: event_process_active (event.c:1783)
==15059== by 0x2EFFEE: event_base_loop (event.c:2006)
==15059== by 0x2976F7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==15059== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==15059== by 0x52A5FD3: start_thread (pthread_create.c:442)
==15059== by 0x532581F: clone (clone.S:100)

@ckerr ckerr self-assigned this Jun 30, 2023
@ckerr ckerr changed the title the git branch main hash 9afced725ad8226ab6213b8d96d52aefd3f78417 crash the git branch main hash 9afced7 crash Jun 30, 2023
@lindianfeng
Copy link
Author

hash: ce66e5c

==45972== Process terminating with default action of signal 11 (SIGSEGV)
==45972== Access not within mapped region at address 0xFFFFFFFE2F174028
==45972== at 0x20DA33: tr_bandwidth::get_speed_bytes_per_second(tr_bandwidth::RateControl&, unsigned int, unsigned long) (bandwidth.cc:33)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (bandwidth.h:153)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (peer-io.h:166)
==45972== by 0x2443A7: get_desired_output_buffer_size (peer-io.cc:66)
==45972== by 0x2443A7: tr_peerIo::get_write_buffer_space(unsigned long) const (peer-io.cc:572)
==45972== by 0x265F42: (anonymous namespace)::peer_pulse_helpers::add_next_piece((anonymous namespace)::tr_peerMsgsImpl*, unsigned long) (peer-msgs.cc:1912)
==45972== by 0x2668FC: fill_output_buffer (peer-msgs.cc:1973)
==45972== by 0x2668FC: (anonymous namespace)::peerPulse(void*) (peer-msgs.cc:2002)
==45972== by 0x256918: pumpAllPeers (peer-mgr.cc:2166)
==45972== by 0x256918: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2198)
==45972== by 0x2EF850: event_persist_closure (event.c:1623)
==45972== by 0x2EF850: event_process_active_single_queue (event.c:1682)
==45972== by 0x2EFFCE: event_process_active (event.c:1783)
==45972== by 0x2EFFCE: event_base_loop (event.c:2006)
==45972== by 0x2976E7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==45972== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==45972== by 0x52A5FD3: start_thread (pthread_create.c:442)
==45972== by 0x532581F: clone (clone.S:100)
==45972== If you believe this happened as a result of a stack
==45972== overflow in your program's main thread (unlikely but
==45972== possible), you can try to increase the size of the
==45972== main thread stack using the --main-stacksize= flag.
==45972== The main thread stack size used in this run was 8388608.
==45972==

@lindianfeng
Copy link
Author

==45972== Invalid write of size 8
==45972== at 0x20DA42: tr_bandwidth::get_speed_bytes_per_second(tr_bandwidth::RateControl&, unsigned int, unsigned long) (bandwidth.cc:49)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (bandwidth.h:153)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (peer-io.h:166)
==45972== by 0x2443A7: get_desired_output_buffer_size (peer-io.cc:66)
==45972== by 0x2443A7: tr_peerIo::get_write_buffer_space(unsigned long) const (peer-io.cc:572)
==45972== by 0x265F42: (anonymous namespace)::peer_pulse_helpers::add_next_piece((anonymous namespace)::tr_peerMsgsImpl*, unsigned long) (peer-msgs.cc:1912)
==45972== by 0x2668FC: fill_output_buffer (peer-msgs.cc:1973)
==45972== by 0x2668FC: (anonymous namespace)::peerPulse(void*) (peer-msgs.cc:2002)
==45972== by 0x256918: pumpAllPeers (peer-mgr.cc:2166)
==45972== by 0x256918: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2198)
==45972== by 0x2EF850: event_persist_closure (event.c:1623)
==45972== by 0x2EF850: event_process_active_single_queue (event.c:1682)
==45972== by 0x2EFFCE: event_process_active (event.c:1783)
==45972== by 0x2EFFCE: event_base_loop (event.c:2006)
==45972== by 0x2976E7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==45972== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==45972== by 0x52A5FD3: start_thread (pthread_create.c:442)
==45972== by 0x532581F: clone (clone.S:100)

@lindianfeng
Copy link
Author

==45972== Invalid read of size 8
==45972== at 0x20DA33: tr_bandwidth::get_speed_bytes_per_second(tr_bandwidth::RateControl&, unsigned int, unsigned long) (bandwidth.cc:33)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (bandwidth.h:153)
==45972== by 0x2443A7: get_piece_speed_bytes_per_second (peer-io.h:166)
==45972== by 0x2443A7: get_desired_output_buffer_size (peer-io.cc:66)
==45972== by 0x2443A7: tr_peerIo::get_write_buffer_space(unsigned long) const (peer-io.cc:572)
==45972== by 0x265F42: (anonymous namespace)::peer_pulse_helpers::add_next_piece((anonymous namespace)::tr_peerMsgsImpl*, unsigned long) (peer-msgs.cc:1912)
==45972== by 0x2668FC: fill_output_buffer (peer-msgs.cc:1973)
==45972== by 0x2668FC: (anonymous namespace)::peerPulse(void*) (peer-msgs.cc:2002)
==45972== by 0x256918: pumpAllPeers (peer-mgr.cc:2166)
==45972== by 0x256918: tr_peerMgr::bandwidthPulse() (peer-mgr.cc:2198)
==45972== by 0x2EF850: event_persist_closure (event.c:1623)
==45972== by 0x2EF850: event_process_active_single_queue (event.c:1682)
==45972== by 0x2EFFCE: event_process_active (event.c:1783)
==45972== by 0x2EFFCE: event_base_loop (event.c:2006)
==45972== by 0x2976E7: tr_session_thread_impl::sessionThreadFunc(event_base*) (session-thread.cc:245)
==45972== by 0x4FD84A2: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30)
==45972== by 0x52A5FD3: start_thread (pthread_create.c:442)
==45972== by 0x532581F: clone (clone.S:100)

@lindianfeng
Copy link
Author

all the valgrind check log hash:ce66e
valgrind_check.log

@lindianfeng
Copy link
Author

I think it has something to do with changing the small library in the code, it didn’t crash before

@ckerr
Copy link
Member

ckerr commented Jun 30, 2023

@lindianfeng the more I read this valgrind log the more confusing it is -- it seems like you're hitting some states that just shouldn't be reached.

Can you confirm for me that you're using an unmodified version of main, and would you be willing to test a patched version with tracer code to help track this problem down?

@ckerr
Copy link
Member

ckerr commented Jun 30, 2023

I think it has something to do with changing the small library in the code, it didn’t crash before

Maybe? I don't have another theory at the moment because the valgrind log is really strange, but... if it's just small then I wonder why I'm not also seeing the issue 😕

@tearfur
Copy link
Member

tearfur commented Jun 30, 2023

the more I read this valgrind log the more confusing it is

ikr?? So it is not just me

@tearfur
Copy link
Member

tearfur commented Jun 30, 2023

@lindianfeng Did you run valgrind with --show-leak-kinds=all? Please remove that option, maybe that will give more sane outputs.

@ckerr
Copy link
Member

ckerr commented Jun 30, 2023

example: I don't see any code path for handshake::can_read()'s switch (hanshake->state()) line to be reached again after handshake::done() is called, since done() clears the callback pointers (so future iterations shouldn't reach handshake) and done never READ_NOW so the while loop in handshake::can_read() should always break.

@ckerr
Copy link
Member

ckerr commented Jun 30, 2023

Just brainstorming, maybe asan would be useful as a second reference point.

Something like

$ cmake \
-DCMAKE_C_COMPILER="clang-17" \
-DCMAKE_CXX_COMPILER="clang++-17" \
-DCMAKE_CXX_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined" \
-DCMAKE_C_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined" \
..

And if it gives the same output as Valgrind then that will at least prove that Valgrind's not hiccuping here

@lindianfeng
Copy link
Author

I compiled it with gcc,and run cmd is:
valgrind --tool=memcheck --leak-check=full ./transmission-daemon -f --log-level=info --config-dir=/var/lib/transmission-daemon/info

@lindianfeng
Copy link
Author

cmake .. -DENABLE_DAEMON=ON -DENABLE_GTK=OFF -DENABLE_QT=OFF -DENABLE_MAC=OFF -DINSTALL_WEB=OFF -DINSTALL_DOC=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr && make -j6

@lindianfeng
Copy link
Author

i build with clang 14 and start crash build with : CC=clang CXX=clang++ cmake .. -DENABLE_DAEMON=ON -DENABLE_GTK=OFF -DENABLE_QT=OFF -DENABLE_MAC=OFF -DINSTALL_WEB=OFF -DINSTALL_DOC=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined" -DCMAKE_C_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined"

● transmission-daemon.service - Transmission BitTorrent Daemon Loaded: loaded (/lib/systemd/system/transmission-daemon.service; enabled; preset: enabled) Active: active (running) since Fri 2023-06-30 23:32:33 CST; 3s ago Main PID: 18392 (transmission-da) Status: "Uploading 11.26 KBps, Downloading 18.64 KBps." Tasks: 4 (limit: 18858) Memory: 700.5M CPU: 3.312s CGroup: /system.slice/transmission-daemon.service └─18392 /usr/bin/transmission-daemon -f --log-level=error

Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: /home/kaka/code/transmission/third-party/libutp/utp_internal.cpp:3316:30: runtime error: member access within misaligned address 0x619000010664 for type 'UTPSocketKeyData', which re> Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: 0x619000010664: note: pointer points here Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 ff ff 6a 08 55 3b 07 87 b2 73 4a 94 00 00 00 5e 02 00 Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: ^ Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/kaka/code/transmission/third-party/libutp/utp_internal.cpp:3316:30 in Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: /home/kaka/code/transmission/third-party/libutp/utp_internal.cpp:3316:30: runtime error: load of misaligned address 0x61900001067c for type 'UTPSocket *', which requires 8 byte alig> Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: 0x61900001067c: note: pointer points here Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: 4a 94 00 00 00 5e 02 00 70 61 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 ff ff Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: ^ Jun 30 23:32:33 kaika-nas transmission-daemon[18392]: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/kaka/code/transmission/third-party/libutp/utp_internal.cpp:3316:30 in

commit 8183d7f (HEAD -> main, origin/main, origin/HEAD)
Author: Charles Kerr charles@charleskerr.com
Date: Fri Jun 30 09:49:58 2023 -0500

@lindianfeng
Copy link
Author

Linux version 6.1.0-9-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08)

@tearfur
Copy link
Member

tearfur commented Jun 30, 2023

transmission/libutp#6
bittorrent/libutp#136

@lindianfeng
Copy link
Author

clang:
C compiler identification is Clang 14.0.6
CXX compiler identification is Clang 14.0.6

glibc:
ldd (Debian GLIBC 2.36-9) 2.36

code version:
commit 0fbafc9 (HEAD -> main, origin/main, origin/HEAD)
Author: Charles Kerr charles@charleskerr.com
Date: Fri Jun 30 18:04:16 2023 -0500

refactor: prefer std::queue over QQueue (#5704)

* refactor: prefer std::queue over QQueue

* refactor: prefer std::pair over QPair

build cmd:
CC=clang CXX=clang++ cmake .. -DENABLE_DAEMON=ON -DENABLE_GTK=OFF -DENABLE_QT=OFF -DENABLE_MAC=OFF -DINSTALL_WEB=OFF -DINSTALL_DOC=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined" -DCMAKE_C_FLAGS="-gdwarf-4 -fno-omit-frame-pointer -fsanitize=address,pointer-compare,pointer-subtract,leak,undefined"

errors:
==35633==ERROR: AddressSanitizer: heap-use-after-free on address 0x6140007327b0 at pc 0x55cdc5d9dc9a bp 0x7f0fe8bf6b10 sp 0x7f0fe8bf6b08
READ of size 4 at 0x6140007327b0 thread T1
#0 0x55cdc5d9dc99 in tr_handshake::state() const /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:160:16
#1 0x55cdc5d9dc99 in tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) /home/kaka/code/transmission/libtransmission/handshake.cc:693:28
#2 0x55cdc5c1e9d7 in tr_peerIo::can_read_wrapper() /home/kaka/code/transmission/libtransmission/peer-io.cc:357:56
#3 0x55cdc5c1f2b5 in tr_peerIo::try_read(unsigned long) /home/kaka/code/transmission/libtransmission/peer-io.cc:436:9
#4 0x55cdc5bc42e5 in tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) /home/kaka/code/transmission/libtransmission/bandwidth.cc:188:47
#5 0x55cdc5bc4d12 in tr_bandwidth::allocate(unsigned int) /home/kaka/code/transmission/libtransmission/bandwidth.cc:246:9
#6 0x55cdc5c3763a in tr_peerMgr::bandwidthPulse() /home/kaka/code/transmission/libtransmission/peer-mgr.cc:2202:29
#7 0x55cdc5e55d12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#8 0x55cdc5e55d12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#9 0x55cdc5e386c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#10 0x55cdc5e386c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#11 0x55cdc5d16274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#12 0x7f0febed44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)
#13 0x7f0febca7fd3 in start_thread nptl/./nptl/pthread_create.c:442:8
#14 0x7f0febd285bb in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

0x6140007327b0 is located 368 bytes inside of 392-byte region [0x614000732640,0x6140007327c8)
freed by thread T1 here:
#0 0x55cdc597d9cd in operator delete(void*) (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x7db9cd) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x55cdc5c660ac in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:632:2
#2 0x55cdc5c660ac in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2495:7
#3 0x55cdc5c65ec5 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2509:4
#4 0x55cdc5c65b07 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2520:7
#5 0x55cdc5c48931 in (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr
, tr_handshake::Result const&) /home/kaka/code/transmission/libtransmission/peer-mgr.cc
#6 0x55cdc5d9f2dd in tr_handshake::fire_done(bool) /home/kaka/code/transmission/libtransmission/handshake.cc:840:26
#7 0x55cdc5da0be5 in tr_handshake::done(bool) /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:150:16
#8 0x55cdc5d97d7d in tr_handshake::read_peer_id(tr_peerIo*) /home/kaka/code/transmission/libtransmission/handshake.cc:437:12
#9 0x55cdc5d9d697 in tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) /home/kaka/code/transmission/libtransmission/handshake.cc:700:30
#10 0x55cdc5c1e9d7 in tr_peerIo::can_read_wrapper() /home/kaka/code/transmission/libtransmission/peer-io.cc:357:56
#11 0x55cdc5c1f2b5 in tr_peerIo::try_read(unsigned long) /home/kaka/code/transmission/libtransmission/peer-io.cc:436:9
#12 0x55cdc5bc42e5 in tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) /home/kaka/code/transmission/libtransmission/bandwidth.cc:188:47
#13 0x55cdc5bc4d12 in tr_bandwidth::allocate(unsigned int) /home/kaka/code/transmission/libtransmission/bandwidth.cc:246:9
#14 0x55cdc5c3763a in tr_peerMgr::bandwidthPulse() /home/kaka/code/transmission/libtransmission/peer-mgr.cc:2202:29
#15 0x55cdc5e55d12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#16 0x55cdc5e55d12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#17 0x55cdc5e386c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#18 0x55cdc5e386c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#19 0x55cdc5d16274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#20 0x7f0febed44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)

previously allocated by thread T1 here:
#0 0x55cdc597d16d in operator new(unsigned long) (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x7db16d) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x55cdc5c2aa39 in std::_Rb_tree_node<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >* std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:611:23
#2 0x55cdc5c2aa39 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_Auto_node::_Auto_node<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >&, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:1636:18
#3 0x55cdc5c2aa39 in std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2461:13
#4 0x55cdc5c2aa39 in std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > std::map<std::pair<tr_address, tr_port>, tr_handshake, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::emplace_hint<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_map.h:638:16
#5 0x55cdc5c2aa39 in std::pair<std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, bool> std::map<std::pair<tr_address, tr_port>, tr_handshake, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1>(std::pair<tr_address, tr_port>&&, HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_map.h:743:14
#6 0x55cdc5c2aa39 in tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) /home/kaka/code/transmission/libtransmission/peer-mgr.cc:1116:38
#7 0x55cdc5a0c279 in tr_session::onIncomingPeerConnection(int, void*) /home/kaka/code/transmission/libtransmission/session.cc:382:18
#8 0x55cdc5e55d12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#9 0x55cdc5e55d12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#10 0x55cdc5e386c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#11 0x55cdc5e386c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#12 0x55cdc5d16274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#13 0x7f0febed44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)

Thread T1 created by T0 here:
#0 0x55cdc592b81c in __interceptor_pthread_create (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x78981c) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x7f0febed4578 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_deletestd::thread::_State >, void ()()) (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd4578) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)
#2 0x55cdc5d15ac9 in tr_session_thread_impl::tr_session_thread_impl() /home/kaka/code/transmission/libtransmission/session-thread.cc:161:19
#3 0x55cdc5d1390a in std::__detail::_MakeUniq<tr_session_thread_impl>::__single_object std::make_unique<tr_session_thread_impl>() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:34
#4 0x55cdc5d1390a in tr_session_thread::create() /home/kaka/code/transmission/libtransmission/session-thread.cc:298:12
#5 0x55cdc5a1d334 in tr_session::tr_session(std::basic_string_view<char, std::char_traits >, tr_variant
) /home/kaka/code/transmission/libtransmission/session.cc:2137:24
#6 0x55cdc5a0e766 in tr_sessionInit(char const*, bool, tr_variant*) /home/kaka/code/transmission/libtransmission/session.cc:583:31
#7 0x55cdc5982116 in tr_daemon::start(bool) /home/kaka/code/transmission/daemon/daemon.cc:707:15
#8 0x55cdc59d861b in tr_daemon::spawn(bool, int*, tr_error**) /home/kaka/code/transmission/daemon/daemon-posix.cc:184:18
#9 0x55cdc5986a7f in main /home/kaka/code/transmission/daemon/daemon.cc:947:17
#10 0x7f0febc46189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: heap-use-after-free /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:160:16 in tr_handshake::state() const
Shadow bytes around the buggy address:
0x0c28800de4a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de4b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de4c0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
0x0c28800de4d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c28800de4e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c28800de4f0: fd fd fd fd fd fd[fd]fd fd fa fa fa fa fa fa fa
0x0c28800de500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de510: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de520: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de530: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800de540: 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
==35633==ABORTING

@lindianfeng
Copy link
Author

/home/kaka/code/transmission/libtransmission/handshake.cc:693:28

auto* handshake = static_cast<tr_handshake*>(vhandshake);

maybe the var 'handshake' is be freed

@lindianfeng
Copy link
Author

I have not changed the code, I can cooperate with the test, thank you for your contribution

@lindianfeng
Copy link
Author

try agin and open the trace log

[2023-07-01 02:11:17.202] trc [122.194.56.72]:58803 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.202] trc [122.194.56.72]:58803 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.202] trc [119.178.188.98]:8999 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 utp_on_error -- UTP_ETIMEDOUT (peer-io.cc:644)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 disabling ready-to-read polling (peer-io.cc:503)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 socket (tcp) is 31 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc net.cc:260 New OUTGOING connection 31 ([88.99.84.214]:14029) (net.cc:260)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 enabling ready-to-write polling (peer-io.cc:484)
[2023-07-01 02:11:17.202] trc [115.45.105.83]:37729 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 utp_on_error -- UTP_ETIMEDOUT (peer-io.cc:644)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 disabling ready-to-read polling (peer-io.cc:503)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 socket (tcp) is 34 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc net.cc:260 New OUTGOING connection 34 ([153.3.160.122]:17135) (net.cc:260)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.202] trc [153.3.160.122]:17135 enabling ready-to-write polling (peer-io.cc:484)
[2023-07-01 02:11:17.202] trc [119.178.188.98]:8999 utp_on_state_change -- changed to connected (peer-io.cc:613)
[2023-07-01 02:11:17.202] trc [119.178.188.98]:8999 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.202] trc [120.224.120.219]:43312 libevent says this peer socket is ready for reading (peer-io.cc:447)
[2023-07-01 02:11:17.202] trc [120.224.120.219]:43312 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.202] trc Debain [120.224.120.219]:43312 [qBittorrent/4.3.3]: read 12 payload bytes; 0 left to go (peer-msgs.cc:1785)
[2023-07-01 02:11:17.202] trc Debain [120.224.120.219]:43312 [qBittorrent/4.3.3]: got peer msg 'request' (6) with payload len 12 (peer-msgs.cc:1426)
[2023-07-01 02:11:17.202] trc Debain [120.224.120.219]:43312 [qBittorrent/4.3.3]: got Request: 2047:4947968->16384 (peer-msgs.cc:1508)
[2023-07-01 02:11:17.202] trc session.cc:381 new incoming connection 40 ([216.122.175.70]:45167) (session.cc:381)
[2023-07-01 02:11:17.202] trc [216.122.175.70]:45167 socket (tcp) is 40 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc 0.0.0.0 bandwidth is 0x62d001c526a0; its parent is 0x621000003230 (peer-io.cc:99)
[2023-07-01 02:11:17.202] trc tr-udp.cc:131 Unexpected UDP packet (tr-udp.cc:131)
[2023-07-01 02:11:17.202] trc session.cc:381 new incoming connection 60 ([144.76.44.208]:8671) (session.cc:381)
[2023-07-01 02:11:17.202] trc [144.76.44.208]:8671 socket (tcp) is 60 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc 0.0.0.0 bandwidth is 0x62d000f6e6a0; its parent is 0x621000003230 (peer-io.cc:99)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 libevent says this peer socket is ready for reading (peer-io.cc:447)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 handling canRead; state is [awaiting pad a] (handshake.cc:688)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 found it... looking setting to awaiting_crypto_provide (handshake.cc:479)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 reading obfuscated torrent hash... (handshake.cc:510)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 got INCOMING connection's encrypted handshake for torrent [29] (handshake.cc:524)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 crypto_provide is 2 (handshake.cc:550)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 padc is 354 (handshake.cc:553)
[2023-07-01 02:11:17.202] trc [38.102.86.252]:42559 ia_len is 68 (handshake.cc:579)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 libevent says this peer socket is ready for writing (peer-io.cc:323)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 try_write err: wrote:0, errno:111 (Connection refused) (peer-io.cc:306)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 handshake socket err: Connection refused (111) (handshake.cc:818)
[2023-07-01 02:11:17.202] trc Debainmarking peer [88.99.84.214]:14029 as unreachable... num_fails is 2 (peer-mgr.cc:1034)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 in tr_peerIo destructor (peer-io.cc:165)
[2023-07-01 02:11:17.202] trc [88.99.84.214]:14029 disabling ready-to-read polling (peer-io.cc:503)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 libevent says this peer socket is ready for reading (peer-io.cc:447)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 handling canRead; state is [awaiting ia] (handshake.cc:688)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 reading IA... have 68, need 68 (handshake.cc:589)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 sending vc (handshake.cc:604)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 selecting crypto mode '2' (handshake.cc:612)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 sending pad d (handshake.cc:621)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 sending handshake (handshake.cc:635)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 reading payload stream... have 68, need 68 (handshake.cc:659)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 payload: need 68, got 68 (handshake.cc:63)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 peer-id is '-qB4400-upBPB~z324h' (handshake.cc:103)
[2023-07-01 02:11:17.202] trc [218.68.219.17]:18873 parseHandshake returned 0 (handshake.cc:667)
[2023-07-01 02:11:17.202] trc Debain [218.68.219.17]:18873 [qBittorrent 4.4.0]: sending an ltep handshake (peer-msgs.cc:934)
[2023-07-01 02:11:17.202] trc Debain [218.68.219.17]:18873 [qBittorrent 4.4.0]: sending 'ltep' 0 [] (peer-msgs.cc:816)
[2023-07-01 02:11:17.202] trc Debain [218.68.219.17]:18873 [qBittorrent 4.4.0]: sending 'fext-have-all' (peer-msgs.cc:816)
[2023-07-01 02:11:17.202] trc session.cc:381 new incoming connection 31 ([60.179.196.45]:55453) (session.cc:381)
[2023-07-01 02:11:17.202] trc [60.179.196.45]:55453 socket (tcp) is 31 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc 0.0.0.0 bandwidth is 0x62d002ee06a0; its parent is 0x621000003230 (peer-io.cc:99)
[2023-07-01 02:11:17.202] trc session.cc:381 new incoming connection 67 ([113.65.4.114]:41089) (session.cc:381)
[2023-07-01 02:11:17.202] trc [113.65.4.114]:41089 socket (tcp) is 67 (peer-socket.cc:37)
[2023-07-01 02:11:17.202] trc 0.0.0.0 bandwidth is 0x62d0020266a0; its parent is 0x621000003230 (peer-io.cc:99)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 libevent says this peer socket is ready for reading (peer-io.cc:447)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 handling canRead; state is [awaiting ia] (handshake.cc:688)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 reading IA... have 68, need 68 (handshake.cc:589)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 sending vc (handshake.cc:604)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 selecting crypto mode '2' (handshake.cc:612)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 sending pad d (handshake.cc:621)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 sending handshake (handshake.cc:635)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 reading payload stream... have 68, need 68 (handshake.cc:659)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 payload: need 68, got 68 (handshake.cc:63)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 peer-id is '-qB4410-4zI2XGcHU2pj' (handshake.cc:103)
[2023-07-01 02:11:17.203] trc [38.102.86.252]:42559 parseHandshake returned 0 (handshake.cc:667)
[2023-07-01 02:11:17.203] trc Debain [38.102.86.252]:42559 [qBittorrent 4.4.1]: sending an ltep handshake (peer-msgs.cc:934)
[2023-07-01 02:11:17.203] trc Debain [38.102.86.252]:42559 [qBittorrent 4.4.1]: sending 'ltep' 0 [] (peer-msgs.cc:816)
[2023-07-01 02:11:17.203] trc Debain [38.102.86.252]:42559 [qBittorrent 4.4.1]: sending 'fext-have-all' (peer-msgs.cc:816)
[2023-07-01 02:11:17.203] trc Debain [120.224.120.219]:43312 [qBittorrent/4.3.3]: sending 'piece' 2047 4947968 [] (peer-msgs.cc:816)
[2023-07-01 02:11:17.203] trc [122.194.56.72]:58803 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.203] trc [122.194.56.72]:58803 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc [39.77.222.150]:34508 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.203] trc [39.77.222.150]:34508 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc [119.178.188.98]:8999 48 overhead bytes via utp (peer-io.cc:734)
[2023-07-01 02:11:17.203] trc [119.178.188.98]:8999 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc bandwidth.cc:171 0 peers to go round-robin for upload (bandwidth.cc:171)
[2023-07-01 02:11:17.203] trc bandwidth.cc:171 0 peers to go round-robin for download (bandwidth.cc:171)
[2023-07-01 02:11:17.203] trc bandwidth.cc:171 128 peers to go round-robin for upload (bandwidth.cc:171)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #0 of 128 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #0 of 127 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #0 of 126 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc [120.224.120.219]:43312 enabling ready-to-write polling (peer-io.cc:484)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #0 of 125 used 3000 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 125 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 124 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 123 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 122 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 121 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 120 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 119 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 118 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 117 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 116 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 115 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 114 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 113 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 112 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 111 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 110 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 109 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 108 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 107 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 106 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 105 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 104 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 103 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 102 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 101 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 100 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 99 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 98 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc [119.178.188.98]:8999 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 97 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 96 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 95 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 94 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 93 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 92 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 91 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 90 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 89 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 88 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 87 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 86 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 85 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 84 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc [49.77.76.7]:11554 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 83 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 82 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 81 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 80 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 79 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 78 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc [163.125.208.224]:24123 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 77 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 76 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 75 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 74 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 73 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 72 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc [183.27.251.213]:11141 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 71 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 70 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 69 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 68 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 67 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 66 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 65 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 64 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 63 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 62 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 61 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 60 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 59 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 58 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.203] trc bandwidth.cc:189 peer #1 of 57 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 56 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 55 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 54 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 53 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 52 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 51 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 50 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 49 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 48 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 47 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 46 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 45 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 44 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 43 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 42 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 41 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 40 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 39 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 38 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 37 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 36 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 35 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 34 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 33 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 32 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 31 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 30 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 29 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [223.146.252.29]:52504 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 28 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 27 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 26 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 25 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 24 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 23 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 22 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 21 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 20 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 19 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 18 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 17 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 16 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 15 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 14 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [218.79.11.13]:52000 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 13 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 12 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 11 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [94.130.32.168]:31713 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 10 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 9 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 8 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 7 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [116.25.251.188]:25825 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 6 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 5 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 4 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 3 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #1 of 2 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 1 used 3000 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 1 used 3000 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 1 used 3000 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 1 used 3000 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [120.224.120.219]:43312 disabling ready-to-write polling (peer-io.cc:515)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 1 used 1397 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:171 128 peers to go round-robin for download (bandwidth.cc:171)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 128 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 127 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 126 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 125 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 124 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 123 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 122 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 121 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 120 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 119 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 118 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 117 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 116 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 115 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 114 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [39.77.222.150]:34508 handling canRead; state is [awaiting vc] (handshake.cc:688)
[2023-07-01 02:11:17.204] trc [39.77.222.150]:34508 not enough bytes... returning read_more (handshake.cc:257)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 113 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 112 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 111 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 110 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc [144.76.44.208]:8671 enabling ready-to-read polling (peer-io.cc:472)
[2023-07-01 02:11:17.204] trc [144.76.44.208]:8671 handling canRead; state is [awaiting handshake] (handshake.cc:688)
[2023-07-01 02:11:17.204] trc [144.76.44.208]:8671 payload: need 48, got 68 (handshake.cc:333)
[2023-07-01 02:11:17.204] trc [144.76.44.208]:8671 peer-id is 'qBittorrent 4.3.9' ... isIncoming is true (handshake.cc:430)
[2023-07-01 02:11:17.204] trc bacm003 [144.76.44.208]:8671 [qBittorrent 4.3.9]: sending an ltep handshake (peer-msgs.cc:934)
[2023-07-01 02:11:17.204] trc bacm003 [144.76.44.208]:8671 [qBittorrent 4.3.9]: sending 'ltep' 0 [] (peer-msgs.cc:816)
[2023-07-01 02:11:17.204] trc bacm003 [144.76.44.208]:8671 [qBittorrent 4.3.9]: sending 'fext-have-all' (peer-msgs.cc:816)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 109 used 68 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 108 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 107 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 106 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 105 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 104 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 103 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 102 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.204] trc bandwidth.cc:189 peer #0 of 101 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 100 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 99 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 98 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 97 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 96 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 95 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 94 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 93 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 92 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 91 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 90 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 89 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 88 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 87 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 86 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 85 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc bandwidth.cc:189 peer #0 of 84 used 0 bytes in this pass (bandwidth.cc:189)
[2023-07-01 02:11:17.205] trc [216.122.175.70]:45167 enabling ready-to-read polling (peer-io.cc:472)
#0 0x55cd9eda4be9 in tr_handshake::state_string() const /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:175:29
#1 0x55cd9eda4be9 in tr_handshake::can_read(tr_peerIo
, void*, unsigned long*) /home/kaka/code/transmission/libtransmission/handshake.cc:688:5
#2 0x55cd9ec259d7 in tr_peerIo::can_read_wrapper() /home/kaka/code/transmission/libtransmission/peer-io.cc:357:56
#3 0x55cd9ec262b5 in tr_peerIo::try_read(unsigned long) /home/kaka/code/transmission/libtransmission/peer-io.cc:436:9
#4 0x55cd9ebcb2e5 in tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) /home/kaka/code/transmission/libtransmission/bandwidth.cc:188:47
#5 0x55cd9ebcbd12 in tr_bandwidth::allocate(unsigned int) /home/kaka/code/transmission/libtransmission/bandwidth.cc:246:9
#6 0x55cd9ec3e63a in tr_peerMgr::bandwidthPulse() /home/kaka/code/transmission/libtransmission/peer-mgr.cc:2202:29
#7 0x55cd9ee5cd12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#8 0x55cd9ee5cd12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#9 0x55cd9ee3f6c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#10 0x55cd9ee3f6c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#11 0x55cd9ed1d274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#12 0x7f230e6d44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)
#13 0x7f230e4a7fd3 in start_thread nptl/./nptl/pthread_create.c:442:8
#14 0x7f230e5285bb in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

0x6140005997b0 is located 368 bytes inside of 392-byte region [0x614000599640,0x6140005997c8)
freed by thread T1 here:
#0 0x55cd9e9849cd in operator delete(void*) (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x7db9cd) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x55cd9ec6d0ac in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:632:2
#2 0x55cd9ec6d0ac in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2495:7
#3 0x55cd9ec6cec5 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2509:4
#4 0x55cd9ec6cb07 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::erase(std::pair<tr_address, tr_port> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2520:7
#5 0x55cd9ec4f931 in (anonymous namespace)::handshake_helpers::on_handshake_done(tr_peerMgr
, tr_handshake::Result const&) /home/kaka/code/transmission/libtransmission/peer-mgr.cc
#6 0x55cd9eda62dd in tr_handshake::fire_done(bool) /home/kaka/code/transmission/libtransmission/handshake.cc:840:26
#7 0x55cd9eda7be5 in tr_handshake::done(bool) /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:150:16
#8 0x55cd9ed9ed7d in tr_handshake::read_peer_id(tr_peerIo*) /home/kaka/code/transmission/libtransmission/handshake.cc:437:12
#9 0x55cd9eda4697 in tr_handshake::can_read(tr_peerIo*, void*, unsigned long*) /home/kaka/code/transmission/libtransmission/handshake.cc:700:30
#10 0x55cd9ec259d7 in tr_peerIo::can_read_wrapper() /home/kaka/code/transmission/libtransmission/peer-io.cc:357:56
#11 0x55cd9ec262b5 in tr_peerIo::try_read(unsigned long) /home/kaka/code/transmission/libtransmission/peer-io.cc:436:9
#12 0x55cd9ebcb2e5 in tr_bandwidth::phase_one(std::vector<tr_peerIo*, std::allocator<tr_peerIo*> >&, tr_direction) /home/kaka/code/transmission/libtransmission/bandwidth.cc:188:47
#13 0x55cd9ebcbd12 in tr_bandwidth::allocate(unsigned int) /home/kaka/code/transmission/libtransmission/bandwidth.cc:246:9
#14 0x55cd9ec3e63a in tr_peerMgr::bandwidthPulse() /home/kaka/code/transmission/libtransmission/peer-mgr.cc:2202:29
#15 0x55cd9ee5cd12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#16 0x55cd9ee5cd12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#17 0x55cd9ee3f6c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#18 0x55cd9ee3f6c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#19 0x55cd9ed1d274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#20 0x7f230e6d44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)

previously allocated by thread T1 here:
#0 0x55cd9e98416d in operator new(unsigned long) (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x7db16d) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x55cd9ec31a39 in std::_Rb_tree_node<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >* std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:611:23
#2 0x55cd9ec31a39 in std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_Auto_node::_Auto_node<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >&, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:1636:18
#3 0x55cd9ec31a39 in std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > std::_Rb_tree<std::pair<tr_address, tr_port>, std::pair<std::pair<tr_address, tr_port> const, tr_handshake>, std::_Select1st<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tree.h:2461:13
#4 0x55cd9ec31a39 in std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > std::map<std::pair<tr_address, tr_port>, tr_handshake, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::emplace_hint<std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&> >(std::_Rb_tree_const_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, std::piecewise_construct_t const&, std::tuple<std::pair<tr_address, tr_port>&&>&&, std::tuple<HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&>&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_map.h:638:16
#5 0x55cd9ec31a39 in std::pair<std::_Rb_tree_iterator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> >, bool> std::map<std::pair<tr_address, tr_port>, tr_handshake, std::less<std::pair<tr_address, tr_port> >, std::allocator<std::pair<std::pair<tr_address, tr_port> const, tr_handshake> > >::try_emplace<HandshakeMediator*, std::shared_ptr<tr_peerIo>, tr_encryption_mode, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1>(std::pair<tr_address, tr_port>&&, HandshakeMediator*&&, std::shared_ptr<tr_peerIo>&&, tr_encryption_mode&&, tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&)::$_1&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_map.h:743:14
#6 0x55cd9ec31a39 in tr_peerMgrAddIncoming(tr_peerMgr*, tr_peer_socket&&) /home/kaka/code/transmission/libtransmission/peer-mgr.cc:1116:38
#7 0x55cd9ea13279 in tr_session::onIncomingPeerConnection(int, void*) /home/kaka/code/transmission/libtransmission/session.cc:382:18
#8 0x55cd9ee5cd12 in event_persist_closure /home/kaka/code/transmission/third-party/libevent/event.c:1623:9
#9 0x55cd9ee5cd12 in event_process_active_single_queue /home/kaka/code/transmission/third-party/libevent/event.c:1682:4
#10 0x55cd9ee3f6c7 in event_process_active /home/kaka/code/transmission/third-party/libevent/event.c
#11 0x55cd9ee3f6c7 in event_base_loop /home/kaka/code/transmission/third-party/libevent/event.c:2006:12
#12 0x55cd9ed1d274 in tr_session_thread_impl::sessionThreadFunc(event_base*) /home/kaka/code/transmission/libtransmission/session-thread.cc:245:9
#13 0x7f230e6d44a2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd44a2) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)

Thread T1 created by T0 here:
#0 0x55cd9e93281c in __interceptor_pthread_create (/home/kaka/code/transmission/build/daemon/transmission-daemon+0x78981c) (BuildId: 8da23d6841e56710568b4e5dbb16c82e65fe63fb)
#1 0x7f230e6d4578 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_deletestd::thread::_State >, void ()()) (/lib/x86_64-linux-gnu/libstdc++.so.6+0xd4578) (BuildId: 0c47cec75226c7736517d5acb61e373d541a5023)
#2 0x55cd9ed1cac9 in tr_session_thread_impl::tr_session_thread_impl() /home/kaka/code/transmission/libtransmission/session-thread.cc:161:19
#3 0x55cd9ed1a90a in std::__detail::_MakeUniq<tr_session_thread_impl>::__single_object std::make_unique<tr_session_thread_impl>() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:34
#4 0x55cd9ed1a90a in tr_session_thread::create() /home/kaka/code/transmission/libtransmission/session-thread.cc:298:12
#5 0x55cd9ea24334 in tr_session::tr_session(std::basic_string_view<char, std::char_traits >, tr_variant
) /home/kaka/code/transmission/libtransmission/session.cc:2137:24
#6 0x55cd9ea15766 in tr_sessionInit(char const*, bool, tr_variant*) /home/kaka/code/transmission/libtransmission/session.cc:583:31
#7 0x55cd9e989116 in tr_daemon::start(bool) /home/kaka/code/transmission/daemon/daemon.cc:707:15
#8 0x55cd9e9df61b in tr_daemon::spawn(bool, int*, tr_error**) /home/kaka/code/transmission/daemon/daemon-posix.cc:184:18
#9 0x55cd9e98da7f in main /home/kaka/code/transmission/daemon/daemon.cc:947:17
#10 0x7f230e446189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: heap-use-after-free /home/kaka/code/transmission/libtransmission/../libtransmission/handshake.h:175:29 in tr_handshake::state_string() const
Shadow bytes around the buggy address:
0x0c28800ab2a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c28800ab2b0: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa
0x0c28800ab2c0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
0x0c28800ab2d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c28800ab2e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c28800ab2f0: fd fd fd fd fd fd[fd]fd fd fa fa fa fa fa fa fa
0x0c28800ab300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800ab310: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800ab320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800ab330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c28800ab340: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
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
==39849==ABORTING

@ckerr
Copy link
Member

ckerr commented Jul 1, 2023

Well looks like it agrees with Valgrind 🤷‍♂️ so even though I don't understand the crash yet, I know where to keep looking 😸

@ckerr ckerr added bug:regression and removed needs clarification More info is needed before work can proceed needs confirmation Issue has not been tested or can't be reproduced labels Jul 1, 2023
@ckerr ckerr self-assigned this Jul 1, 2023
@lindianfeng
Copy link
Author

Well looks like it agrees with Valgrind 🤷‍♂️ so even though I don't understand the crash yet, I know where to keep looking 😸

ok! contact me if you need my help

@ckerr
Copy link
Member

ckerr commented Jul 1, 2023

@tearfur, just brainstorming... if there is a bug in #5651 that I can't see, that could cause the wrong handshake to be removed from incoming_handshakes...? I am doubtful that this is the problem but tr_address::compare() deserves a second look

@lindianfeng you could test this theory ^ from a local build by running $ git revert 70decc1d9dfbdc46112c29fdf38f829d34f6e867 -> rebuilding -> retesting. I don't have high confidence in this theory but it's worth testing, even if just to mark it off the list of suspects 😸

@lindianfeng
Copy link
Author

@ckerr i test it ,'git revert 70decc1'

I'll test it right away, and I'll report it if I get the results

@tearfur
Copy link
Member

tearfur commented Jul 1, 2023

@lindianfeng I think you are right... For example 223.18.245.229 - 8.8.8.8 should return a positive number, but under int (assuming 32-bit), it will be a negative number...

@ckerr #5651 should be reverted for now, and some new tests are needed. Perhaps this will be worth reconsidering if we ever move to C++20, where we have <=>.

@lindianfeng
Copy link
Author

revert after it work fine

Loaded: loaded (/lib/systemd/system/transmission-daemon.service; enabled; preset: enabled)
Active: active (running) since Sat 2023-07-01 12:54:00 CST; 3h 35min ago
Main PID: 71021 (transmission-da)
Status: "Uploading 3412.00 KBps, Downloading 6.44 KBps."
Tasks: 3 (limit: 18858)
Memory: 13.1G
CPU: 27min 26.269s
CGroup: /system.slice/transmission-daemon.service
└─71021 /usr/bin/transmission-daemon -f --log-level=error

@tearfur
Copy link
Member

tearfur commented Jul 1, 2023

@lindianfeng Would you please help test #5709?

@lindianfeng
Copy link
Author

@lindianfeng Would you please help test #5709?

OK,I'll test it when I get home

@lindianfeng
Copy link
Author

@lindianfeng Would you please help test #5709?

image

i am already build it and testing

@ckerr
Copy link
Member

ckerr commented Jul 1, 2023

I think you are right... For example 223.18.245.229 - 8.8.8.8 should return a positive number, but under int (assuming 32-bit), it will be a negative number...

@tearfur I don't think I understand this bug yet. Even if tr_address::compare() isn't not sorting them in correct ascending order, the std::map ought to work as long as it's sorting them in a consistent order?

@lindianfeng you've been super helpful with testing out ideas + valgrind + asan like this. Thank you!! I wish all bug reporters were this helpful 🙇‍♂️

@tearfur
Copy link
Member

tearfur commented Jul 1, 2023

@ckerr Me neither, but reverting the PR is the least I can do now.

I agree that tr_address::compare() should sort in a consistent order even in its bugged state.

@lindianfeng
Copy link
Author

I think you are right... For example 223.18.245.229 - 8.8.8.8 should return a positive number, but under int (assuming 32-bit), it will be a negative number...

@tearfur I don't think I understand this bug yet. Even if tr_address::compare() isn't not sorting them in correct ascending order, the std::map ought to work as long as it's sorting them in a consistent order?

@lindianfeng you've been super helpful with testing out ideas + valgrind + asan like this. Thank you!! I wish all bug reporters were this helpful 🙇‍♂️

I am very glad to help you, I am doing c++ development and developing the games

@lindianfeng
Copy link
Author

The good news is that after the fallback, the crash hasn't happened yet

@lindianfeng
Copy link
Author

@ckerr Me neither, but reverting the PR is the least I can do now.

I agree that tr_address::compare() should sort in a consistent order even in its bugged state.

can chang std::map to std::unordered_map?

@ckerr
Copy link
Member

ckerr commented Jul 1, 2023

That could help, but tr_address::compare() is used elsewhere too so we can't leave it broken. IMO 5709 is the best fix for right now.

@ckerr
Copy link
Member

ckerr commented Jul 1, 2023

Oh and since it's merged I guess I should close this ticket 😸 but @lindianfeng if this issue comes back and/or if you see any others feel free to give a yell.

Actually we can always use more C++ developers so feel free to check out the any of the open tickets as well 😉

@ckerr ckerr closed this as completed Jul 1, 2023
@lindianfeng
Copy link
Author

lindianfeng commented Jul 2, 2023

I think you are right... For example 223.18.245.229 - 8.8.8.8 should return a positive number, but under int (assuming 32-bit), it will be a negative number...

@tearfur I don't think I understand this bug yet. Even if tr_address::compare() isn't not sorting them in correct ascending order, the std::map ought to work as long as it's sorting them in a consistent order?

@lindianfeng you've been super helpful with testing out ideas + valgrind + asan like this. Thank you!! I wish all bug reporters were this helpful 🙇‍♂️

if int64_t{ ntohl(this->addr.addr4.s_addr) } - ntohl(that.addr.addr4.s_addr) result is 0x100000000000 ,cast to int it will is the zero, return equal ,in fact they are not equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants