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

I2P: crash while seeding in mixed mode #7387

Closed
Vort opened this issue Apr 13, 2023 · 6 comments
Closed

I2P: crash while seeding in mixed mode #7387

Vort opened this issue Apr 13, 2023 · 6 comments
Milestone

Comments

@Vort
Copy link
Contributor

Vort commented Apr 13, 2023

Sometimes when torrents are seeding, assertion failure happens.
I was able to reproduce it with such settings and with 5 torrents seeding:
--allow_i2p_mixed=true --i2p_hostname=127.0.0.1 --i2p_port=7656 --i2p_inbound_quantity=8 --i2p_outbound_quantity=8 --i2p_inbound_length=1 --i2p_outbound_length=1
Most likely, mixed mode is important for reproduction and quantity/length are not, but who knows - bug happens randomly.

It happens on this line:

TORRENT_ASSERT(!data.empty());

libtorrent::assert_fail assert.cpp:362
libtorrent::lcrypto::hasher256::update hasher.cpp:216
libtorrent::lcrypto::hasher256::hasher256 hasher.cpp:181
libtorrent::bt_peer_connection::get_specific_peer_info bt_peer_connection.cpp:496
libtorrent::peer_connection::get_peer_info peer_connection.cpp:4613
libtorrent::torrent::get_peer_info torrent.cpp:7267
libtorrent::torrent::post_peer_info torrent.cpp:7274
libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}::operator()() const torrent_handle.cpp:130
boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}>::operator()() bind_handler.hpp:60
boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}>, boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}> >(boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}>&, boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}>&) handler_invoke_helpers.hpp:51
boost::asio::detail::executor_op<boost::asio::detail::binder0<libtorrent::torrent_handle::async_call<void (libtorrent::torrent::*)()>(void (libtorrent::torrent::*)()) const::{lambda()#1}>, std::__1::allocator<void>, boost::asio::detail::win_iocp_operation>::do_complete(void*, boost::asio::detail::win_iocp_operation*, boost::system::error_code const&, unsigned long long) executor_op.hpp:70
boost::asio::detail::win_iocp_operation::complete win_iocp_operation.hpp:47
boost::asio::detail::win_iocp_io_context::do_one win_iocp_io_context.ipp:473
boost::asio::detail::win_iocp_io_context::run win_iocp_io_context.ipp:204
boost::asio::io_context::run io_context.ipp:63
libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0::operator()() const session.cpp:344
std::__1::__invoke[abi:v15007]<libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>(libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0&&) invoke.h:394
std::__1::__thread_execute[abi:v15007]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>&, std::__1::__tuple_indices<>) thread:284
std::__1::__thread_proxy[abi:v15007]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0> >(void*) thread:295
ucrtbase!_crt_at_quick_exit 0x000007fef5c5be1d
KERNEL32!BaseThreadInitThunk 0x00000000770f55dd
ntdll!RtlUserThreadStart 0x0000000077352b1d

libtorrent version (or branch): 96d055b + #7354
platform/architecture: Windows x64
compiler and compiler version: clang 15.0.7

@arvidn
Copy link
Owner

arvidn commented Apr 14, 2023

it looks like the destination address of the peer is an empty string. which is unexpected

@arvidn
Copy link
Owner

arvidn commented Apr 14, 2023

could you try this? #7390

@Vort Vort changed the title I2P: crash while seeding I2P: crash while seeding in mixed mode Apr 14, 2023
@arvidn
Copy link
Owner

arvidn commented Apr 16, 2023

@Vort thanks for your report and analysis. I have a new patch in the works.

@arvidn
Copy link
Owner

arvidn commented Apr 16, 2023

#7392

I don't think the mixed-mode makes a difference. As far as I can tell, just any incoming i2p connections were a problem.

@Vort
Copy link
Contributor Author

Vort commented Apr 16, 2023

I don't think the mixed-mode makes a difference. As far as I can tell, just any incoming i2p connections were a problem.

After I found mismatch between object types (ipv4_peer / i2p_peer), I also thought that mixed mode should not make difference.
However I made additional tests and they showed that without mixed mode there was no crash for many hours, when with mixed mode crash happened in ~10-30 minutes.
Maybe it is just "luck", maybe some unaccounted factors exists.
However it looks like there are no much sense in trying figuring it out now.
Instead I will just test #7392 and post additional message when I will have some results.

@Vort
Copy link
Contributor Author

Vort commented Apr 17, 2023

Solved with #7392. Thanks.

@Vort Vort closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants