Bug 411741 - Konsole crashes when rearranging split views
Summary: Konsole crashes when rearranging split views
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: split-view (show other bugs)
Version: 19.08.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-09 06:48 UTC by Schlaefer
Modified: 2020-11-02 18:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.12


Attachments
Clip showing the steps to reproduce (774.65 KB, video/mp4)
2019-09-09 06:48 UTC, Schlaefer
Details
Video (89.12 KB, video/mp4)
2020-10-22 23:50 UTC, Justin Zobel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Schlaefer 2019-09-09 06:48:27 UTC
Created attachment 122553 [details]
Clip showing the steps to reproduce

SUMMARY

Konsole crashes when rearranging split views.

STEPS TO REPRODUCE
1. Open Konsole

[1]

2. Split horizontally

[1][2]

3. Split vertically

⎡1⎤[2]
⎣ ⎦[3]

4. Close the last created [3]

[1][2]

5. Drag [2] to the below [1]

[1]
[2]

OBSERVED RESULT

Konsole crashes reproducible. 

Thread 1 (Thread 0x7f48566a0800 (LWP 7259)):
[KCrash Handler]
#6  0x00007f485d4f6d1c in Konsole::TerminalDisplay::updateReadOnlyState(bool) () from /usr/lib/libkonsoleprivate.so.19
#7  0x00007f485bed2bb3 in ?? () from /usr/lib/libQt5Core.so.5
#8  0x00007f485bec63e5 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#9  0x00007f485c8514d5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#10 0x00007f485c85aa21 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#11 0x00007f485be999c2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#12 0x00007f485bef0d3d in QTimerInfoList::activateTimers() () from /usr/lib/libQt5Core.so.5
#13 0x00007f485bef15d2 in ?? () from /usr/lib/libQt5Core.so.5
#14 0x00007f4859f24cf4 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#15 0x00007f4859f26b11 in ?? () from /usr/lib/libglib-2.0.so.0
#16 0x00007f4859f26b51 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#17 0x00007f485bef19a3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#18 0x00007f485be985ec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#19 0x00007f485bea0326 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#20 0x00007f485d764454 in kdemain () from /usr/lib/libkdeinit5_konsole.so
#21 0x00007f485d598ee3 in __libc_start_main () from /usr/lib/libc.so.6
#22 0x00005565444da05e in _start ()

SOFTWARE/OS VERSIONS

Operating System: Manjaro Linux 
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.61.0
Qt Version: 5.13.0
Kernel Version: 5.2.11-1-MANJARO
Comment 1 Justin Zobel 2020-10-22 23:50:30 UTC
Created attachment 132647 [details]
Video

I have tested on 20.08.1 and while it doesn't crash it does close konsole, which I don't think is the intended behaviour.
Comment 2 Bug Janitor Service 2020-10-31 18:54:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/263
Comment 3 Kurt Hindenburg 2020-11-02 18:15:30 UTC
Git commit c33eba8c60b99d00cd73c400d23b6f338ef32a85 by Kurt Hindenburg, on behalf of Carlos Alves.
Committed on 02/11/2020 at 18:14.
Pushed by hindenburg into branch 'master'.

Fix konsole crashes when rearranging split views

I'll try to explain here what I saw in this bug.
Following the BUG instructions, drag the terminal[2] and drop
(here the "drop event" starts)
-> the dragged terminal "ViewSplitter" become scheduled for deletion,
but it will only happens when it is in event loop.
-> And of course it is not in event loop yet, it is still the
"drop event" and it call the "addTerminalDisplay" to add the dragged
 terminal to a "ViewSplitter".
-> This makes count() counts this scheduled for deletion "ViewSplitter"
 and goes to the wrong "if".
-> It adds the "ViewSplitter" with the terminals into a
"marked for deletion" one, finishes the "drop event" and enters
event loop (a crash without a memleak! everything in the tab
 is properly deleted).
Related: bug 412596
FIXED-IN: 20.12

M  +4    -0    src/widgets/ViewSplitter.cpp

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