Bug 441859 - Kate crashes after closing the window
Summary: Kate crashes after closing the window
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 21.07.90
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
: 442417 442632 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-01 10:46 UTC by Rahul Chowdhury
Modified: 2021-09-21 18:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.08.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rahul Chowdhury 2021-09-01 10:46:05 UTC
Application: kate (21.07.90)

Qt Version: 5.15.2
Frameworks Version: 5.84.0
Operating System: Linux 5.13.0-14-generic x86_64
Windowing System: X11
Drkonqi Version: 5.22.4
Distribution: Ubuntu Impish Indri (development branch)

-- Information about the crash:
- What I was doing when the application crashed: Launched Kate, typed some random text, tried to close Kate without saving, clicked on "Discard" on the save-now popup while trying to close it.

- Unusual behavior I noticed: After clicking on Discard, Kate crashed.

- Custom settings of the application: None

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault
Content of s_kcrashErrorMessage: [Current thread is 1 (Thread 0x7f9065a33980 (LWP 18963))]
[KCrash Handler]
#6  0x0000557994f1eabb in qDeleteAll<__gnu_cxx::__normal_iterator<KateMDI::ToolView* const*, std::vector<KateMDI::ToolView*, std::allocator<KateMDI::ToolView*> > > > (end=..., begin=0x557997309230) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:320
#7  qDeleteAll<std::vector<KateMDI::ToolView*, std::allocator<KateMDI::ToolView*> > > (c=std::vector of length 1, capacity 32 = {...}) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:328
#8  KateMDI::MainWindow::~MainWindow (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at ./kate/katemdi.cpp:778
#9  KateMainWindow::~KateMainWindow (this=<optimized out>, this=<optimized out>) at ./kate/katemainwindow.cpp:181
#10 0x0000557994f1ef2d in KateMainWindow::~KateMainWindow (this=<optimized out>, this=<optimized out>) at ./kate/katemainwindow.cpp:203
#11 0x00007f906a571f23 in QObject::event (this=0x557996c89430, e=0x557997d05a60) at kernel/qobject.cpp:1301
#12 0x00007f906bcf456d in KXmlGuiWindow::event (this=0x557996c89430, ev=0x557997d05a60) at ./src/kxmlguiwindow.cpp:193
#13 0x00007f906b077783 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x557996c89430, e=0x557997d05a60) at kernel/qapplication.cpp:3632
#14 0x00007f906a54482a in QCoreApplication::notifyInternal2 (receiver=0x557996c89430, event=0x557997d05a60) at kernel/qcoreapplication.cpp:1063
#15 0x00007f906a547851 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5579959724b0) at kernel/qcoreapplication.cpp:1817
#16 0x00007f906a59ec17 in postEventSourceDispatch (s=0x557995a7bfc0) at kernel/qeventdispatcher_glib.cpp:277
#17 0x00007f906852c8bb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007f906857ff08 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f906852a003 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f906a59e274 in QEventDispatcherGlib::processEvents (this=0x557995a79b30, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#21 0x00007f906a54318b in QEventLoop::exec (this=this@entry=0x7ffdfb9f0350, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#22 0x00007f906a54b674 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#23 0x00007f906a922520 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#24 0x00007f906b0776f9 in QApplication::exec () at kernel/qapplication.cpp:2824
#25 0x0000557994f0e4fe in main (argc=<optimized out>, argv=<optimized out>) at ./kate/main.cpp:699
[Inferior 1 (process 18963) detached]

Possible duplicates by query: bug 441545, bug 441462, bug 441290, bug 440853, bug 440841.

