Bug 459108 - Crash on startup
Summary: Crash on startup
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: sessions (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-14 15:32 UTC by David Edmundson
Modified: 2022-09-25 10:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2022-09-14 15:32:34 UTC
It asserts whilst saving (which is surprising to do on startup)
#0  0x00007ffff44a14dc in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff4451998 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff443b53d in abort () from /usr/lib/libc.so.6
#3  0x00007ffff4699833 in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#4  0x00007ffff46a5cfc in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#5  0x00007ffff46a5d69 in std::terminate () at /usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#6  0x00007ffff46a5fcd in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff48291c8 <typeinfo for std::out_of_range>, dest=0x7ffff46bd710 <std::out_of_range::~out_of_range()>) at /usr/src/debug/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#7  0x00007ffff469c52b in std::__throw_out_of_range (__s=0x7ffff7da1d35 "map::at") at /usr/src/debug/gcc/libstdc++-v3/src/c++11/functexcept.cc:86
#8  0x00007ffff7cf52d5 in std::map<int, KateMDI::ToolView*, std::less<int>, std::allocator<std::pair<int const, KateMDI::ToolView*> > >::at (this=0x555556317568, __k=@0x7fffffffa6ac: 5) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:551
#9  0x00007ffff7cf02fb in KateMDI::Sidebar::saveSession (this=0x555556317510, config=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katemdi.cpp:1223
#10 0x00007ffff7cf3048 in KateMDI::MainWindow::saveSession (this=0x5555562a92f0, config=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katemdi.cpp:1552
#11 0x00007ffff7cdcb0a in KateMainWindow::saveProperties (this=0x5555562a92f0, config=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katemainwindow.cpp:1114
#12 0x00007ffff6f34785 in KMainWindow::savePropertiesInternal (this=0x5555562a92f0, config=0x555556859910, number=1) at /home/david/projects/kde5/src/frameworks/kxmlgui/src/kmainwindow.cpp:621
#13 0x00007ffff6f341d7 in KMWSessionManager::saveState (this=0x7ffff6fff388 <(anonymous namespace)::Q_QGS_ksm::innerFunction()::holder>, sm=...) at /home/david/projects/kde5/src/frameworks/kxmlgui/src/kmainwindow.cpp:142
#14 0x00007ffff6f3c000 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QSessionManager&>, void, void (KMWSessionManager::*)(QSessionManager&)>::call (f=(void (KMWSessionManager::*)(KMWSessionManager * const, QSessionManager &)) 0x7ffff6f340b0 <KMWSessionManager::saveState(QSessionManager&)>, o=0x7ffff6fff388 <(anonymous namespace)::Q_QGS_ksm::innerFunction()::holder>, arg=0x7fffffffad40) at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#15 0x00007ffff6f3bf5d in QtPrivate::FunctionPointer<void (KMWSessionManager::*)(QSessionManager&)>::call<QtPrivate::List<QSessionManager&>, void> (f=(void (KMWSessionManager::*)(KMWSessionManager * const, QSessionManager &)) 0x7ffff6f340b0 <KMWSessionManager::saveState(QSessionManager&)>, o=0x7ffff6fff388 <(anonymous namespace)::Q_QGS_ksm::innerFunction()::holder>, arg=0x7fffffffad40) at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#16 0x00007ffff6f3bea2 in QtPrivate::QSlotObject<void (KMWSessionManager::*)(QSessionManager&), QtPrivate::List<QSessionManager&>, void>::impl (which=1, this_=0x55555630f290, r=0x7ffff6fff388 <(anonymous namespace)::Q_QGS_ksm::innerFunction()::holder>, a=0x7fffffffad40, ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:418
#17 0x00007ffff4cbe0d1 in ?? () from /usr/lib/libQt5Core.so.5
#18 0x00007ffff514141a in QGuiApplication::saveStateRequest(QSessionManager&) () from /usr/lib/libQt5Gui.so.5
#19 0x00007ffff51418a0 in QGuiApplicationPrivate::saveState() () from /usr/lib/libQt5Gui.so.5
#20 0x00007fffeff46e47 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#21 0x00007fffeff46f77 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#22 0x00007fffefbd2685 in _SmcProcessMessage () from /usr/lib/libSM.so.6
#23 0x00007fffefbc3405 in IceProcessMessages () from /usr/lib/libICE.so.6
#24 0x00007ffff4cbe280 in ?? () from /usr/lib/libQt5Core.so.5
#25 0x00007ffff4cbff84 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /usr/lib/libQt5Core.so.5
#26 0x00007ffff4cc00c8 in QSocketNotifier::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#27 0x00007ffff5978b3c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#28 0x00007ffff4c8d978 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#29 0x00007ffff4cd70b6 in ?? () from /usr/lib/libQt5Core.so.5
#30 0x00007ffff3071b2b in g_main_dispatch (context=0x7fffe8005010) at ../glib/glib/gmain.c:3417
#31 g_main_context_dispatch (context=0x7fffe8005010) at ../glib/glib/gmain.c:4135
#32 0x00007ffff30c7e79 in g_main_context_iterate.constprop.0 (context=context@entry=0x7fffe8005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4211
#33 0x00007ffff306f252 in g_main_context_iteration (context=0x7fffe8005010, may_block=1) at ../glib/glib/gmain.c:4276
#34 0x00007ffff4cd825c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#35 0x00007ffff4c8611c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#36 0x00007ffff635c1d0 in KJob::exec (this=0x5555568469f0) at /home/david/projects/kde5/src/frameworks/kcoreaddons/src/lib/jobs/kjob.cpp:196
#37 0x00007fffec4b6a89 in KDirOperator::setUrl (this=0x55555678f5b0, _newurl=..., clearforward=true) at /home/david/projects/kde5/src/frameworks/kio/src/filewidgets/kdiroperator.cpp:1005
#38 0x00007fffec07617a in KateFileBrowser::updateDirOperator (this=0x555556778280, u=...) at /home/david/projects/kde5/src/kde/applications/kate/addons/filebrowser/katefilebrowser.cpp:338
#39 0x00007fffec07c690 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QUrl const&>, void, void (KateFileBrowser::*)(QUrl const&)>::call (f=(void (KateFileBrowser::*)(KateFileBrowser * const, const QUrl &)) 0x7fffec076150 <KateFileBrowser::updateDirOperator(QUrl const&)>, o=0x555556778280, arg=0x7fffffffbc70) at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#40 0x00007fffec07c5ed in QtPrivate::FunctionPointer<void (KateFileBrowser::*)(QUrl const&)>::call<QtPrivate::List<QUrl const&>, void> (f=(void (KateFileBrowser::*)(KateFileBrowser * const, const QUrl &)) 0x7fffec076150 <KateFileBrowser::updateDirOperator(QUrl const&)>, o=0x555556778280, arg=0x7fffffffbc70) at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#41 0x00007fffec07c532 in QtPrivate::QSlotObject<void (KateFileBrowser::*)(QUrl const&), QtPrivate::List<QUrl const&>, void>::impl (which=1, this_=0x5555568252b0, r=0x555556778280, a=0x7fffffffbc70, ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:418
#42 0x00007ffff4cbe0d1 in ?? () from /usr/lib/libQt5Core.so.5
#43 0x00007fffec588d03 in KUrlNavigator::urlChanged (this=0x55555680ac00, _t1=...) at src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kurlnavigator.cpp:292
#44 0x00007fffec589225 in KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0::operator()() const (this=0x555556797c70) at /home/david/projects/kde5/src/frameworks/kio/src/filewidgets/kurlnavigator.cpp:201
#45 0x00007fffec5891a6 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0>::call(KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0&, void**) (f=..., arg=0x7fffffffbe10) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#46 0x00007fffec589171 in QtPrivate::Functor<KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0, 0>::call<QtPrivate::List<>, void>(KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0&, void*, void**) (f=..., arg=0x7fffffffbe10) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#47 0x00007fffec589111 in QtPrivate::QFunctorSlotObject<KUrlNavigatorPrivate::KUrlNavigatorPrivate(QUrl const&, KUrlNavigator*, KFilePlacesModel*)::$_0, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555556797c60, r=0x55555680ac00, a=0x7fffffffbe10, ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#48 0x00007ffff4cbe0d1 in ?? () from /usr/lib/libQt5Core.so.5
#49 0x00007ffff7e94862 in KCoreUrlNavigator::currentLocationUrlChanged (this=0x55555680ff30) at src/gui/KF5KIOGui_autogen/EWIEGA46WW/moc_kcoreurlnavigator.cpp:287
#50 0x00007ffff7ea62f2 in KCoreUrlNavigator::setCurrentLocationUrl (this=0x55555680ff30, newUrl=...) at /home/david/projects/kde5/src/frameworks/kio/src/gui/kcoreurlnavigator.cpp:245
#51 0x00007fffec581aee in KUrlNavigator::setLocationUrl (this=0x55555680ac00, newUrl=...) at /home/david/projects/kde5/src/frameworks/kio/src/filewidgets/kurlnavigator.cpp:1061
#52 0x00007fffec077bcb in KateFileBrowser::readSessionConfig (this=0x555556778280, cg=...) at /home/david/projects/kde5/src/kde/applications/kate/addons/filebrowser/katefilebrowser.cpp:177
#53 0x00007fffec06ff31 in KateFileBrowserPluginView::readSessionConfig (this=0x555556775b40, config=...) at /home/david/projects/kde5/src/kde/applications/kate/addons/filebrowser/katefilebrowserplugin.cpp:81
#54 0x00007ffff7d10d7d in KatePluginManager::enablePluginGUI (item=0x555555823e00, win=0x5555562a92f0, config=0x55555627d2a0) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katepluginmanager.cpp:248
#55 0x00007ffff7d10aee in KatePluginManager::enableAllPluginsGUI (this=0x7fffffffd9e8, win=0x5555562a92f0, config=0x55555627d2a0) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katepluginmanager.cpp:176
#56 0x00007ffff7cd622e in KateMainWindow::KateMainWindow (this=0x5555562a92f0, sconfig=0x55555627d2a0, sgroup=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/katemainwindow.cpp:138
#57 0x00007ffff7cb05f6 in KateApp::newMainWindow (sconfig_=0x55555627d2a0, sgroup_=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/kateapp.cpp:530
#58 0x00007ffff7c8de91 in KateSessionManager::loadSession (this=0x7fffffffda08, session=...) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/session/katesessionmanager.cpp:184
#59 0x00007ffff7c8d737 in KateSessionManager::activateSession (this=0x7fffffffda08, session=..., closeAndSaveLast=false, loadNew=true) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/session/katesessionmanager.cpp:145
#60 0x00007ffff7c8e580 in KateSessionManager::activateSession (this=0x7fffffffda08, name=..., closeAndSaveLast=false, loadNew=true) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/session/katesessionmanager.cpp:221
#61 0x00007ffff7c8e752 in KateSessionManager::activateAnonymousSession (this=0x7fffffffda08) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/session/katesessionmanager.cpp:226
#62 0x00007ffff7c90172 in KateSessionManager::chooseSession (this=0x7fffffffda08) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/session/katesessionmanager.cpp:407
#63 0x00007ffff7cafaaa in KateApp::startupKate (this=0x7fffffffd920) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/kateapp.cpp:269
#64 0x00007ffff7caf4d8 in KateApp::init (this=0x7fffffffd920) at /home/david/projects/kde5/src/kde/applications/kate/apps/lib/kateapp.cpp:222
#65 0x0000555555561dbb in main (argc=1, argv=0x7fffffffdd28) at /home/david/projects/kde5/src/kde/applications/kate/apps/kate/main.cpp:590


frame 9:

m_idToWidget.at(j)->id;

(gdb) print j
$6 = 5
(gdb) print m_idToWidget 
$7 = std::map with 0 elements
Comment 1 David Edmundson 2022-09-14 15:42:07 UTC
Crash happens every time starting kate, moving ~/.local/share/kate/ "fixes" the issues.

I kept the folder, I can upload any specific files from it if needed
Comment 2 Christoph Cullmann 2022-09-16 20:09:45 UTC
Hi, does that happen only with master or already with 22.08?
Comment 3 Oded Arbel 2022-09-21 09:01:46 UTC
I see the same issue with current Neon unstable builds ( 4:22.08.1+p22.04+tunstable+git20220921.0105-0 ) - i.e. same stack trace.

Running from the terminal, I can see a lot of KIO debug messages and then:

----8<----
kf.kio.core.dirlister: +KCoreDirLister
kf.kio.core.dirlister: +KCoreDirLister
kf.kio.core.dirlister: ~KCoreDirLister KCoreDirLister(0x55d4d7f53b70)
kf.kio.core.dirlister: lister: KCoreDirLister(0x55d4d7f53b70) silent= false
kf.kio.core.dirlister: KCoreDirLister(0x55d4d7f53b70)
kf.kio.core.dirlister: Iterating over dirs ()
kf.xmlgui: Registering action  "renamefile"  under new name  "rename"
kf.kio.core.dirlister: KDirLister(0x55d4d7f53310) url= QUrl("file:///home/odeda") keep= false reload= false
kf.kio.core.dirlister: lister: KDirLister(0x55d4d7f53310) silent= true
kf.kio.core.dirlister: KDirLister(0x55d4d7f53310)
kf.kio.core.dirlister: Iterating over dirs ()
kf.kio.core.dirlister: Listing directory: QUrl("file:///home/odeda")
kf.kio.core.dirlister: Entry now being listed by (KDirLister(0x55d4d7f53310))
terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at
18 -- exe=/usr/bin/kate
13 -- platform=xcb
11 -- display=:0
13 -- appname=kate
17 -- apppath=/usr/bin
9 -- signal=6
12 -- pid=1243687
20 -- appversion=22.11.70
17 -- programname=Kate
31 -- bugaddress=submit@bugs.kde.org
12 -- startupid=0
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kate path = /usr/bin pid = 1243687
KCrash: Arguments: /usr/bin/kate .profile 
Aborted (core dumped)
----8<----
Comment 4 Oded Arbel 2022-09-21 09:11:18 UTC
I can reproduce the crash by going to ~/.local/share/kate/anonymous.katesession , into the [Plugin:katefilebrowserplugin:MainWindow:0] section and setting the "location" field to a non-existing directory.

This often happens in the course of a normal work day for me, where I edit a file somewhere with kate and later the directory containing that file gets deleted. Usually this is due to the fact that I use Kate as my commit message editor, so it is often called to edit temporary files in temporary directories.
Comment 5 Oded Arbel 2022-09-21 09:50:52 UTC
The problem appears to me to have been introduced in this commit:
https://invent.kde.org/utilities/kate/-/commit/1b93ede0e09fcc5ef069cf5c3be33e914c660162#1d89091b7718b0df550ed065e31436f1fab5217c_1112_1123
where the new code for KateMDI::Sidebar::saveSession assumes (without checking) that all items in the tab bar are already initialized tool views, but the problem is that the KateFileBrowser tool view - when it can't immediately identify the location from its configuration as a valid folder - starts a KIO stat job, which takes time to complete - and calls into the QEventLoop. The event loop may cause the SMC save_yourself API to be called to save the current session state - calling on KateMDI::Sidebar::saveSession to save the state of a partially initialized sidebar.

I believe more error checking all around would be useful, but maybe the correct fix here would be for KateFileBrowser to not set the KUrlNavigator to the configured location until a later time, as that operation has a lot of side effects that should not delay the plugin loading.
Comment 6 Lothar 2022-09-21 20:25:12 UTC
Hi, Eric pointed me to this report.

(In reply to Oded Arbel from comment #5)
> The problem appears to me to have been introduced in this commit:
> https://invent.kde.org/utilities/kate/-/commit/
> 1b93ede0e09fcc5ef069cf5c3be33e914c660162#1d89091b7718b0df550ed065e31436f1fab5
> 217c_1112_1123
> where the new code for KateMDI::Sidebar::saveSession assumes (without
> checking) that all items in the tab bar are already initialized tool views,
> but the problem is that the KateFileBrowser tool view - when it can't
> immediately identify the location from its configuration as a valid folder -
> starts a KIO stat job, which takes time to complete - and calls into the
> QEventLoop. The event loop may cause the SMC save_yourself API to be called
> to save the current session state - calling on KateMDI::Sidebar::saveSession
> to save the state of a partially initialized sidebar.

 You seems to have located the issue very well, thank you. Will try to reproduce the issue and fix it...

> I believe more error checking all around would be useful

...probably this way.
Comment 7 Bug Janitor Service 2022-09-22 11:30:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/895
Comment 8 Christoph Cullmann 2022-09-23 19:03:10 UTC
Git commit e703cbae9389e22bbbede1493bcede80b881e471 by Christoph Cullmann, on behalf of loh tar.
Committed on 23/09/2022 at 18:53.
Pushed by cullmann into branch 'master'.

Sidebar: Don't save a session while session restore is running

M  +5    -0    apps/lib/katemdi.cpp
M  +1    -0    apps/lib/katemdi.h

https://invent.kde.org/utilities/kate/commit/e703cbae9389e22bbbede1493bcede80b881e471
Comment 9 Oded Arbel 2022-09-25 06:03:57 UTC
With neon unstable build 4:22.08.1+p22.04+tunstable+git20220925.0108-0, that was built from commit 90658f33f0ad58c8d61fbbcc3f37dec5468d5fa9 (which is after the fix referenced in comment 8), I still get this crash.

The crash stack trace looks similar, except with updated line numbers (for the new code in the fix):

----8<----
Thread 1 (Thread 0x7f0879dd29c0 (LWP 1810286)):
[KCrash Handler]
#6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#7  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#9  0x00007f087e863c86 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#10 0x00007f087e84a7fc in __GI_abort () at ./stdlib/abort.c:79
#11 0x00007f087ead1b9e in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007f087eadd34c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f087eadd3b7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x00007f087eadd618 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#15 0x00007f087ead44c6 in std::__throw_out_of_range(char const*) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#16 0x00007f088039e99c in std::map<int, KateMDI::ToolView*, std::less<int>, std::allocator<std::pair<int const, KateMDI::ToolView*> > >::at (__k=<synthetic pointer>: <optimized out>, this=0x55db32b31d68) at /usr/include/c++/11/bits/stl_map.h:541
#17 KateMDI::Sidebar::saveSession (config=..., this=<optimized out>) at ./apps/lib/katemdi.cpp:1237
#18 KateMDI::Sidebar::saveSession (config=..., this=<optimized out>) at ./apps/lib/katemdi.cpp:1214
#19 KateMDI::MainWindow::saveSession (config=..., this=0x55db339c4bd0) at ./apps/lib/katemdi.cpp:1566
#20 KateMainWindow::saveProperties (this=0x55db339c4bd0, config=...) at ./apps/lib/katemainwindow.cpp:1110
#21 0x00007f087dec5a40 in KMainWindow::savePropertiesInternal (this=0x55db339c4bd0, config=config@entry=0x55db33f4a130, number=1) at ./src/kmainwindow.cpp:621
#22 0x00007f087dec5b62 in KMWSessionManager::saveState (this=<optimized out>, sm=...) at ./src/kmainwindow.cpp:142
#23 0x00007f087ef4c6ff in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f087f49e489 in QGuiApplication::saveStateRequest(QSessionManager&) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#25 0x00007f087f4a0a4f in QGuiApplicationPrivate::saveState() () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#26 0x00007f087974a045 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#27 0x00007f087974a187 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#28 0x00007f0879629ac2 in _SmcProcessMessage () from /lib/x86_64-linux-gnu/libSM.so.6
#29 0x00007f0879619c16 in IceProcessMessages () from /lib/x86_64-linux-gnu/libICE.so.6
#30 0x00007f087ef4c72c in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007f087ef4fb83 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007f087ef503b5 in QSocketNotifier::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007f087fbb1f32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#34 0x00007f087ef13e38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#35 0x00007f087ef6e695 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#36 0x00007f087cd2c4e9 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#37 0x00007f087cd81098 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007f087cd29ca0 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007f087ef6daea in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#40 0x00007f087ef127cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007f088024df9d in KJob::exec() () from /lib/x86_64-linux-gnu/libKF5CoreAddons.so.5
#42 0x00007f0878cd1e98 in KDirOperator::setUrl(QUrl const&, bool) () from /lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
#43 0x00007f087ef4c6ff in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x00007f0878d335e9 in KUrlNavigator::urlChanged(QUrl const&) () from /lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
#45 0x00007f0878d33b3a in ?? () from /lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
#46 0x00007f087ef4c6ff in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#47 0x00007f087e1c53b2 in KCoreUrlNavigator::setCurrentLocationUrl (this=0x55db33ef47b0, newUrl=...) at ./src/gui/kcoreurlnavigator.cpp:245
#48 0x00007f0878d36e25 in KUrlNavigator::setLocationUrl(QUrl const&) () from /lib/x86_64-linux-gnu/libKF5KIOFileWidgets.so.5
#49 0x00007f086324664d in KateFileBrowser::readSessionConfig (this=0x55db33e40a60, cg=...) at ./addons/filebrowser/katefilebrowser.cpp:179
#50 0x00007f08803a66d9 in KatePluginManager::enablePluginGUI (item=0x55db339b2380, win=win@entry=0x55db339c4bd0, config=config@entry=0x55db339f3b90) at ./apps/lib/katepluginmanager.cpp:248
#51 0x00007f08803a684d in KatePluginManager::enableAllPluginsGUI (this=0x7fffae9f3ad8, win=0x55db339c4bd0, config=0x55db339f3b90) at ./apps/lib/katepluginmanager.cpp:176
#52 0x00007f0880395770 in KateMainWindow::KateMainWindow (this=<optimized out>, sconfig=<optimized out>, sgroup=..., this=<optimized out>, sconfig=<optimized out>, sgroup=...) at ./apps/lib/katemainwindow.cpp:138
#53 0x00007f08803843a7 in KateApp::newMainWindow (sconfig_=<optimized out>, sgroup_=...) at ./apps/lib/kateapp.cpp:530
#54 0x00007f0880375020 in KateSessionManager::loadSession (this=this@entry=0x7fffae9f3af8, session=...) at ./apps/lib/session/katesessionmanager.cpp:184
#55 0x00007f08803770a3 in KateSessionManager::activateSession (this=this@entry=0x7fffae9f3af8, session=..., closeAndSaveLast=closeAndSaveLast@entry=false, loadNew=loadNew@entry=true) at ./apps/lib/session/katesessionmanager.cpp:145
#56 0x00007f0880377a9a in KateSessionManager::activateSession (this=0x7fffae9f3af8, name=..., closeAndSaveLast=closeAndSaveLast@entry=false, loadNew=loadNew@entry=true) at ./apps/lib/session/katesessionmanager.cpp:221
#57 0x00007f0880377b62 in KateSessionManager::activateAnonymousSession (this=<optimized out>) at ./apps/lib/session/katesessionmanager.cpp:226
#58 0x00007f088038b5bc in KateApp::startupKate (this=0x7fffae9f3a10) at ./apps/lib/kateapp.cpp:275
#59 0x000055db30d34385 in main (argc=<optimized out>, argv=<optimized out>) at ./apps/kate/main.cpp:590
----8<----
Comment 10 Oded Arbel 2022-09-25 06:05:26 UTC
Sorry for the bugspam, I just want to make sure that I mention that the repro for this updated crash stack is identical as I was previously doing: set `[Plugin:katefilebrowserplugin:MainWindow:0]` -> `location` to a non-existing directory and try to open a file with kate.
Comment 11 Lothar 2022-09-25 07:02:00 UTC
Hm, yes. After the request to use some bool I forgot to set it properly to true at some useful place. No idea why it has worked anyway. And the extra stuff by Christoph did it at the wrong place.
Comment 12 Bug Janitor Service 2022-09-25 07:14:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/904
Comment 13 Lothar 2022-09-25 10:38:22 UTC
Git commit 6daa2d968e388dbe075c149c53e2ab066de4f50d by loh tar.
Committed on 25/09/2022 at 10:26.
Pushed by cullmann into branch 'master'.

Sidebar: Set session restore flag at correct place

M  +8    -3    apps/lib/katemdi.cpp

https://invent.kde.org/utilities/kate/commit/6daa2d968e388dbe075c149c53e2ab066de4f50d