libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Unhandled exception thrown by Boost.Asio

Open glassez opened this issue 2 years ago • 16 comments

There are many crash reports in qBittorrent bug tracker that point to unhandled exception thrown in boost::asio::detail::socket_select_interrupter::open_descriptors. IIRC, exception is often thrown once some VPN service is enabled during qBittorrent run.

glassez avatar Apr 07 '23 11:04 glassez

Yet another related crash report, but qBittorrent is crashed after hibernation: https://github.com/qbittorrent/qBittorrent/issues/18823.

glassez avatar Apr 09 '23 08:04 glassez

@arvidn Going over chriskohlhoff/asio#1061 (comment) & chriskohlhoff/asio#1061 (comment) - I don't know if this is related/relevant but the only place left in libtorrent code that wasn't changed from async_receive to async_receive_from was in ip_notifier.cpp

https://github.com/arvidn/libtorrent/blob/6d64ac1dadb17df1c5719eb66179ac47e95eba12/src/ip_notifier.cpp#L155 &

https://github.com/arvidn/libtorrent/blob/6d64ac1dadb17df1c5719eb66179ac47e95eba12/src/ip_notifier.cpp#L218

What if there's a socket failure/error not properly being handled??

xavier2k6 avatar Apr 09 '23 13:04 xavier2k6

@arvidn Reproducible steps in https://github.com/qbittorrent/qBittorrent/issues/18811#issuecomment-1501165433

xavier2k6 avatar Apr 09 '23 16:04 xavier2k6

@arvidn Ping

xavier2k6 avatar May 21 '23 13:05 xavier2k6

I see you're prepping 2.0.9 / 1.2.19 for release, would a fix for this issue make it in to these versions by any chance?

xavier2k6 avatar May 21 '23 14:05 xavier2k6

I don't believe there is a fix

arvidn avatar May 21 '23 15:05 arvidn

I don't know if this is related/relevant but the only place left in libtorrent code that wasn't changed from async_receive to async_receive_from was in ip_notifier.cpp

Chris' comment was about using null_buffers instead of allocating the receive buffer up-front. In more recent versions of asio, null_buffers have been replaced by async_wait() on sockets. This is still done on the UDP socket.

arvidn avatar May 21 '23 15:05 arvidn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 17 '23 01:09 stale[bot]

keep alive

xavier2k6 avatar Sep 26 '23 22:09 xavier2k6

  • #3311

First record/reference of issue with boost::asio::detail::socket_select_interrupter::open_descriptors

xavier2k6 avatar Oct 26 '23 21:10 xavier2k6

We are still getting crash reports of this over at qBittorrent.

xavier2k6 avatar Nov 14 '23 14:11 xavier2k6

I suspect I would need to not use async_wait() on sockets.

arvidn avatar Nov 14 '23 14:11 arvidn