Bug 383127 - KTorrent crash while closing
Summary: KTorrent crash while closing
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: 5.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords: drkonqi
: 384476 385543 385761 385766 387669 387754 387927 387945 389915 390157 392256 392831 393572 393785 394111 395907 397327 398145 399330 400392 403016 404670 405407 405610 406026 408406 408759 410334 411002 411222 415247 415645 416518 422071 423523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-08-04 15:14 UTC by steffko
Modified: 2021-02-20 04:16 UTC (History)
54 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (7.95 KB, text/plain)
2017-11-30 12:38 UTC, Jacob Noori
Details
New crash information added by DrKonqi (11.76 KB, text/plain)
2017-12-26 12:21 UTC, Nikos Viorres
Details
New crash information added by DrKonqi (6.18 KB, text/plain)
2018-01-10 09:55 UTC, marvelvance
Details
New crash information added by DrKonqi (14.87 KB, text/plain)
2018-02-26 18:18 UTC, steffko
Details
New crash information added by DrKonqi (15.38 KB, text/plain)
2018-02-27 16:34 UTC, steffko
Details
New crash information added by DrKonqi (16.55 KB, text/plain)
2018-03-16 19:00 UTC, steffko
Details
New crash information added by DrKonqi (6.24 KB, text/plain)
2018-07-28 11:53 UTC, Dmitry
Details
New crash information added by DrKonqi (10.18 KB, text/plain)
2019-03-03 18:53 UTC, Marcin
Details
New crash information added by DrKonqi (18.16 KB, text/plain)
2019-03-04 05:52 UTC, Marcin
Details
New crash information added by DrKonqi (12.53 KB, text/plain)
2019-03-27 11:08 UTC, Mike Wengelski
Details
New crash information added by DrKonqi (9.68 KB, text/plain)
2019-07-30 17:13 UTC, Łukasz Konieczny
Details
New crash information added by DrKonqi (10.29 KB, text/plain)
2021-02-20 04:16 UTC, techxgames
Details

Note You need to log in before you can comment on or make changes to this bug.
Description steffko 2017-08-04 15:14:00 UTC
Application: ktorrent (5.0.1)

Qt Version: 5.9.1
Frameworks Version: 5.36.0
Operating System: Linux 4.12.4-1.g2a27bf2-default x86_64
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- What I was doing when the application crashed:

The torrent finished downloading and was removed. The list was empty. Application was closed with CTRL-Q. Crash.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KTorrent (ktorrent), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f3f23245900 (LWP 2008))]

