-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ASSERT: "first <= last" in file src/base/indexrange.h, line 45 #10611
Comments
This line looks weird to me: |
I made that change and retried. I see no sign of error, though I do not understand from the change what I should look for. |
Whether qbt still dump the back trace when you add the same torrent as in your opening post. If none then it is good. I'm afraid I'll need more info before making a good fix, could you modify the code segment as below: const libt::file_storage &files = nativeInfo()->files();
const auto fileSize = files.file_size(LTFileIndex {fileIndex});
const auto fileOffset = files.file_offset(LTFileIndex {fileIndex});
printf("fileOffset: %ld\n", fileOffset);
printf("pieceLength: %d\n", pieceLength());
printf("fileSize : %ld\n", fileSize);
return makeInterval(static_cast<int>(fileOffset / pieceLength()),
static_cast<int>((fileOffset + fileSize - 1) / pieceLength())); Insert the 3 Or if possible, you can share the torrent hash. |
Adding the torrent file again did not cause an error. All appears to run normally afterwards. I continue to run in GDB. If I encounter an error that appears related, I will re-open the issue. |
@Golutazem |
Sorry. I no longer have the file or the hash and could not identify it again. I have added the diagnostic output to the build so that if it occurs again I can give more output. |
When fileSize == 0, the second index could be smaller than the first index, thus trigger the assert check in IndexInterval constructor. Closes qbittorrent#10611.
When fileSize == 0, the second index could be smaller than the first index, thus trigger the assert check in IndexInterval constructor. Closes qbittorrent#10611.
Debug build compiled from Git Head checked out today.
GNU+Linux+Xorg with Qt 5.12.3 , libtorrent-rasterbar 1:1.1.12
Steps to reproduce
Add a torrent file from the file select dialogue.
Resulted in
ASSERT: "first <= last" in file src/base/indexrange.h, line 45
BackTrace:
#2 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#3 in qt_assert(char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
#4 in IndexInterval::IndexInterval (last=3506, first=3507, this=) at /usr/include/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp:125
#5 makeInterval (last=3506, first=3507) at src/base/indexrange.h:66
#6 BitTorrent::TorrentInfo::filePieces (this=this@entry=0x7fffffffd1f0, fileIndex=fileIndex@entry=4682)
at src/base/bittorrent/torrentinfo.cpp:368
#7 in BitTorrent::TorrentHandle::setFirstLastPiecePriorityImpl (this=this@entry=0x5555607ca410, enabled=false, updatedFilePrio=...)
at src/base/bittorrent/torrenthandle.cpp:1394
#8 in BitTorrent::TorrentHandle::setFirstLastPiecePriority (this=this@entry=0x5555607ca410, enabled=) at /usr/include/qt/QtCore/qarraydata.h:257
#9 in BitTorrent::TorrentHandle::TorrentHandle (this=0x5555607ca410, session=, nativeHandle=..., params=...)
at src/base/bittorrent/torrenthandle.cpp:206
#10 in BitTorrent::Session::createTorrentHandle (this=0x5555561ae1e0, nativeHandle=...)
at src/base/bittorrent/session.cpp:3842
#11 in BitTorrent::Session::handleAddTorrentAlert (this=this@entry=0x5555561ae1e0, p=p@entry=0x7fff72e7d2e8)
at src/base/bittorrent/session.cpp:3899
#12 in BitTorrent::Session::handleAlert (this=this@entry=0x5555561ae1e0, a=0x7fff72e7d2e8)
at src/base/bittorrent/session.cpp:3786
#13 in BitTorrent::Session::readAlerts (this=0x5555561ae1e0) at src/base/bittorrent/session.cpp:3748
#14 in BitTorrent::Session::qt_static_metacall (_o=, _c=, _id=, _a=)
at Build/src/base/qbt_base_autogen/VKOXE6AELE/moc_session.cpp:393
#15 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#16 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#17 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#19 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#20 in ?? () from /usr/lib/libQt5Core.so.5
#21 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#22 in ?? () from /usr/lib/libglib-2.0.so.0
#23 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#24 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQt5Core.so.5
#25 in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /usr/lib/libQt5Core.so.5
#26 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#27 in Application::exec (this=0x5555560c7340, params=...) at src/app/application.cpp:572
#28 in main (argc=, argv=) at src/app/main.cpp:252
The text was updated successfully, but these errors were encountered: