Bug 446830 - Konsole crashes when splitting a window
Summary: Konsole crashes when splitting a window
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: tabbar (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-11 13:52 UTC by kde.bugs
Modified: 2022-01-12 19:05 UTC (History)
1 user (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 kde.bugs 2021-12-11 13:52:29 UTC
SUMMARY
I couldn't get a backtrace. The window that automatically shows up to report crashes says it couldn't collect enough information.


STEPS TO REPRODUCE
1. Press "Load a new tab with layout 2x1 terminals"
2. Go back to original tab
3. Close the newly created tab with 2x1 terminals
4. In the original tab press "Split View Left/Right/

OBSERVED RESULT
It should split the view to give two terminals.

EXPECTED RESULT
The entire application crashes immediately. 

SOFTWARE/OS VERSIONS

 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Graphics Platform: Wayland and X11 (crashes on both)

ADDITIONAL INFORMATION
Comment 1 Bernie Innocenti 2021-12-22 05:57:55 UTC
I was able to reproduce this with konsole built from git master:

(gdb) r
Starting program: /home/bernie/kde/usr/bin/konsole 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffefefc640 (LWP 226434)]
QIBusPlatformInputContext: invalid portal bus.
QSocketNotifier: Can only be used with threads started with QThread
[New Thread 0x7fffe17d1640 (LWP 226436)]
[New Thread 0x7fffe0fd0640 (LWP 226437)]
[New Thread 0x7fffdbfff640 (LWP 226438)]
[New Thread 0x7fffdb7fe640 (LWP 226439)]
[New Thread 0x7fffdaffd640 (LWP 226440)]
[New Thread 0x7fffda7fc640 (LWP 226441)]
[New Thread 0x7fffd9ffb640 (LWP 226442)]
[New Thread 0x7fffd97fa640 (LWP 226443)]
[New Thread 0x7fffd8ff9640 (LWP 226444)]
[Detaching after fork from child process 226445]
[New Thread 0x7fffabc95640 (LWP 226467)]
[Detaching after fork from child process 226468]
[Detaching after fork from child process 226470]
[Detaching after fork from child process 226472]
[Detaching after fork from child process 226474]
[Detaching after fork from child process 226476]
[Detaching after fork from child process 226478]
QIBusPlatformInputContext: invalid portal bus.
QSocketNotifier: Can only be used with threads started with QThread
[Detaching after fork from child process 226492]
[Detaching after fork from child process 226494]
[Detaching after fork from child process 226496]
[Detaching after fork from child process 226499]
[Detaching after fork from child process 226501]
[Detaching after fork from child process 226544]
[Detaching after fork from child process 226545]
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x555555c37360) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x555556289160) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
ASSERT: "currentSessionId >= 0" in file /home/bernie/kde/src/konsole/src/ViewManager.cpp, line 603

Thread 1 "konsole" received signal SIGABRT, Aborted.
0x00007ffff4bd9d22 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff4bd9d22 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff4bc3862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff516e910 in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#3  0x00007ffff516dcf5 in qt_assert(char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
#4  0x00007ffff7d2a7ef in Konsole::ViewManager::splitView (this=0x555555827c20, orientation=Qt::Horizontal)
    at /home/bernie/kde/src/konsole/src/ViewManager.cpp:603
#5  0x00007ffff7d2a77b in Konsole::ViewManager::splitLeftRight (this=0x555555827c20) at /home/bernie/kde/src/konsole/src/ViewManager.cpp:591
#6  0x00007ffff7d38176 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Konsole::ViewManager::*)()>::call(void (Konsole::ViewManager::*)(), Konsole::ViewManager*, void**) (
    f=(void (Konsole::ViewManager::*)(Konsole::ViewManager * const)) 0x7ffff7d2a75e <Konsole::ViewManager::splitLeftRight()>, o=0x555555827c20, 
    arg=0x7fffffffc8b0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#7  0x00007ffff7d375c0 in QtPrivate::FunctionPointer<void (Konsole::ViewManager::*)()>::call<QtPrivate::List<>, void>(void (Konsole::ViewManager::*)(), Konsole::ViewManager*, void**) (f=(void (Konsole::ViewManager::*)(Konsole::ViewManager * const)) 0x7ffff7d2a75e <Konsole::ViewManager::splitLeftRight()>, 
    o=0x555555827c20, arg=0x7fffffffc8b0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#8  0x00007ffff7d3617d in QtPrivate::QSlotObject<void (Konsole::ViewManager::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555555831810, r=0x555555827c20, a=0x7fffffffc8b0, ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:418
#9  0x00007ffff53ce7cb in ?? () from /usr/lib/libQt5Core.so.5
#10 0x00007ffff60a4203 in QAction::triggered(bool) () from /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff60a6f18 in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt5Widgets.so.5
#12 0x00007ffff6234103 in ?? () from /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff623be39 in ?? () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff60ee0be in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff60aad62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff60b2ac9 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff539741a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#18 0x00007ffff60b157b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
   from /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff6108593 in ?? () from /usr/lib/libQt5Widgets.so.5
#20 0x00007ffff610adb5 in ?? () from /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff60aad62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#22 0x00007ffff539741a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#23 0x00007ffff586c1f0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/libQt5Gui.so.5
#24 0x00007ffff58417d5 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#25 0x00007ffff3d581e1 in ?? () from /usr/lib/libQt5WaylandClient.so.5
#26 0x00007ffff2d2b52c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#27 0x00007ffff2d7f7b9 in ?? () from /usr/lib/libglib-2.0.so.0
#28 0x00007ffff2d28c11 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#29 0x00007ffff53f0046 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#30 0x00007ffff5395d8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#31 0x00007ffff539e2f4 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#32 0x000055555555a98b in main (argc=1, argv=0x7fffffffd7b8) at /home/bernie/kde/src/konsole/src/main.cpp:242
Comment 2 Bernie Innocenti 2021-12-22 06:00:27 UTC
#4  0x00007ffff7d2a7ef in Konsole::ViewManager::splitView (this=0x555555827c20, orientation=Qt::Horizontal)
    at /home/bernie/kde/src/konsole/src/ViewManager.cpp:603
603         Q_ASSERT(currentSessionId >= 0);
(gdb) list
598
599     void ViewManager::splitView(Qt::Orientation orientation)
600     {
601         int currentSessionId = currentSession();
602         // At least one display/session exists if we are splitting
603         Q_ASSERT(currentSessionId >= 0);
604
605         Session *activeSession = SessionManager::instance()->idToSession(currentSessionId);
606         Q_ASSERT(activeSession);
607
(gdb) p currentSessionId
$1 = -1
Comment 3 Bug Janitor Service 2022-01-10 22:56:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/578
Comment 4 Kurt Hindenburg 2022-01-12 19:05:34 UTC
Git commit a07c45949c86804ccbad795fbbe0dfbdb3135151 by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 12/01/2022 at 18:48.
Pushed by hindenburg into branch 'master'.

Switch focus when closing inactive tab with splits

When closing an inactive tab with splits, focusAnotherTerminal() was not
transferring focus to any TerminalDisplay, resulting in having no active
session on ViewManager, which would then crash when splitting the view.

M  +3    -1    src/ViewManager.cpp

https://invent.kde.org/utilities/konsole/commit/a07c45949c86804ccbad795fbbe0dfbdb3135151