Thread 5 (Thread 0x7f3eea7bb700 (LWP 2720)):
#0  0x00007f3f14b498e8 in pa_mainloop_iterate (m=<optimized out>, block=<optimized out>, retval=0x0) at pulse/mainloop.c:939
#1  0x00007f3f14b49960 in pa_mainloop_run (m=0x3ee8d53d00, retval=retval@entry=0x0) at pulse/mainloop.c:944
#2  0x00007f3f14b577c9 in thread (userdata=0x3ee9346b80) at pulse/thread-mainloop.c:100
#3  0x00007f3f1255d0b8 in internal_thread_func (userdata=0x3ee8caaf80) at pulsecore/thread-posix.c:81
#4  0x00007f3f18ca14d7 in start_thread (arg=0x7f3eea7bb700) at pthread_create.c:456
#5  0x00007f3f1d24eb2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 4 (Thread 0x7f3ee3fff700 (LWP 2329)):
#0  0x00007f3f18ca75dd in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x3ee8d92190) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x3ee8d92140, cond=0x3ee8d92168) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x3ee8d92168, mutex=0x3ee8d92140) at pthread_cond_wait.c:655
#3  0x00007f3f1de6b04b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/libQt5Core.so.5
#4  0x00007f3f22a9baa3 in net::ReverseResolverThread::run (this=0x3ee8b95bc0) at /usr/src/debug/libktorrent-2.0.1/src/net/reverseresolver.cpp:124
#5  0x00007f3f1de69d2e in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#6  0x00007f3f18ca14d7 in start_thread (arg=0x7f3ee3fff700) at pthread_create.c:456
#7  0x00007f3f1d24eb2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 3 (Thread 0x7f3f08b2e700 (LWP 2012)):
#0  0x00007f3f1d24518d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f3f166d0d19 in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7f3ef4003070, timeout=<optimized out>, context=0x7f3ef4000990) at gmain.c:4271
#2  g_main_context_iterate (context=context@entry=0x7f3ef4000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3967
#3  0x00007f3f166d0e2c in g_main_context_iteration (context=0x7f3ef4000990, may_block=1) at gmain.c:4033
#4  0x00007f3f1e08c6ab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#5  0x00007f3f1e03535a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#6  0x00007f3f1de6531a in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#7  0x00007f3f1de69d2e in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#8  0x00007f3f18ca14d7 in start_thread (arg=0x7f3f08b2e700) at pthread_create.c:456
#9  0x00007f3f1d24eb2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 2 (Thread 0x7f3f0a540700 (LWP 2010)):
#0  0x00007f3f1d24518d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f3f166d0d19 in g_main_context_poll (priority=<optimized out>, n_fds=1, fds=0x7f3efc026750, timeout=<optimized out>, context=0x7f3efc000990) at gmain.c:4271
#2  g_main_context_iterate (context=context@entry=0x7f3efc000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3967
#3  0x00007f3f166d0e2c in g_main_context_iteration (context=0x7f3efc000990, may_block=1) at gmain.c:4033
#4  0x00007f3f1e08c6ab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#5  0x00007f3f1e03535a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#6  0x00007f3f1de6531a in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#7  0x00007f3f1c7d5a45 in QDBusConnectionManager::run() () from /usr/lib64/libQt5DBus.so.5
#8  0x00007f3f1de69d2e in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#9  0x00007f3f18ca14d7 in start_thread (arg=0x7f3f0a540700) at pthread_create.c:456
#10 0x00007f3f1d24eb2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Thread 1 (Thread 0x7f3f23245900 (LWP 2008)):
[KCrash Handler]
#6  bt::TorrentInterface::getDisplayName (this=0x3ee9026c10) at /usr/include/libktorrent/interfaces/torrentinterface.h:425
#7  kt::QueueManagerModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/ktorrent/tools/queuemanagermodel.cpp:234
#8  0x00007f3f1f872b36 in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#9  0x00007f3f1f872099 in QStyledItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007f3f1f837d2a in QTreeView::indexRowSizeHint(QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#11 0x00007f3f1f83865e in QTreeViewPrivate::layout(int, bool, bool) () from /usr/lib64/libQt5Widgets.so.5
#12 0x00007f3f1f84015a in QTreeView::doItemsLayout() () from /usr/lib64/libQt5Widgets.so.5
#13 0x00007f3f1f83ad45 in QTreeViewPrivate::updateScrollBars() () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007f3f1f841b68 in QTreeView::updateGeometries() () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007f3f1f60b272 in QWidget::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#16 0x00007f3f1f6e34de in QFrame::event(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#17 0x00007f3f1f804f5c in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#18 0x00007f3f1f84096c in QTreeView::viewportEvent(QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#19 0x00007f3f1e036a54 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#20 0x00007f3f1f5cc915 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#21 0x00007f3f1f5d3cb4 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#22 0x00007f3f1e036d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#23 0x00007f3f1f603c6b in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /usr/lib64/libQt5Widgets.so.5
#24 0x00007f3f1f6077f3 in QWidgetPrivate::show_helper() () from /usr/lib64/libQt5Widgets.so.5
#25 0x00007f3f1f60772e in QWidgetPrivate::showChildren(bool) () from /usr/lib64/libQt5Widgets.so.5
#26 0x00007f3f1f60780f in QWidgetPrivate::show_helper() () from /usr/lib64/libQt5Widgets.so.5
#27 0x00007f3f1f60772e in QWidgetPrivate::showChildren(bool) () from /usr/lib64/libQt5Widgets.so.5
#28 0x00007f3f1f60780f in QWidgetPrivate::show_helper() () from /usr/lib64/libQt5Widgets.so.5
#29 0x00007f3f1f60772e in QWidgetPrivate::showChildren(bool) () from /usr/lib64/libQt5Widgets.so.5
#30 0x00007f3f1f60780f in QWidgetPrivate::show_helper() () from /usr/lib64/libQt5Widgets.so.5
#31 0x00007f3f1f60a30b in QWidget::setVisible(bool) () from /usr/lib64/libQt5Widgets.so.5
#32 0x00007f3f22e4e8fd in kt::TabBarWidget::unshrink (this=0x3ee84c8010) at /usr/src/debug/ktorrent-5.0.1/libktcore/gui/tabbarwidget.cpp:176
#33 0x00007f3f22e4ede8 in kt::TabBarWidget::onActionTriggered (this=<optimized out>, act=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/libktcore/gui/tabbarwidget.cpp:198
#34 0x00007f3f22e58e3c in kt::TabBarWidget::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/build/libktcore/ktcore_autogen/DMHXEJ42XS/moc_tabbarwidget.cpp:83
#35 0x00007f3f1e06425a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#36 0x00007f3f22e5815f in kt::ActionGroup::actionTriggered (this=this@entry=0x3ee85214d0, _t1=<optimized out>, _t1@entry=0x3ee84afe30) at /usr/src/debug/ktorrent-5.0.1/build/libktcore/ktcore_autogen/DMHXEJ42XS/moc_tabbarwidget.cpp:264
#37 0x00007f3f22e4eb3b in kt::ActionGroup::toggled (this=0x3ee85214d0, on=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/libktcore/gui/tabbarwidget.cpp:64
#38 0x00007f3f22e59bd1 in kt::ActionGroup::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/build/libktcore/ktcore_autogen/DMHXEJ42XS/moc_tabbarwidget.cpp:197
#39 0x00007f3f1e06425a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#40 0x00007f3f1f5c6822 in QAction::toggled(bool) () from /usr/lib64/libQt5Widgets.so.5
#41 0x00007f3f1f5c8b4c in QAction::setChecked(bool) () from /usr/lib64/libQt5Widgets.so.5
#42 0x00007f3ef06ca3e8 in kt::InfoWidgetPlugin::unload (this=0x3ee88304c0) at /usr/src/debug/ktorrent-5.0.1/plugins/infowidget/infowidgetplugin.cpp:115
#43 0x00007f3f22e50076 in kt::PluginManager::unloadAll (this=0x3ee835e1d0) at /usr/src/debug/ktorrent-5.0.1/libktcore/plugin/pluginmanager.cpp:203
#44 0x0000003ee66d2311 in kt::Core::onExit (this=0x3ee8366430) at /usr/src/debug/ktorrent-5.0.1/ktorrent/core.cpp:874
#45 0x0000003ee674a5e5 in kt::Core::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/build/ktorrent/ktorrent_app_autogen/EWIEGA46WW/moc_core.cpp:281
#46 0x00007f3f1e06425a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#47 0x00007f3f1e035b17 in QCoreApplication::aboutToQuit(QCoreApplication::QPrivateSignal) () from /usr/lib64/libQt5Core.so.5
#48 0x00007f3f1e0398eb in QCoreApplicationPrivate::execCleanup() () from /usr/lib64/libQt5Core.so.5
#49 0x00007f3f1e03dbfd in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#50 0x0000003ee66cf27e in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/ktorrent-5.0.1/ktorrent/main.cpp:242

Possible duplicates by query: bug 362048.

Reported using DrKonqi
Comment 1 Jacob Noori 2017-11-30 12:38:41 UTC
Created attachment 109128 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.9.2

- What I was doing when the application crashed:

Once the torrent list was emptied, I quit KTorrent from the File Menu. The crash is reproducible sometimes.

-- Backtrace (Reduced):
#6  bt::TorrentInterface::getDisplayName (this=0x556d28d53640) at /usr/include/KF5/libktorrent/interfaces/torrentinterface.h:426
#7  kt::QueueManagerModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/src/debug/ktorrent-5.1.0/ktorrent/tools/queuemanagermodel.cpp:235
#8  0x00007f5347063776 in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#9  0x00007f5347062cd9 in QStyledItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007f53470a32ca in QTreeView::indexRowSizeHint(QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
Comment 2 Andrius Štikonas 2017-12-10 13:56:17 UTC
*** Bug 387669 has been marked as a duplicate of this bug. ***
Comment 3 Andrius Štikonas 2017-12-10 13:57:04 UTC
*** Bug 384476 has been marked as a duplicate of this bug. ***
Comment 4 Andrius Štikonas 2017-12-10 13:57:55 UTC
*** Bug 387754 has been marked as a duplicate of this bug. ***
Comment 5 Andrius Štikonas 2017-12-10 14:00:14 UTC
*** Bug 385766 has been marked as a duplicate of this bug. ***
Comment 6 Andrius Štikonas 2017-12-10 14:02:30 UTC
*** Bug 385543 has been marked as a duplicate of this bug. ***
Comment 7 Nikos Viorres 2017-12-26 12:21:15 UTC
Created attachment 109528 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.9.3

- What I was doing when the application crashed:

Removed the torrent that had finished downloading and closed the application via the tray icon context menu.

-- Backtrace (Reduced):
#7  0x00007f9ee8597136 in QModelIndex::data (arole=0, this=0x7fff546863e0) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:432
#8  QStyledItemDelegate::initStyleOption (this=0x1440a20, option=0x7fff54686270, index=...) at itemviews/qstyleditemdelegate.cpp:345
#9  0x00007f9ee85965ef in QStyledItemDelegate::sizeHint (this=0x1440a20, option=..., index=...) at itemviews/qstyleditemdelegate.cpp:410
#10 0x00007f9ee85dbf31 in QTreeView::indexRowSizeHint (this=this@entry=0x13f6bb0, index=...) at itemviews/qtreeview.cpp:2987
#11 0x00007f9ee85dc946 in QTreeViewPrivate::layout (this=this@entry=0x142b3b0, i=i@entry=-1, recursiveExpanding=recursiveExpanding@entry=false, afterIsUninitialized=afterIsUninitialized@entry=false) at itemviews/qtreeview.cpp:3321
Comment 8 Christoph Feck 2018-01-02 18:42:02 UTC
*** Bug 387945 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Feck 2018-01-02 18:42:21 UTC
*** Bug 387927 has been marked as a duplicate of this bug. ***
Comment 10 Christoph Feck 2018-01-02 18:42:54 UTC
*** Bug 385761 has been marked as a duplicate of this bug. ***
Comment 11 marvelvance 2018-01-10 09:55:29 UTC
Created attachment 109780 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.10.0

- Unusual behavior I noticed:
- Everytime I close ktorrent
- For every update of the app

-- Backtrace (Reduced):
#6  0x00007f575972c43d in QVariant::QVariant(QString const&) () from /usr/lib64/libQt5Core.so.5
#7  0x00005603f82dbf9c in kt::ViewModel::Item::data (this=0x5603f92bf480, col=<optimized out>) at /usr/src/debug/ktorrent-5.1.0/ktorrent/view/viewmodel.cpp:255
#8  0x00005603f82dde0d in kt::ViewModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/src/debug/ktorrent-5.1.0/ktorrent/view/viewmodel.cpp:648
#9  0x00007f575a6ba7c6 in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
#10 0x00007f575a6b9d29 in QStyledItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const () from /usr/lib64/libQt5Widgets.so.5
Comment 12 Christoph Feck 2018-02-22 01:32:07 UTC
*** Bug 390157 has been marked as a duplicate of this bug. ***
Comment 13 Christoph Feck 2018-02-22 01:32:26 UTC
*** Bug 389915 has been marked as a duplicate of this bug. ***
Comment 14 steffko 2018-02-26 18:18:25 UTC
Created attachment 111024 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.10.0

I originally reported the bug and am now supplying a more detailed backtrace which includes the Qt libraries.

-- Backtrace (Reduced):
#6  bt::TorrentInterface::getDisplayName (this=0x564f7f4b1510) at /usr/include/KF5/libktorrent/interfaces/torrentinterface.h:426
#7  kt::QueueManagerModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/src/debug/ktorrent-5.1.0-2.1.x86_64/ktorrent/tools/queuemanagermodel.cpp:235
#8  0x00007f23a491bdb6 in QModelIndex::data (arole=0, this=0x7fff95c6f570) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:432
#9  QStyledItemDelegate::initStyleOption (this=0x564f7ebd3390, option=0x7fff95c6f400, index=...) at itemviews/qstyleditemdelegate.cpp:345
#10 0x00007f23a491b319 in QStyledItemDelegate::sizeHint (this=0x564f7ebd3390, option=..., index=...) at itemviews/qstyleditemdelegate.cpp:410
Comment 15 steffko 2018-02-27 16:34:40 UTC
Created attachment 111054 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.10.0

And once more, with apparently a slightly different backtrace.

-- Backtrace (Reduced):
#6  _mm_movemask_epi8(long long __vector(2)) (__A=...) at /usr/lib64/gcc/x86_64-suse-linux/7/include/emmintrin.h:1396
#7  findChar (str=0xab24726070d0, len=<optimized out>, ch=..., from=from@entry=0, cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:866
#8  0x00007f63d852bc48 in QString::indexOf (this=<optimized out>, ch=..., from=from@entry=0, cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:3369
#9  0x00007f63d852bc87 in QString::replace (this=this@entry=0x7fff7814ce60, before=before@entry=..., after=after@entry=..., cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:2817
#10 0x00007f63d965f7ad in QAbstractItemDelegatePrivate::textForRole (this=<optimized out>, role=role@entry=Qt::DisplayRole, value=..., locale=..., precision=precision@entry=6) at itemviews/qabstractitemdelegate.cpp:597
Comment 16 steffko 2018-03-16 19:00:32 UTC
Created attachment 111449 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.10.0

Another backtrace.
Again, the output keeps on changing.

-- Backtrace (Reduced):
#6  QChar::isSurrogate (this=<optimized out>) at ../../../include/QtCore/../../src/corelib/tools/qchar.h:460
#7  QStringIterator::next (invalidAs=65533, this=<synthetic pointer>, this=<synthetic pointer>) at ../../../include/QtCore/5.10.0/QtCore/private/../../../../../src/corelib/tools/qstringiterator_p.h:168
#8  QFontEngineFT::stringToCMap (this=0x55c36bb8a080, str=<optimized out>, len=<optimized out>, glyphs=0x7ffc3f858710, nglyphs=0x7ffc3f8586fc, flags=...) at freetype/qfontengine_ft.cpp:1733
#9  0x00007fad2e7f76e2 in QFontEngineMulti::stringToCMap (this=0x55c36b966620, str=0x56326c978af5, len=3, glyphs=0x7ffc3f858710, nglyphs=0x7ffc3f8586fc, flags=...) at text/qfontengine.cpp:1896
#10 0x00007fad2e81849c in QTextEngine::shapeText (this=this@entry=0x55c36b8bcc30, item=item@entry=13) at text/qtextengine.cpp:1050
Comment 17 Max Sydorenko 2018-03-17 11:22:41 UTC
*** This bug has been confirmed by popular vote. ***
Comment 18 Christoph Feck 2018-05-17 03:36:00 UTC
*** Bug 393572 has been marked as a duplicate of this bug. ***
Comment 19 Christoph Feck 2018-05-17 03:36:25 UTC
*** Bug 393785 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Feck 2018-05-17 03:36:54 UTC
*** Bug 392831 has been marked as a duplicate of this bug. ***
Comment 21 Christoph Feck 2018-05-17 03:37:23 UTC
*** Bug 394111 has been marked as a duplicate of this bug. ***
Comment 22 Christoph Feck 2018-07-20 02:20:57 UTC
*** Bug 395907 has been marked as a duplicate of this bug. ***
Comment 23 Dmitry 2018-07-28 11:53:11 UTC
Created attachment 114174 [details]
New crash information added by DrKonqi

ktorrent (5.1.0) using Qt 5.10.1

- What I was doing when the application crashed:
I was closeing Ktorrent from system Plasma tray

-- Backtrace (Reduced):
#6  0x00007f3901601d93 in findChar(QChar const*, int, QChar, int, Qt::CaseSensitivity) () from /lib64/libQt5Core.so.5
#7  0x00007f39016065da in QString::replace(QChar, QChar, Qt::CaseSensitivity) () from /lib64/libQt5Core.so.5
#8  0x00007f390227b029 in QAbstractItemDelegatePrivate::textForRole(Qt::ItemDataRole, QVariant const&, QLocale const&, int) const () from /lib64/libQt5Widgets.so.5
#9  0x00007f39022822b3 in QStyledItemDelegate::displayText(QVariant const&, QLocale const&) const () from /lib64/libQt5Widgets.so.5
#10 0x00007f3902283c6e in QStyledItemDelegate::initStyleOption(QStyleOptionViewItem*, QModelIndex const&) const () from /lib64/libQt5Widgets.so.5
Comment 24 Valerii Malov 2018-09-04 12:05:48 UTC
To anyone still having this issue, do you use "scan folders" plugin and does disabling it fix the crash on exit (or it crashes ktorrent too when you disable the plugin)?
Comment 25 Christoph Feck 2018-09-05 03:19:52 UTC
*** Bug 397327 has been marked as a duplicate of this bug. ***
Comment 26 Bernie Innocenti 2018-09-09 02:17:54 UTC
(In reply to Valeriy Malov from comment #24)
> To anyone still having this issue, do you use "scan folders" plugin and does
> disabling it fix the crash on exit (or it crashes ktorrent too when you
> disable the plugin)?

Not using the Scan Folder plugin, and getting crashes on shutdown with the exact same stack trace of comment #23.
Comment 27 Patrick Silva 2018-09-12 14:01:13 UTC
*** Bug 398145 has been marked as a duplicate of this bug. ***
Comment 28 Christoph Feck 2018-10-03 11:11:08 UTC
*** Bug 399330 has been marked as a duplicate of this bug. ***
Comment 29 Patrick Silva 2018-10-05 23:29:23 UTC
*** Bug 399411 has been marked as a duplicate of this bug. ***
Comment 30 Christoph Feck 2018-11-07 11:03:55 UTC
*** Bug 400392 has been marked as a duplicate of this bug. ***
Comment 31 Christoph Feck 2019-01-27 12:49:08 UTC
*** Bug 403016 has been marked as a duplicate of this bug. ***
Comment 32 Marcin 2019-03-03 18:53:58 UTC
Created attachment 118516 [details]
New crash information added by DrKonqi

ktorrent (5.1.1) using Qt 5.11.3

Worth mention:
Connecting through local OpenVPN server running on BananaPiM!+ with 4096 encryption.
Torrents are set to be moved to NAS running on RaspberryPi3+ mounted with sshfs to local machine where error accured using using the same OVPN connection..

When a large file is moved between RPI NAS and local machine through OVPN its very slow and it sometimes make all the KDE slow when seraching files or browsig folders in Dolphin. To boost local machine i trid to close Ktorrent from the task bar => close. At the time 3 files where copied.

-- Backtrace (Reduced):
#6  _mm_movemask_epi8(long long __vector(2)) (__A=...) at /usr/lib/gcc/x86_64-linux-gnu/8/include/emmintrin.h:1305
#7  findChar (str=0xaacf3c584430, len=<optimized out>, ch=..., from=from@entry=0, cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:1049
#8  0x00007f5c42b77328 in QString::indexOf (this=<optimized out>, ch=..., from=from@entry=0, cs=cs@entry=Qt::CaseSensitive) at ../../include/QtCore/../../src/corelib/tools/qarraydata.h:206
#9  0x00007f5c42b77367 in QString::replace (this=this@entry=0x7ffc6dccd850, before=before@entry=..., after=after@entry=..., cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:3031
#10 0x00007f5c4388ad4f in QAbstractItemDelegatePrivate::textForRole (this=<optimized out>, role=role@entry=Qt::DisplayRole, value=..., locale=..., precision=precision@entry=6) at ../../include/QtCore/../../src/corelib/tools/qchar.h:88
Comment 33 Marcin 2019-03-04 05:52:43 UTC
Created attachment 118522 [details]
New crash information added by DrKonqi

ktorrent (5.1.1) using Qt 5.11.3

Ktorrent crushed while closing but just before I closed it i removed a couple of finished torrents from the list.

-- Backtrace (Reduced):
#13 0x00007f08b42c8b28 in QTextEngine::itemize() const () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#14 0x00007f08b42d006c in QTextLayout::beginLayout() () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#15 0x00007f08b482c21f in viewItemTextLayout (textLayout=..., lineWidth=8388607) at styles/qcommonstyle.cpp:850
#16 0x00007f08b482f6e2 in QCommonStylePrivate::viewItemSize (this=this@entry=0x55c263558660, option=option@entry=0x7ffdf4b0c240, role=role@entry=0) at styles/qcommonstyle.cpp:909
#17 0x00007f08b482ffb8 in QCommonStylePrivate::viewItemLayout (this=0x55c263558660, opt=opt@entry=0x7ffdf4b0c240, checkRect=checkRect@entry=0x7ffdf4b0c180, pixmapRect=pixmapRect@entry=0x7ffdf4b0c160, textRect=textRect@entry=0x7ffdf4b0c170, sizehint=sizehint@entry=true) at styles/qcommonstyle.cpp:1006
Comment 34 Christoph Feck 2019-03-12 11:52:57 UTC
*** Bug 404670 has been marked as a duplicate of this bug. ***
Comment 35 Christoph Feck 2019-03-12 21:44:35 UTC
*** Bug 405407 has been marked as a duplicate of this bug. ***
Comment 36 Mike Wengelski 2019-03-27 11:08:04 UTC
Created attachment 119080 [details]
New crash information added by DrKonqi

ktorrent (5.1.1) using Qt 5.12.2

- What I was doing when the application crashed:

I clicked File->Quit from the main window. The app appeared to exit properly. 5-10 seconds later the KCrash report appeared.

Application state:
~9 torrents seeding
~2 torrents downloading
~5 torrents in queue to download
Speed limit Download: No Limit
Speed limit Upload: 30 KiB/s
Plugins enabled: UPnP (connected by wifi, static ip, no ipv6, dns: 1.1.1.1/1.0.0.1, netgear R8000 router)

Fresh install of OpenSUSE Tumbleweed yesterday.

I am willing to help test/debug this. Feel free to send me a note if I can be of service. In the mean time, I'm going to start following the stack traces around the source.

-- Backtrace (Reduced):
#6  std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=0x74746366) at /usr/include/c++/8/bits/atomic_base.h:390
#7  QAtomicOps<int>::load<int> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:227
#8  QBasicAtomicInteger<int>::load (this=0x74746366) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:103
[...]
#10 QString::QString (other=..., this=0x7ffc597c3f50) at ../../include/QtCore/../../src/corelib/tools/qstring.h:958
#11 v_construct_helper<QString> (t=..., x=0x7ffc597c3f50) at ../../include/QtCore/5.12.2/QtCore/private/../../../../../src/corelib/kernel/qvariant_p.h:123
Comment 37 Christoph Feck 2019-04-19 12:13:41 UTC
*** Bug 406026 has been marked as a duplicate of this bug. ***
Comment 38 Christoph Feck 2019-06-07 07:36:05 UTC
*** Bug 408406 has been marked as a duplicate of this bug. ***
Comment 39 Christoph Feck 2019-06-16 02:25:18 UTC
*** Bug 408759 has been marked as a duplicate of this bug. ***
Comment 40 Bennet 2019-07-29 16:32:41 UTC
*** Bug 410334 has been marked as a duplicate of this bug. ***
Comment 41 Łukasz Konieczny 2019-07-30 17:13:22 UTC
Created attachment 121845 [details]
New crash information added by DrKonqi

ktorrent (5.1.1) using Qt 5.13.0

- What I was doing when the application crashed:

I had several torrents opened and I quited KTorrent. Then CPU usage peaked to 90% and KTorrent crashed.

-- Backtrace (Reduced):
#7  0x00007ffacf7a5749 in memcpy (__len=65524, __src=<optimized out>, __dest=<optimized out>) at /usr/include/bits/string_fortified.h:34
#8  QString::reallocData (this=0x7ffdb5308b90, alloc=<optimized out>, grow=<optimized out>) at tools/qstring.cpp:2382
[...]
#10 QString::replace (this=this@entry=0x7ffdb5308b90, before=before@entry=..., after=after@entry=..., cs=cs@entry=Qt::CaseSensitive) at tools/qstring.cpp:3282
#11 0x00007ffad05a4667 in QAbstractItemDelegatePrivate::textForRole (this=<optimized out>, role=role@entry=Qt::DisplayRole, value=..., locale=..., precision=precision@entry=6) at ../../include/QtCore/../../src/corelib/tools/qchar.h:88
#12 0x00007ffad05abc20 in QStyledItemDelegate::displayText (this=<optimized out>, value=..., locale=...) at itemviews/qstyleditemdelegate.h:99
Comment 42 Christoph Feck 2019-09-01 02:24:08 UTC
*** Bug 411222 has been marked as a duplicate of this bug. ***
Comment 43 Christoph Feck 2019-09-09 14:49:48 UTC
*** Bug 411002 has been marked as a duplicate of this bug. ***
Comment 44 Valerii Malov 2019-09-29 20:33:07 UTC
Git commit b819ef6a35495e12a204cbb241cdb2502c4cd11e by Valerii Malov.
Committed on 29/09/2019 at 20:31.
Pushed by valeriymalov into branch '5.1'.

Cleanup ViewModel a bit and try to fix crash on exit

Summary:
removeTorrent makes changes to torrent list we are currently iterating
on per-item basis, this causees heap-use-after-free in onExit
Just call removeRows which should be functionally the same, but should
delete all items in one batch

Compact ViewModel::Item::update
Fix a few warnings (0 as nullptr, c-style casts)
Remove useless ViewModel::torrentFromIndex variant
Remove unused headers
add CMakeLists.txt.user to gitignore

Test Plan: build with asan, run & exit, see asan stacktrace before changing onExit

Reviewers: stikonas

Differential Revision: https://phabricator.kde.org/D24149

M  +1    -0    .gitignore
M  +1    -0    ktorrent/CMakeLists.txt
M  +51   -146  ktorrent/view/viewmodel.cpp
M  +10   -11   ktorrent/view/viewmodel.h

https://commits.kde.org/ktorrent/b819ef6a35495e12a204cbb241cdb2502c4cd11e
Comment 45 Andrius Štikonas 2019-10-06 19:21:56 UTC
Would anybody be able to compile this and check if crash on exit is fixed?

I was never able to reproduce it.
Comment 46 Rob 2019-12-27 18:40:55 UTC
I can confirm that this bug has been fixed.

Built from master, there are no crashes.
Built from master with the above patch reverted, the crash occurs again.

When trying to reproduce the bug, I noticed that it occurs if the .local/share/ktorrent/ directory contains at least three subdirectories starting with "tor", e.g. "tor0", "tor1", "tor2".
Comment 47 Rob 2019-12-27 18:41:31 UTC
*** Bug 392256 has been marked as a duplicate of this bug. ***
Comment 48 Rob 2019-12-27 18:42:59 UTC
*** Bug 405610 has been marked as a duplicate of this bug. ***
Comment 49 Rob 2019-12-27 18:46:09 UTC
*** Bug 415247 has been marked as a duplicate of this bug. ***
Comment 50 Christoph Feck 2020-01-13 11:36:24 UTC
*** Bug 415645 has been marked as a duplicate of this bug. ***
Comment 51 Christoph Feck 2020-02-13 19:23:43 UTC
*** Bug 416518 has been marked as a duplicate of this bug. ***
Comment 52 Petr Kovács 2020-04-21 09:22:57 UTC
For me the bug is fixed, no crash when closing ktorrent (version 5.1.2). 

Operating System: Gentoo Linux 
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.1
Kernel Version: 5.6.5-gentoo-nvidia
OS Type: 64-bit
Comment 53 Christoph Feck 2020-05-20 09:36:21 UTC
Thanks for the update; changing status.

The fix is not in v5.1.2, but might have been backported by the distribution. See comment 44 for the commit.
Comment 54 Andrius Štikonas 2020-05-20 10:26:57 UTC
(In reply to Christoph Feck from comment #53)
> Thanks for the update; changing status.
> 
> The fix is not in v5.1.2, but might have been backported by the
> distribution. See comment 44 for the commit.

Maybe it's time to schedule KTorrent 5.2? I think it also was ported away from QtWebkit.
Comment 55 Christoph Feck 2020-07-14 22:07:00 UTC
*** Bug 422071 has been marked as a duplicate of this bug. ***
Comment 56 Christoph Feck 2020-07-14 22:07:25 UTC
*** Bug 423523 has been marked as a duplicate of this bug. ***
Comment 57 techxgames 2021-02-20 04:16:48 UTC
Created attachment 135931 [details]
New crash information added by DrKonqi

ktorrent (20.12.2) using Qt 5.15.2

- What I was doing when the application crashed:

After pressing Ctrl+Q to exit it, I got notified of the crash.

-- Backtrace (Reduced):
#5  0x000055da6cae7fe6 in kt::ViewModel::Item::color (this=0x55da6dc46550, col=<optimized out>) at ./ktorrent/view/viewmodel.cpp:238
#6  0x000055da6cae999d in kt::ViewModel::data (this=<optimized out>, index=..., role=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qabstractitemmodel.h:63
#7  0x00007ff7174b05d7 in QModelIndex::data (arole=9, this=0x7ffc2d577180) at ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:460
#8  QStyledItemDelegate::initStyleOption (this=0x55da7252c3d0, option=0x7ffc2d577010, index=...) at itemviews/qstyleditemdelegate.cpp:291
#9  0x00007ff7174afcf7 in QStyledItemDelegate::sizeHint (this=0x55da7252c3d0, option=..., index=...) at itemviews/qstyleditemdelegate.cpp:410