Reported using DrKonqi
Comment 1 Nate Graham 2021-09-01 15:17:54 UTC
Do/did you have a terminal panel open in Kate?
Comment 2 Jan Paul Batrina 2021-09-14 09:58:33 UTC
*** Bug 442417 has been marked as a duplicate of this bug. ***
Comment 3 Jan Paul Batrina 2021-09-18 10:39:15 UTC
*** Bug 442632 has been marked as a duplicate of this bug. ***
Comment 4 Rahul Chowdhury 2021-09-19 18:51:29 UTC
(In reply to Nate Graham from comment #1)
> Do/did you have a terminal panel open in Kate?

I have the terminal plugin enabled but is not opened while reproducing this bug.
Comment 5 Nate Graham 2021-09-20 15:19:07 UTC
OK, maybe not Bug 441206.

Can you reproduce the issue?
Comment 6 Waqar Ahmed 2021-09-20 15:23:43 UTC
Unable to reproduce but a full stacktrace may be more helpful (the top 5 functions are missing...)

Can you maybe try to do the following:
- `gdb kate`
- make it crash
- go back to terminal and type: bt
- copy the backtrace and paste here.

Alternatively, you can try the following as well:
- Run Kate
- Make it crash
- once crashed, run the following command immediately:
 coredumpctl debug

Copy the backtrace here
Comment 7 Rahul Chowdhury 2021-09-21 04:51:32 UTC
(In reply to Nate Graham from comment #5)
> OK, maybe not Bug 441206.
> 
> Can you reproduce the issue?

Yes. If you open Kate, type something, and close Kate without saving the file the mainwindow closes and drkonqi is immediately triggered due to a crash then.
Comment 8 Rahul Chowdhury 2021-09-21 04:55:59 UTC
(In reply to Waqar Ahmed from comment #6)
> Unable to reproduce but a full stacktrace may be more helpful (the top 5
> functions are missing...)
> 
> Can you maybe try to do the following:
> - `gdb kate`
> - make it crash
> - go back to terminal and type: bt
> - copy the backtrace and paste here.
> 
> Alternatively, you can try the following as well:
> - Run Kate
> - Make it crash
> - once crashed, run the following command immediately:
>  coredumpctl debug
> 
> Copy the backtrace here

Here is a backtrace from gdb. If I am missing any additional debug symbols kindly let me know. Hope it helps.


rahul@IABLR-LT106:~$ gdb kate
GNU gdb (Ubuntu 11.1-0ubuntu2) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kate...
Reading symbols from /usr/lib/debug/.build-id/e3/85f6ce8444c56b6381a2ecd7991d6245455933.debug...
(gdb) r
Starting program: /usr/bin/kate 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffec0ba640 (LWP 33641)]
[New Thread 0x7fffead2c640 (LWP 33647)]
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kf.sonnet.clients.hspell: HSpellDict::HSpellDict: Init failed
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kf.sonnet.clients.hspell: HSpellDict::HSpellDict: Init failed
PluginXmlCheck()
[New Thread 0x7fffe3fff640 (LWP 33649)]
[New Thread 0x7fffe3184640 (LWP 33650)]
[New Thread 0x7fffe2983640 (LWP 33651)]
[New Thread 0x7fffca797640 (LWP 33652)]
[Detaching after fork from child process 33654]
[Detaching after fork from child process 33656]
[Detaching after fork from child process 33660]
[Detaching after fork from child process 33661]
[Detaching after fork from child process 33662]
Qt: Session management error: networkIdsList argument is NULL
[Thread 0x7fffe2983640 (LWP 33651) exited]
[Thread 0x7fffe3184640 (LWP 33650) exited]

Thread 1 "kate" received signal SIGSEGV, Segmentation fault.
0x00005555555a2bcb in qDeleteAll<__gnu_cxx::__normal_iterator<KateMDI::ToolView* const*, std::vector<KateMDI::ToolView*, std::allocator<KateMDI::ToolView*> > > > (end=..., begin=0x555556ff8020) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:320
320             delete *begin;
(gdb) bt
#0  0x00005555555a2bcb in qDeleteAll<__gnu_cxx::__normal_iterator<KateMDI::ToolView* const*, std::vector<KateMDI::ToolView*, std::allocator<KateMDI::ToolView*> > > > (end=..., begin=0x555556ff8020)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:320
#1  qDeleteAll<std::vector<KateMDI::ToolView*, std::allocator<KateMDI::ToolView*> > > (c=std::vector of length 1, capacity 32 = {...}) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qalgorithms.h:328
#2  KateMDI::MainWindow::~MainWindow (__vtt_parm=<optimized out>, this=<optimized out>, this=<optimized out>, __vtt_parm=<optimized out>) at ./kate/katemdi.cpp:778
#3  KateMainWindow::~KateMainWindow (this=<optimized out>, this=<optimized out>) at ./kate/katemainwindow.cpp:203
#4  0x00005555555a305d in KateMainWindow::~KateMainWindow (this=<optimized out>, this=<optimized out>) at ./kate/katemainwindow.cpp:203
#5  0x00007ffff5ff8543 in QObject::event (this=0x55555694f760, e=0x5555578dc4c0) at kernel/qobject.cpp:1301
#6  0x00007ffff7779dcd in KXmlGuiWindow::event (this=0x55555694f760, ev=0x5555578dc4c0) at ./src/kxmlguiwindow.cpp:219
#7  0x00007ffff6af76b3 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55555694f760, e=0x5555578dc4c0) at kernel/qapplication.cpp:3632
#8  0x00007ffff5fcb1ba in QCoreApplication::notifyInternal2 (receiver=0x55555694f760, event=0x5555578dc4c0) at kernel/qcoreapplication.cpp:1063
#9  0x00007ffff5fce2a7 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x555555650ec0) at kernel/qcoreapplication.cpp:1817
#10 0x00007ffff6024f57 in postEventSourceDispatch (s=0x555555747cd0) at kernel/qeventdispatcher_glib.cpp:277
#11 0x00007ffff3f9b8bb in g_main_dispatch (context=0x7fffe4005000) at ../../../glib/gmain.c:3337
#12 g_main_context_dispatch (context=0x7fffe4005000) at ../../../glib/gmain.c:4055
#13 0x00007ffff3feef08 in g_main_context_iterate.constprop.0 (context=context@entry=0x7fffe4005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4131
#14 0x00007ffff3f99003 in g_main_context_iteration (context=0x7fffe4005000, may_block=1) at ../../../glib/gmain.c:4196
#15 0x00007ffff60245a8 in QEventDispatcherGlib::processEvents (this=0x5555557574d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#16 0x00007ffff5fc9aeb in QEventLoop::exec (this=this@entry=0x7fffffffd700, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#17 0x00007ffff5fd2074 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#18 0x00007ffff63a5d00 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#19 0x00007ffff6af7629 in QApplication::exec () at kernel/qapplication.cpp:2824
#20 0x00005555555924ee in main (argc=<optimized out>, argv=<optimized out>) at ./kate/main.cpp:699
(gdb)
Comment 9 Waqar Ahmed 2021-09-21 05:40:06 UTC
@Rahul

Can you please share what plugins you have enabled? (Go to Settings->Configure Kate -> Plugins -> See enabled plugins)

Also, please share if you have the "Replicode Plugin" enabled.
Comment 10 Rahul Chowdhury 2021-09-21 05:46:50 UTC
(In reply to Waqar Ahmed from comment #9)
> @Rahul
> 
> Can you please share what plugins you have enabled? (Go to
> Settings->Configure Kate -> Plugins -> See enabled plugins)
> 
> Also, please share if you have the "Replicode Plugin" enabled.

Seems like all the available plugins are enabled. Here is a screenshot -> https://pasteboard.co/CHLOwAGTnoc7.png

And yes, Replicode among all other plugins is also enabled.
Comment 11 Rahul Chowdhury 2021-09-21 05:47:02 UTC
(In reply to Waqar Ahmed from comment #9)
> @Rahul
> 
> Can you please share what plugins you have enabled? (Go to
> Settings->Configure Kate -> Plugins -> See enabled plugins)
> 
> Also, please share if you have the "Replicode Plugin" enabled.

Seems like all the available plugins are enabled. Here is a screenshot -> https://pasteboard.co/CHLOwAGTnoc7.png

And yes, Replicode among all other plugins is also enabled.
Comment 12 Waqar Ahmed 2021-09-21 06:03:38 UTC
Great thanks. Patching it.
Comment 13 Waqar Ahmed 2021-09-21 06:13:36 UTC
Git commit e16167dafa3859f5e8a77d5dd02a14dc4b004576 by Waqar Ahmed.
Committed on 21/09/2021 at 06:12.
Pushed by waqar into branch 'master'.

Fix replicode plugin not deleting its toolview

M  +1    -1    addons/kate-ctags/kate_ctags_view.cpp
M  +1    -1    addons/kate-ctags/kate_ctags_view.h
M  +18   -18   addons/replicode/replicodeview.cpp
M  +2    -2    addons/replicode/replicodeview.h

https://invent.kde.org/utilities/kate/commit/e16167dafa3859f5e8a77d5dd02a14dc4b004576
Comment 14 Waqar Ahmed 2021-09-21 06:15:49 UTC
Git commit 727e9e883d174a4d8b25e4eb0f11dbc3e5f73d6d by Waqar Ahmed.
Committed on 21/09/2021 at 06:14.
Pushed by waqar into branch 'release/21.08'.

Fix replicode plugin not deleting its toolview
(cherry picked from commit e16167dafa3859f5e8a77d5dd02a14dc4b004576)

M  +1    -1    addons/kate-ctags/kate_ctags_view.cpp
M  +1    -1    addons/kate-ctags/kate_ctags_view.h
M  +18   -18   addons/replicode/replicodeview.cpp
M  +2    -2    addons/replicode/replicodeview.h

https://invent.kde.org/utilities/kate/commit/727e9e883d174a4d8b25e4eb0f11dbc3e5f73d6d
Comment 15 Waqar Ahmed 2021-09-21 06:16:47 UTC
Git commit 1d0983e16161f066ee8cd5707df6dce170e71e19 by Waqar Ahmed.
Committed on 21/09/2021 at 06:15.
Pushed by waqar into branch 'release/21.04'.

Fix replicode plugin not deleting its toolview
(cherry picked from commit e16167dafa3859f5e8a77d5dd02a14dc4b004576)

M  +1    -1    addons/kate-ctags/kate_ctags_view.cpp
M  +1    -1    addons/kate-ctags/kate_ctags_view.h
M  +18   -18   addons/replicode/replicodeview.cpp
M  +2    -2    addons/replicode/replicodeview.h

https://invent.kde.org/utilities/kate/commit/1d0983e16161f066ee8cd5707df6dce170e71e19
Comment 16 Rahul Chowdhury 2021-09-21 06:20:34 UTC
Many thanks for the patch, @Wakar. Will wait for it to get shipped to Kubuntu 21.10 packages before I can start using it.
Comment 17 Waqar Ahmed 2021-09-21 09:52:30 UTC
You can disable the Replicode plugin for now and it will not crash.