Bug 441765

Summary: Crash in KCoreDirListerCache::reinsert while saving the history output
Product: [Applications] konsole Reporter: Roke Julian Lockhart Beedell <4wy78uwh>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED DUPLICATE    
Severity: crash CC: a.samirh78, akselmo, faure
Priority: NOR Keywords: drkonqi
Version: 21.08.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Roke Julian Lockhart Beedell 2021-08-30 14:16:22 UTC
Application: konsole (21.08.0)

Qt Version: 5.15.2
Frameworks Version: 5.85.0
Operating System: Linux 5.13.12-2-default x86_64
Windowing System: Wayland
Drkonqi Version: 5.22.4
Distribution: openSUSE Tumbleweed

-- Information about the crash:
- What I was doing when the application crashed:
I had accidentally pressed what I believe was either "CONTROL" plus ("Z" or "S"). After that, Konsole displayed what did appear to be some strange hexadecimal data. After that, I observed the data of my log-file that should have been populated by "script"—http://man7.org/linux/man-pages/man1/script.1.html—had been utterly redacted to a reported-by-dolphin 0 bytes of data.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: Konsole (konsole), signal: Segmentation fault
Content of s_kcrashErrorMessage: [Current thread is 1 (Thread 0x7f869ed00280 (LWP 1863))]
[KCrash Handler]
#6  0x00007f86a1a36c58 in QSharedDataPointer<KFileItemPrivate>::~QSharedDataPointer (this=<optimized out>, this=<optimized out>) at /usr/include/qt5/QtCore/qshareddata.h:93
#7  KFileItem::~KFileItem (this=<optimized out>, this=<optimized out>) at /usr/src/debug/kio-5.85.0-2.1.x86_64/src/core/kfileitem.cpp:560
#8  0x00007f86a1aa4d7d in QList<KFileItem>::node_destruct (n=0x558aea0ff4b8, this=0x558aea0aa870) at /usr/include/qt5/QtCore/qlist.h:479
#9  QList<KFileItem>::erase (it=..., this=0x558aea0aa870) at /usr/include/qt5/QtCore/qlist.h:566
#10 KCoreDirListerCache::reinsert (this=<optimized out>, item=..., oldUrl=...) at /usr/src/debug/kio-5.85.0-2.1.x86_64/src/core/kcoredirlister_p.h:287
#11 0x00007f86a1ab432e in KCoreDirListerCache::processPendingUpdates (this=0x7f86a1b22400 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>) at /usr/src/debug/kio-5.85.0-2.1.x86_64/src/core/kcoredirlister.cpp:2007
#12 0x00007f86a1aabc0c in KCoreDirListerCache::slotFilesChanged (this=0x7f86a1b22400 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>, fileList=...) at /usr/src/debug/kio-5.85.0-2.1.x86_64/src/core/kcoredirlister.cpp:889
#13 0x00007f86a2889fd3 in QtPrivate::QSlotObjectBase::call (a=0x7ffd83082440, r=0x7f86a1b22400 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>, this=0x558ae9e7a100) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false> (sender=0x558ae9d46500, signal_index=7, argv=0x7ffd83082440) at kernel/qobject.cpp:3886
#15 0x00007f86a288349f in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7f86a1b1d520 <OrgKdeKDirNotifyInterface::staticMetaObject>, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x7ffd83082440) at kernel/qobject.cpp:3946
#16 0x00007f86a1a1a965 in OrgKdeKDirNotifyInterface::FilesChanged (this=<optimized out>, _t1=...) at /usr/src/debug/kio-5.85.0-2.1.x86_64/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:246
#17 0x00007f86a1a1ab91 in OrgKdeKDirNotifyInterface::qt_static_metacall (_o=_o@entry=0x558ae9d46500, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=4, _a=_a@entry=0x7ffd83082560) at /usr/src/debug/kio-5.85.0-2.1.x86_64/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:107
#18 0x00007f86a1a20963 in OrgKdeKDirNotifyInterface::qt_metacall (this=0x558ae9d46500, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7ffd83082560) at /usr/src/debug/kio-5.85.0-2.1.x86_64/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:204
#19 0x00007f86a187269b in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:190
#20 0x00007f86a287ff7e in QObject::event (this=0x558ae9d46500, e=0x7f869800c4b0) at kernel/qobject.cpp:1314
#21 0x00007f86a349aa7f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x558ae9d46500, e=0x7f869800c4b0) at kernel/qapplication.cpp:3632
#22 0x00007f86a285398a in QCoreApplication::notifyInternal2 (receiver=0x558ae9d46500, event=0x7f869800c4b0) at kernel/qcoreapplication.cpp:1064
#23 0x00007f86a28569d7 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x558ae97d14b0) at kernel/qcoreapplication.cpp:1821
#24 0x00007f86a28ab7e3 in postEventSourceDispatch (s=s@entry=0x558ae9895ab0) at kernel/qeventdispatcher_glib.cpp:277
#25 0x00007f86a094e80f in g_main_dispatch (context=0x558ae986a0f0) at ../glib/gmain.c:3337
#26 g_main_context_dispatch (context=0x558ae986a0f0) at ../glib/gmain.c:4055
#27 0x00007f86a094eb98 in g_main_context_iterate (context=context@entry=0x558ae986a0f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4131
#28 0x00007f86a094ec4f in g_main_context_iteration (context=0x558ae986a0f0, may_block=1) at ../glib/gmain.c:4196
#29 0x00007f86a28aae64 in QEventDispatcherGlib::processEvents (this=0x558ae9895b80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#30 0x00007f86a285238b in QEventLoop::exec (this=this@entry=0x7ffd830829c0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#31 0x00007f86a36a42fa in QDialog::exec (this=0x558ae9c5dbd0) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#32 0x00007f86a36a41cd in QDialog::exec (this=0x558ae9c34300) at dialogs/qdialog.cpp:597
#33 0x00007f86a3b9e713 in ?? () from /lib64/libkonsoleprivate.so.21
#34 0x00007f86a3c26a2a in Konsole::SessionController::saveHistory() () from /lib64/libkonsoleprivate.so.21
#35 0x00007f86a2889fd3 in QtPrivate::QSlotObjectBase::call (a=0x7ffd83082d30, r=0x558ae9c4fa90, this=0x558ae9d64000) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#36 doActivate<false> (sender=0x558ae9d640a0, signal_index=4, argv=0x7ffd83082d30) at kernel/qobject.cpp:3886
#37 0x00007f86a288349f in QMetaObject::activate (sender=sender@entry=0x558ae9d640a0, m=m@entry=0x7f86a39b30a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd83082d30) at kernel/qobject.cpp:3946
#38 0x00007f86a3494182 in QAction::triggered (this=this@entry=0x558ae9d640a0, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#39 0x00007f86a3496db4 in QAction::activate (this=0x558ae9d640a0, event=<optimized out>) at kernel/qaction.cpp:1161
#40 0x00007f86a361c4d2 in QMenuPrivate::activateCausedStack (this=this@entry=0x558ae99bddd0, causedStack=..., action=action@entry=0x558ae9d640a0, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384
#41 0x00007f86a3624281 in QMenuPrivate::activateAction (this=0x558ae99bddd0, action=0x558ae9d640a0, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461
#42 0x00007f86a34dc76e in QWidget::event (this=0x558ae99ad8a0, event=0x7ffd83083340) at kernel/qwidget.cpp:9020
#43 0x00007f86a349aa7f in QApplicationPrivate::notify_helper (this=this@entry=0x558ae98079b0, receiver=receiver@entry=0x558ae99ad8a0, e=e@entry=0x7ffd83083340) at kernel/qapplication.cpp:3632
#44 0x00007f86a34a2584 in QApplication::notify (this=0x7ffd83083060, receiver=0x558ae99ad8a0, e=0x7ffd83083340) at kernel/qapplication.cpp:3076
#45 0x00007f86a285398a in QCoreApplication::notifyInternal2 (receiver=0x558ae99ad8a0, event=0x7ffd83083340) at kernel/qcoreapplication.cpp:1064
#46 0x00007f86a34a1093 in QApplicationPrivate::sendMouseEvent (receiver=0x558ae99ad8a0, event=event@entry=0x7ffd83083340, alienWidget=0x0, nativeWidget=0x558ae99ad8a0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2614
#47 0x00007f86a34f6343 in QWidgetWindow::handleMouseEvent (this=0x558ae9c486c0, event=0x7ffd83083610) at kernel/qwidgetwindow.cpp:580
#48 0x00007f86a34f8c55 in QWidgetWindow::event (this=0x558ae9c486c0, event=0x7ffd83083610) at kernel/qwidgetwindow.cpp:300
#49 0x00007f86a349aa7f in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x558ae9c486c0, e=0x7ffd83083610) at kernel/qapplication.cpp:3632
#50 0x00007f86a285398a in QCoreApplication::notifyInternal2 (receiver=0x558ae9c486c0, event=0x7ffd83083610) at kernel/qcoreapplication.cpp:1064
#51 0x00007f86a2d485d7 in QGuiApplicationPrivate::processMouseEvent (e=0x558ae9f82710) at kernel/qguiapplication.cpp:2282
#52 0x00007f86a2d1e79c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#53 0x00007f86a06ffa00 in userEventSourceDispatch (source=source@entry=0x558ae9879f80) at qeventdispatcher_glib.cpp:74
#54 0x00007f86a094e80f in g_main_dispatch (context=0x558ae986a0f0) at ../glib/gmain.c:3337
#55 g_main_context_dispatch (context=0x558ae986a0f0) at ../glib/gmain.c:4055
#56 0x00007f86a094eb98 in g_main_context_iterate (context=context@entry=0x558ae986a0f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4131
#57 0x00007f86a094ec4f in g_main_context_iteration (context=0x558ae986a0f0, may_block=1) at ../glib/gmain.c:4196
#58 0x00007f86a28aae64 in QEventDispatcherGlib::processEvents (this=0x558ae9895b80, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#59 0x00007f86a285238b in QEventLoop::exec (this=this@entry=0x7ffd83083940, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#60 0x00007f86a285a670 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#61 0x0000558ae96c91db in ?? ()
#62 0x00007f86a21b8b35 in __libc_start_main (main=0x558ae96c7580, argc=1, argv=0x7ffd83083c48, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd83083c38) at ../csu/libc-start.c:332
#63 0x0000558ae96c95fe in ?? ()
[Inferior 1 (process 1863) detached]

Possible duplicates by query: bug 344024, bug 327681, bug 323442.

Reported using DrKonqi
Comment 1 Ahmad Samir 2021-08-30 23:31:11 UTC
Looking at the backtrace, it looks like you pressed Ctrl+Shift+S which is the shortcut for saving the history output, it basically invokes a file dialog to select where you want to save the history, filename...etc.

Looks like the crash happens because reinsert() is trying to delete an item from the list, but that KFileItem is already gone, most likely crashing while trying to access a nullptr...
Comment 2 Ahmad Samir 2021-08-30 23:34:46 UTC
The crash might be due to the nested eventloop started by QDialog::exec(), if the dialog was opened then closed really quickly, the signals from KDirNotify were emitted but the dialog was gone in the meantime.
Comment 3 Akseli Lahtinen 2023-12-05 11:27:17 UTC

*** This bug has been marked as a duplicate of bug 473488 ***