Bug 448847 - Kate crashed in (KateViewSpace::closeDocument) when clicking on the close button for the tab immediately to the left of the active one
Summary: Kate crashed in (KateViewSpace::closeDocument) when clicking on the close but...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-01-20 19:21 UTC by Nate Graham
Modified: 2022-01-21 18:59 UTC (History)
1 user (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 Nate Graham 2022-01-20 19:21:35 UTC
Application: kate (22.03.70)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.91.0
Operating System: Linux 5.15.14-200.fc35.x86_64 x86_64
Windowing System: Wayland
Distribution: Fedora Linux 35 (KDE Plasma)
DrKonqi: 5.24.80 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
I closed the tab immediately to the left of the active tab. This is 100% reproducible for me. Kate and all other KDE software are built from source with today's git master.

The crash can be reproduced every time.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = 0x0}
[KCrash Handler]
#5  KateViewSpace::closeDocument (this=0x223ff90, doc=<optimized out>) at /home/nate/kde/src/kate/kate/kateviewspace.cpp:413
#6  0x00007fa600989f49 in QObject::event (this=0x223ff90, e=0x2c9abc0) at kernel/qobject.cpp:1314
#7  0x00007fa60162f443 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x223ff90, e=0x2c9abc0) at kernel/qapplication.cpp:3632
#8  0x00007fa60095f7d8 in QCoreApplication::notifyInternal2 (receiver=0x223ff90, event=0x2c9abc0) at kernel/qcoreapplication.cpp:1064
#9  0x00007fa600962d46 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0xd30590) at kernel/qcoreapplication.cpp:1821
#10 0x00007fa6009b1117 in postEventSourceDispatch (s=0xd7ca40) at kernel/qeventdispatcher_glib.cpp:277
#11 0x00007fa5fed8a130 in g_main_dispatch (context=0xd78ba0) at ../glib/gmain.c:3381
#12 g_main_context_dispatch (context=0xd78ba0) at ../glib/gmain.c:4099
#13 0x00007fa5feddf208 in g_main_context_iterate.constprop.0 (context=context@entry=0xd78ba0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175
#14 0x00007fa5fed87933 in g_main_context_iteration (context=0xd78ba0, may_block=1) at ../glib/gmain.c:4240
#15 0x00007fa6009b0bb8 in QEventDispatcherGlib::processEvents (this=0xd7a8a0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#16 0x00007fa60095e1e2 in QEventLoop::exec (this=this@entry=0x7ffca3d86ae0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#17 0x00007fa600966724 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#18 0x00007fa600f5ec40 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1860
#19 0x00007fa60162f3b9 in QApplication::exec () at kernel/qapplication.cpp:2824
#20 0x0000000000437a43 in main (argc=<optimized out>, argv=<optimized out>) at /home/nate/kde/src/kate/kate/main.cpp:700
[Inferior 1 (process 70320) detached]

Possible duplicates by query: bug 448137, bug 447553, bug 445683, bug 443940, bug 443387.

Reported using DrKonqi
Comment 1 Waqar Ahmed 2022-01-20 19:41:07 UTC
Seems like you are using splits?
Comment 2 Nate Graham 2022-01-20 19:51:51 UTC
No, I don't have any splits.
Comment 3 Waqar Ahmed 2022-01-21 05:50:28 UTC
Git commit 38527c72981977b5806cf922a0dec65b17ad955a by Waqar Ahmed.
Committed on 21/01/2022 at 05:50.
Pushed by waqar into branch 'master'.

Fix the check to also handle 0 doc views

M  +4    -4    kate/kateviewspace.cpp

https://invent.kde.org/utilities/kate/commit/38527c72981977b5806cf922a0dec65b17ad955a
Comment 4 Waqar Ahmed 2022-01-21 05:52:18 UTC
The linked commit fixes it for me for the following scenario:

- I open an existing kate session with docs >= 2
- I try to close a doc that is other than the current one
- crash

Reopen, if it still crashes. Thanks for bringing it up so early.
Comment 5 Nate Graham 2022-01-21 18:59:42 UTC
That fixes it for me; thanks so much!