Bug 453152 - Kate crashed during session restore
Summary: Kate crashed during session restore
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.04.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-04-28 16:15 UTC by Kishore Gopalakrishnan
Modified: 2022-05-30 04:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2022-04-28 16:15:09 UTC
Application: kate (22.04.0)

Qt Version: 5.15.3
Frameworks Version: 5.93.0
Operating System: Linux 5.15.35-1-lts x86_64
Windowing System: X11
Distribution: Arch Linux
DrKonqi: 5.24.4 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
Kate was opened as part of KDE's session restore. It crashed even before all my applications were restored. I think I had a text file open from an SFTP location.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: கேட் (kate), signal: Segmentation fault
Content of s_kcrashErrorMessage: {_M_t = {<std::__uniq_ptr_impl<char, std::default_delete<char []> >> = {_M_t = std::tuple containing = {[1] = 0x0, [2] = {<No data fields>}}}, <No data fields>}}
[KCrash Handler]
#6  QFlags<KEntryMap::SearchFlag>::operator|= (other=<optimized out>, this=<optimized out>) at /usr/src/debug/kconfig-5.93.0/src/core/kconfig.cpp:1033
#7  KConfigPrivate::lookupInternalEntry (this=0x1, group=..., key=0x7fb7217251ec "CursorColumn", flags=...) at /usr/src/debug/kconfig-5.93.0/src/core/kconfig.cpp:1034
#8  0x00007fb720d57123 in KConfigPrivate::lookupData (flags=..., key=0x7fb7217251ec "CursorColumn", group=..., this=<optimized out>) at /usr/src/debug/kconfig-5.93.0/src/core/kconfig.cpp:1028
#9  KConfigGroup::readEntry (this=this@entry=0x5604811de088, key=key@entry=0x7fb7217251ec "CursorColumn", aDefault=...) at /usr/src/debug/kconfig-5.93.0/src/core/kconfiggroup.cpp:712
#10 0x00007fb7215b6561 in KConfigGroup::readEntry<int> (this=0x5604811de088, key=0x7fb7217251ec "CursorColumn", defaultValue=<optimized out>) at /usr/include/KF5/KConfigCore/kconfiggroup.h:823
#11 0x00007fb721613b6a in KTextEditor::ViewPrivate::readSessionConfig (this=0x56048112cb00, config=..., flags=...) at /usr/src/debug/ktexteditor-5.93.0/src/view/kateview.cpp:1743
#12 0x000056047e3a6cd0 in operator() (__closure=0x5604811de070) at /usr/src/debug/kate-22.04.0/kate/kateviewspace.cpp:1003
#13 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KTextEditor::Document*>, void, KateViewSpace::restoreConfig(KateViewManager*, const KConfigBase*, const QString&)::<lambda(KTextEditor::Document*)> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#14 QtPrivate::Functor<KateViewSpace::restoreConfig(KateViewManager*, const KConfigBase*, const QString&)::<lambda(KTextEditor::Document*)>, 1>::call<QtPrivate::List<KTextEditor::Document*>, void> (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#15 QtPrivate::QFunctorSlotObject<KateViewSpace::restoreConfig(KateViewManager*, const KConfigBase*, const QString&)::<lambda(KTextEditor::Document*)>, 1, QtPrivate::List<KTextEditor::Document*>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x5604811de060, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#16 0x00007fb71fac8463 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#17 doActivate<false> (sender=0x56047fa09800, signal_index=28, argv=0x7ffd89b6b440) at kernel/qobject.cpp:3886
#18 0x00007fb72150e407 in KTextEditor::Document::textChanged (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/build/src/KF5TextEditor_autogen/OGSBNZGFXN/moc_document.cpp:625
#19 0x00007fb721586173 in KTextEditor::DocumentPrivate::openFile (this=0x56047fa09800) at /usr/src/debug/ktexteditor-5.93.0/src/document/katedocument.cpp:2407
#20 0x00007fb721430cb0 in ?? () from /usr/lib/libKF5Parts.so.5
#21 0x00007fb71fac8463 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#22 doActivate<false> (sender=0x56048063ab40, signal_index=6, argv=0x7ffd89b6b6d0) at kernel/qobject.cpp:3886
#23 0x00007fb720c078a1 in KJob::result (this=this@entry=0x56048063ab40, _t1=<optimized out>, _t1@entry=0x56048063ab40, _t2=...) at /usr/src/debug/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#24 0x00007fb720c0bd4c in KJob::finishJob (this=0x56048063ab40, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons-5.93.0/src/lib/jobs/kjob.cpp:98
#25 0x00007fb71fac8463 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#26 doActivate<false> (sender=0x560480546a30, signal_index=6, argv=0x7ffd89b6b800) at kernel/qobject.cpp:3886
#27 0x00007fb720c078a1 in KJob::result (this=this@entry=0x560480546a30, _t1=<optimized out>, _t1@entry=0x560480546a30, _t2=...) at /usr/src/debug/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#28 0x00007fb720c0bd4c in KJob::finishJob (this=0x560480546a30, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons-5.93.0/src/lib/jobs/kjob.cpp:98
#29 0x00007fb71fac8463 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#30 doActivate<false> (sender=0x560480b3c6c0, signal_index=7, argv=0x7ffd89b6b8d0) at kernel/qobject.cpp:3886
#31 0x00007fb7211bef97 in KIO::SlaveInterface::dispatch (this=0x560480b3c6c0, _cmd=104, rawdata=...) at /usr/src/debug/kio-5.93.0/src/core/slaveinterface.cpp:149
#32 0x00007fb7211b70ad in KIO::SlaveInterface::dispatch (this=0x560480b3c6c0) at /usr/src/debug/kio-5.93.0/src/core/slaveinterface.cpp:78
#33 0x00007fb7211c1c03 in KIO::Slave::gotInput (this=0x560480b3c6c0) at /usr/src/debug/kio-5.93.0/src/core/slave.cpp:336
#34 0x00007fb71fac8463 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#35 doActivate<false> (sender=0x560480bab5a0, signal_index=3, argv=0x7ffd89b6bb10) at kernel/qobject.cpp:3886
#36 0x00007fb71fabb7d6 in QObject::event (this=<optimized out>, e=0x560481704d00) at kernel/qobject.cpp:1314
#37 0x00007fb72054c2c6 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x560480bab5a0, e=0x560481704d00) at kernel/qapplication.cpp:3637
#38 0x00007fb71fa975aa in QCoreApplication::notifyInternal2 (receiver=0x560480bab5a0, event=0x560481704d00) at kernel/qcoreapplication.cpp:1064
#39 0x00007fb71fa980a9 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x56047f6e7d40) at kernel/qcoreapplication.cpp:1821
#40 0x00007fb71fadf678 in postEventSourceDispatch (s=0x56047f7bc320) at kernel/qeventdispatcher_glib.cpp:277
#41 0x00007fb71dda2163 in g_main_dispatch (context=0x7fb714005010) at ../glib/glib/gmain.c:3417
#42 g_main_context_dispatch (context=0x7fb714005010) at ../glib/glib/gmain.c:4135
#43 0x00007fb71ddf89e9 in g_main_context_iterate.constprop.0 (context=context@entry=0x7fb714005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4211
#44 0x00007fb71dd9f6c5 in g_main_context_iteration (context=0x7fb714005010, may_block=1) at ../glib/glib/gmain.c:4276
#45 0x00007fb71fae357a in QEventDispatcherGlib::processEvents (this=0x56047f7ce010, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#46 0x00007fb71fa8f88b in QEventLoop::exec (this=0x7ffd89b6bfa0, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#47 0x00007fb71fa9afd7 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#48 0x00007fb71fe661d2 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#49 0x00007fb72054a64a in QApplication::exec () at kernel/qapplication.cpp:2829
#50 0x000056047e36fb4e in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kate-22.04.0/kate/main.cpp:714
[Inferior 1 (process 7384) detached]

