-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
unhandled exception in select_reactor thread leads to process termination #1061
Comments
@chriskohlhoff sorry for the ping but please take a look into this issue. A lot of qBittorrent users are suffering from crash on VPN/Network interface disconnect due to this bug. |
@arvidn I may have missed some, but as far as I can tell these are the only places that libtorrent uses reactor-style operations on sockets:
Is there a reason they cannot be changed to receive directly into a buffer and endpoint as class data members? On modern Windows these would be the only operations that trigger creation of the |
Commit 4709210 moves the N.B. I still recommend changing those places to use |
@chriskohlhoff Has this made it in to upcoming Boost 1.80? |
It will. |
It seems there are still related crashes albeit the user says it occurs less than before: This is using boost 1.80 with libtorrent 7bb4b410d704e13d73d0f02d85192d59dff1fb5e on RC_2_0. Taken from qbittorrent/qBittorrent#17082 (comment):
|
The
select_reactor
has asocket_select_interrupter
object used to signal an interruption via. It has a long-lived socket that's added to theselect()
call to make it wake up on an interruption.This long lived socket can sometimes be closed and has to be recreated. For example if the computer hibernates or if the network stack is restarted. To handle this, the interrupter sockets are recreated if reading from it fails. This is
socket_select_interrupter::recreate()
.Recreating this socket may fail with an exception. This exception will flow out of the call to
run()
, expected to be handled by the application.The problem occurs in the
select_reactor
, which on windows spawns a thread. The thread callsrun()
andpost_deferred_completions()
in a loop untilstop_thread_
is set. (socket_reactor::run_thread()
)There is nothing catching exceptions at the top level of this thread. So when
recreate()
fails, the process is terminated.An example stack trace from windows:
related ticket: qbittorrent/qBittorrent#17082
The text was updated successfully, but these errors were encountered: