qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.47k stars 3.99k forks source link

Crash when changing locations of multiple torrents #21827

Closed Steve-Hendrickson closed 22 hours ago

Steve-Hendrickson commented 1 week ago

qBittorrent & operating system versions

qBittorrent version: v5.0.1 (64-bit) Libtorrent version: 1.2.19.0 Qt version: 6.7.3 Boost version: 1.86.0 OpenSSL version: 3.4.0 zlib version: 1.3.1 OS version: Windows 10 Version 22H2 10.0.19045 x86_64

Caught signal: SIGSEGV

What is the problem?

Crash when changing file location of multiple files 10 - 20 or more at once. It doesn't happen every time, but it has happened about 3 times now.

Steps to reproduce

  1. Select multiple files to change location.
  2. Right click and select "Set location"
  3. Browse to the new directory to point to the file.
  4. Only seems to crash when selecting many files at once.

Additional context

I replaced a hard drive and with qbit closed, I moved all files to the new drive. When I opened qbit, all of my torrents (close to 1000) show the "Missing Files" message. When I select many files at once, and browse to the new drive, qbit will crash almost immediately. Sometimes all file locations are updated and sometimes they are not. So far I have not experienced a crash when only selecting a few files at once, only when selecting a large amount at once, (more than 10).

Log(s) & preferences file(s)

qBittorrent version: v5.0.1 (64-bit) Libtorrent version: 1.2.19.0 Qt version: 6.7.3 Boost version: 1.86.0 OpenSSL version: 3.4.0 zlib version: 1.3.1 OS version: Windows 10 Version 22H2 10.0.19045 x86_64

Caught signal: SIGSEGV

 0# boost::stacktrace::basic_stacktrace >::init at G:\QBITTORRENT\boost_1_86_0\boost\stacktrace\stacktrace.hpp:111
 1# getStacktrace at G:\QBITTORRENT\qbt-src-5.0.1\src\app\stacktrace.cpp:35
 2# `anonymous namespace'::abnormalExitHandler at G:\QBITTORRENT\qbt-src-5.0.1\src\app\signalhandler.cpp:103
 3# _seh_filter_exe at minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp:219
 4# `__scrt_common_main_seh'::`1'::filt$0 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:304
 5# __C_specific_handler at D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp:389
 6# _chkstk in ntdll
 7# RtlRaiseException in ntdll
 8# KiUserExceptionDispatcher in ntdll
 9# libtorrent::file_storage::file_path at G:\QBITTORRENT\libtorrent\src\file_storage.cpp:824
10# BitTorrent::TorrentImpl::actualFilePath at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:980
11# BitTorrent::TorrentImpl::handleFileCompletedAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:2349
12# BitTorrent::SessionImpl::dispatchTorrentAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5715
13# BitTorrent::SessionImpl::handleAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5605
14# BitTorrent::SessionImpl::readAlerts at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5492
15# QMetaCallEvent::placeMetaCall in qbittorrent
16# QObject::event in qbittorrent
17# QApplicationPrivate::notify_helper in qbittorrent
18# QApplication::notify in qbittorrent
19# QCoreApplication::notifyInternal2 in qbittorrent
20# QCoreApplicationPrivate::sendPostedEvents in qbittorrent
21# QWindowsGuiEventDispatcher::sendPostedEvents in qbittorrent
22# QEventDispatcherWin32::processEvents in qbittorrent
23# QWindowsGuiEventDispatcher::processEvents in qbittorrent
24# QEventLoop::exec in qbittorrent
25# QCoreApplication::exec in qbittorrent
26# Application::exec at G:\QBITTORRENT\qbt-src-5.0.1\src\app\application.cpp:975
27# main at G:\QBITTORRENT\qbt-src-5.0.1\src\app\main.cpp:328
28# QSqlCachedResult::setNumericalPrecisionPolicy in qbittorrent
29# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
30# BaseThreadInitThunk in KERNEL32
31# RtlUserThreadStart in ntdll
glassez commented 1 week ago

I replaced a hard drive and with qbit closed, I moved all files to the new drive. When I opened qbit, all of my torrents (close to 1000) show the "Missing Files" message. When I select many files at once, and browse to the new drive, qbit will crash almost immediately.

Have you tried to reproduce it by moving non-"Missing Files" torrents?

Steve-Hendrickson commented 1 week ago

I have not tried moving non-missing files. I'm currently force rechecking about 600 torrents at the moment and I want to wait until they complete before attempting that. So it might be a couple days before I can troubleshoot further. I'll keep you posted.

ntompkins commented 1 week ago

I'm seeing the same behavior on my machine as well. I created a new subfolder on my drive to move completed torrents into, and as I select a large number of torrents and choose "Set Location", qB crashes in a reproducible way. I was able to generate the following crash twice in a row by doing this process.

qBittorrent version: v5.0.1 (64-bit)
Libtorrent version: 1.2.19.0
Qt version: 6.7.3
Boost version: 1.86.0
OpenSSL version: 3.4.0
zlib version: 1.3.1
OS version: Windows 10 Version 22H2 10.0.19045 x86_64