The reporter indicates this bug may be a duplicate of or related to bug 442873.

Possible duplicates by query: bug 451615, bug 442873, bug 421596, bug 301772, bug 294565.

Reported using DrKonqi
Comment 1 Christoph Cullmann 2022-04-30 21:38:35 UTC
Ok, I think that is because we try to delay the session restore.
That will not work as the pointers might be invalid later :(
Comment 2 Christoph Cullmann 2022-04-30 21:54:14 UTC
Git commit 593857184c8799c281c519cb0e45517c60bbac52 by Christoph Cullmann.
Committed on 30/04/2022 at 21:42.
Pushed by cullmann into branch 'master'.

no delayed readSessionConfig

the config pointer might be invalid at that point in time

if we want to delay stuff, that must be done inside
readSessionConfig in the KTextEditor::View itself,
after reading the stuff from the passed config

M  +5    -21   apps/lib/kateviewspace.cpp

https://invent.kde.org/utilities/kate/commit/593857184c8799c281c519cb0e45517c60bbac52
Comment 3 Christoph Cullmann 2022-04-30 21:57:48 UTC
Git commit 3414b6269a616a0dee4237f66e77772669ee59ff by Christoph Cullmann.
Committed on 30/04/2022 at 21:57.
Pushed by cullmann into branch 'release/22.04'.

no delayed readSessionConfig

the config pointer might be invalid at that point in time

if we want to delay stuff, that must be done inside
readSessionConfig in the KTextEditor::View itself,
after reading the stuff from the passed config

M  +5    -21   kate/kateviewspace.cpp

https://invent.kde.org/utilities/kate/commit/3414b6269a616a0dee4237f66e77772669ee59ff
Comment 4 Waqar Ahmed 2022-05-30 04:29:32 UTC
*** Bug 454594 has been marked as a duplicate of this bug. ***