Caught signal: SIGSEGV
 0# boost::stacktrace::basic_stacktrace >::init at G:\QBITTORRENT\boost_1_86_0\boost\stacktrace\stacktrace.hpp:111
 1# getStacktrace at G:\QBITTORRENT\qbt-src-5.0.1\src\app\stacktrace.cpp:35
 2# `anonymous namespace'::abnormalExitHandler at G:\QBITTORRENT\qbt-src-5.0.1\src\app\signalhandler.cpp:103
 3# _seh_filter_exe at minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp:219
 4# `__scrt_common_main_seh'::`1'::filt$0 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:304
 5# __C_specific_handler at D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp:389
 6# _chkstk in ntdll
 7# RtlRaiseException in ntdll
 8# KiUserExceptionDispatcher in ntdll
 9# libtorrent::file_storage::file_path at G:\QBITTORRENT\libtorrent\src\file_storage.cpp:824
10# BitTorrent::TorrentImpl::actualFilePath at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:980
11# BitTorrent::TorrentImpl::handleFileCompletedAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:2349
12# BitTorrent::SessionImpl::dispatchTorrentAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5715
13# BitTorrent::SessionImpl::handleAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5605
14# BitTorrent::SessionImpl::readAlerts at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5492
15# QMetaCallEvent::placeMetaCall in qbittorrent
16# QObject::event in qbittorrent
17# QApplicationPrivate::notify_helper in qbittorrent
18# QApplication::notify in qbittorrent
19# QCoreApplication::notifyInternal2 in qbittorrent
20# QCoreApplicationPrivate::sendPostedEvents in qbittorrent
21# QWindowsGuiEventDispatcher::sendPostedEvents in qbittorrent
22# QEventDispatcherWin32::processEvents in qbittorrent
23# QWindowsGuiEventDispatcher::processEvents in qbittorrent
24# QEventLoop::exec in qbittorrent
25# QCoreApplication::exec in qbittorrent
26# Application::exec at G:\QBITTORRENT\qbt-src-5.0.1\src\app\application.cpp:975
27# main at G:\QBITTORRENT\qbt-src-5.0.1\src\app\main.cpp:328
28# QSqlCachedResult::setNumericalPrecisionPolicy in qbittorrent
29# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
30# BaseThreadInitThunk in KERNEL32
31# RtlUserThreadStart in ntdll
glassez commented 1 week ago

I'm seeing the same behavior on my machine as well. I created a new subfolder on my drive to move completed torrents into, and as I select a large number of torrents and choose "Set Location", qB crashes in a reproducible way. I was able to generate the following crash twice in a row by doing this process.

Would you mind to provide detailed "steps to reproduce"?

Catopus commented 1 week ago

@glassez I tried moving some torrents, and incremented the number of torrents moved each time. The reason to move them is due to changing hard drive, and the torrents shows up as 0% with Stopped or Missing Files statuses, but the location they move to has the actual 100% finished files.

Moving a single torrent doesn't crash, nor 5, 10, or 20. But when I moved over a 100 torrents, qBittorrent still continues to run, download, upload, and move the 100+ torrents. The only difference is that the red "qBittorrent has crashed" dialog pops up, preventing interaction with the qBittorrent window. I would guess that the client can still work fine if not for that dialog.

My stack trace is similar to ntompkins's, but I'm using v5.0.0 with libtorrent 1.2.19.

exchange12rocks commented 5 days ago

Same crash on my machine. Steps to reproduce:

  1. Download ~20 torrents (~500 MB, 20 files each) into a single location (Each torrent into their own subfolder).
  2. Stop the torrents.
  3. Move their files to another location.
  4. Start the torrents in qBittorrent - they should become "errored".
  5. Select all the torrents and use the "Set location" context menu item.
  6. Select the location where you moved their files.
  7. Enjoy the crash.

I also renamed some folders/files on the content tab of the qBittorrent interface - maybe that's important

qBittorrent version: v5.0.1 (64-bit) Libtorrent version: 1.2.19.0 Qt version: 6.7.3 Boost version: 1.86.0 OpenSSL version: 3.4.0 zlib version: 1.3.1 OS version: Windows Server 2019 Version 1809 10.0.17763 x86_64

Caught signal: SIGSEGV

 0# boost::stacktrace::basic_stacktrace >::init at G:\QBITTORRENT\boost_1_86_0\boost\stacktrace\stacktrace.hpp:111
 1# getStacktrace at G:\QBITTORRENT\qbt-src-5.0.1\src\app\stacktrace.cpp:35
 2# `anonymous namespace'::abnormalExitHandler at G:\QBITTORRENT\qbt-src-5.0.1\src\app\signalhandler.cpp:103
 3# _seh_filter_exe at minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp:219
 4# `__scrt_common_main_seh'::`1'::filt$0 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:304
 5# __C_specific_handler at D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp:389
 6# _chkstk in ntdll
 7# RtlWalkFrameChain in ntdll
 8# KiUserExceptionDispatcher in ntdll
 9# libtorrent::file_storage::file_path at G:\QBITTORRENT\libtorrent\src\file_storage.cpp:824
10# BitTorrent::TorrentImpl::actualFilePath at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:980
11# BitTorrent::TorrentImpl::handleFileCompletedAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:2349
12# BitTorrent::SessionImpl::dispatchTorrentAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5715
13# BitTorrent::SessionImpl::handleAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5605
14# BitTorrent::SessionImpl::readAlerts at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5492
15# QMetaCallEvent::placeMetaCall in qbittorrent
16# QObject::event in qbittorrent
17# QApplicationPrivate::notify_helper in qbittorrent
18# QApplication::notify in qbittorrent
19# QCoreApplication::notifyInternal2 in qbittorrent
20# QCoreApplicationPrivate::sendPostedEvents in qbittorrent
21# QWindowsGuiEventDispatcher::sendPostedEvents in qbittorrent
22# QEventDispatcherWin32::processEvents in qbittorrent
23# QWindowsGuiEventDispatcher::processEvents in qbittorrent
24# QEventLoop::exec in qbittorrent
25# QCoreApplication::exec in qbittorrent
26# Application::exec at G:\QBITTORRENT\qbt-src-5.0.1\src\app\application.cpp:975
27# main at G:\QBITTORRENT\qbt-src-5.0.1\src\app\main.cpp:328
28# QSqlCachedResult::setNumericalPrecisionPolicy in qbittorrent
29# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
30# BaseThreadInitThunk in KERNEL32
31# RtlUserThreadStart in ntdll
scrappy commented 5 days ago

Hate throwing in "me toos", but same steps as @exchange12rocks above ... stack trace:

qBittorrent version: v5.0.1 (64-bit)
Libtorrent version: 1.2.19.0
Qt version: 6.7.3
Boost version: 1.86.0
OpenSSL version: 3.4.0
zlib version: 1.3.1
OS version: Windows 11 Version 23H2 10.0.22631 x86_64

Caught signal: SIGSEGV
 0# boost::stacktrace::basic_stacktrace >::init at G:\QBITTORRENT\boost_1_86_0\boost\stacktrace\stacktrace.hpp:111
 1# getStacktrace at G:\QBITTORRENT\qbt-src-5.0.1\src\app\stacktrace.cpp:35
 2# `anonymous namespace'::abnormalExitHandler at G:\QBITTORRENT\qbt-src-5.0.1\src\app\signalhandler.cpp:103
 3# _seh_filter_exe at minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp:219
 4# `__scrt_common_main_seh'::`1'::filt$0 at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:304
 5# __C_specific_handler at D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp:389
 6# _chkstk in ntdll
 7# RtlFindCharInUnicodeString in ntdll
 8# KiUserExceptionDispatcher in ntdll
 9# libtorrent::file_storage::file_path at G:\QBITTORRENT\libtorrent\src\file_storage.cpp:824
10# BitTorrent::TorrentImpl::actualFilePath at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:980
11# BitTorrent::TorrentImpl::handleFileCompletedAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\torrentimpl.cpp:2349
12# BitTorrent::SessionImpl::dispatchTorrentAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5715
13# BitTorrent::SessionImpl::handleAlert at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5605
14# BitTorrent::SessionImpl::readAlerts at G:\QBITTORRENT\qbt-src-5.0.1\src\base\bittorrent\sessionimpl.cpp:5492
15# QMetaCallEvent::placeMetaCall in qbittorrent
16# QObject::event in qbittorrent
17# QApplicationPrivate::notify_helper in qbittorrent
18# QApplication::notify in qbittorrent
19# QCoreApplication::notifyInternal2 in qbittorrent
20# QCoreApplicationPrivate::sendPostedEvents in qbittorrent
21# QWindowsGuiEventDispatcher::sendPostedEvents in qbittorrent
22# QEventDispatcherWin32::processEvents in qbittorrent
23# QWindowsGuiEventDispatcher::processEvents in qbittorrent
24# QEventLoop::exec in qbittorrent
25# QCoreApplication::exec in qbittorrent
26# Application::exec at G:\QBITTORRENT\qbt-src-5.0.1\src\app\application.cpp:975
27# main at G:\QBITTORRENT\qbt-src-5.0.1\src\app\main.cpp:328
28# QSqlCachedResult::setNumericalPrecisionPolicy in qbittorrent
29# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
30# BaseThreadInitThunk in KERNEL32
31# RtlUserThreadStart in ntdll
scrappy commented 5 days ago

One thing to note ... this appears to be cumulative ... if I do a big batch or if a do a series of little batches, it will trigger a crash ... as if there is some threshold it is reaching ... something like number of open files?

scrappy commented 4 days ago

Bug appears to be fixed in v5.0.2 ... just upgraded to it, and moved >100 at once, no crash ... don't see anything in Changelog for this though, so maybe I just got lucky?

glassez commented 4 days ago

Bug appears to be fixed in v5.0.2 ... just upgraded to it, and moved >100 at once, no crash ... don't see anything in Changelog for this though, so maybe I just got lucky?

It isn't still fixed. Since race conditions play a role in this issue, you may not experience a crash every time. Working on it...