Bug 450434 - Kate crashes when right clicking on a toolbar button before a file was loaded
Summary: Kate crashes when right clicking on a toolbar button before a file was loaded
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 21.12.2
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-02-17 09:20 UTC by Benjamin Huth
Modified: 2023-01-24 08:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screen video showing the crash (529.53 KB, video/mp4)
2022-02-19 13:18 UTC, Benjamin Huth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Huth 2022-02-17 09:20:56 UTC
Application: kate (21.12.2)

Qt Version: 5.15.2
Frameworks Version: 5.90.0
Operating System: Linux 5.16.7-200.fc35.x86_64 x86_64
Windowing System: X11
Distribution: "Fedora release 35 (Thirty Five)"
DrKonqi: 5.23.5 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:

I have a toolbar button configured with a custom "External tool" command, which is only available for *.py files. When I open Kate, it has no file open first. Then I open a *.py file and quickly right click on the still greyed-out button.
Then Kate crashes. When I wait some time, and do then the right-click, it does not happen anymore.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f73a72fbc58 in KActionCollection::KActionCollection(KXMLGUIClient const*) () from /lib64/libKF5XmlGui.so.5
#5  0x00007f73a733697b in KXMLGUIClient::actionCollection() const () from /lib64/libKF5XmlGui.so.5
#6  0x00007f73a7328f1d in KToolBarPrivate::findAction(QString const&, KXMLGUIClient**) const () from /lib64/libKF5XmlGui.so.5
#7  0x00007f73a732d5c4 in QtPrivate::QFunctorSlotObject<KToolBarPrivate::contextMenu(QPoint const&)::{lambda()#14}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) () from /lib64/libKF5XmlGui.so.5
#8  0x00007f73a5bc73e9 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#9  0x00007f73a682d50d in QMenuPrivate::popup(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) () from /lib64/libQt5Widgets.so.5
#10 0x00007f73a682ebf3 in QMenuPrivate::exec(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) () from /lib64/libQt5Widgets.so.5
#11 0x00007f73a682ed53 in QMenu::exec(QPoint const&, QAction*) () from /lib64/libQt5Widgets.so.5
#12 0x00007f73a732ca03 in KToolBar::contextMenuEvent(QContextMenuEvent*) () from /lib64/libKF5XmlGui.so.5
#13 0x00007f73a66e5e7e in QWidget::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#14 0x00007f73a66a3443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#15 0x00007f73a66aa9b4 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#16 0x00007f73a5b937d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#17 0x00007f73a66ffbb4 in QWidgetWindow::handleMouseEvent(QMouseEvent*) () from /lib64/libQt5Widgets.so.5
#18 0x00007f73a67026e5 in QWidgetWindow::event(QEvent*) () from /lib64/libQt5Widgets.so.5
#19 0x00007f73a66a3443 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#20 0x00007f73a5b937d8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#21 0x00007f73a5fe6b98 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /lib64/libQt5Gui.so.5
#22 0x00007f73a5fc6c9c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Gui.so.5
#23 0x00007f7393d6611e in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5XcbQpa.so.5
#24 0x00007f73a3f0d05f in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#25 0x00007f73a3f622a8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#26 0x00007f73a3f0a853 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#27 0x00007f73a5be4bb8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#28 0x00007f73a5b921e2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#29 0x00007f73a5b9a724 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#30 0x0000563d137927ce in main ()
[Inferior 1 (process 29274) detached]

Possible duplicates by query: bug 92311, bug 90666, bug 78451, bug 297221, bug 150911.

Reported using DrKonqi
Comment 1 Benjamin Huth 2022-02-17 09:30:15 UTC
This seems also to happen when I open an e.g. *.cpp file and then right click on the greyed-out button after some time. So it seems to be related with the fact that the external-tool is only enabled with a certain file extension
Comment 2 Christoph Cullmann 2022-02-17 19:37:28 UTC
Hmm, tried to reproduce this but failed so far.
I added some button that is only active for C++ files, nothing happens if I click on the greyed out state.
Comment 3 Benjamin Huth 2022-02-19 13:18:26 UTC
Created attachment 146933 [details]
Screen video showing the crash

Today I also could only reproduce the crash with right-clicking the python-only button very quickly after loading the file. I recorded a small screen-video to illustrate this.
Comment 4 Christoph Cullmann 2022-03-05 18:38:12 UTC
Hmm, can't reproduce, sorry.

Did you get any other backtrace then the one below in the other crashes?
Comment 5 Pozsgay Máté 2022-04-28 13:48:54 UTC
I can confirm this issue. I can trigger almost every time when I start a new kate session (or change it to another one) and rightclick on an empty space of the toolbar.

Kate: 22.04.0, Appimage version on Ubuntu 20.04.04
Comment 6 Pozsgay Máté 2022-04-28 14:05:39 UTC
You don't have to click on an empty space, it crashes on any part of the toolbar.
Running kate on one CPU fixes/hides (/making it very unlikely to happen) the issue: taskset -a -c 1 ./kate-22.04.0-485-linux-64-gcc.AppImage
It is not always repruducable, just do a few Session->New Session; Rigth click on toolbar cycle to trigger the issue with different delay between these actions.
Comment 7 Pozsgay Máté 2022-04-28 14:23:52 UTC
(In reply to Pozsgay Máté from comment #6)
> Running kate on one CPU fixes/hides (/making it very unlikely to happen) the
> issue: taskset -a -c 1 ./kate-22.04.0-485-linux-64-gcc.AppImage

It is just less likely to crash, beeing very quick with the right click after the new session still results a pretty consitent crash.
Comment 8 Christoph Cullmann 2023-01-02 18:02:51 UTC
Can really not reproduce, please test again with e.g. version 22.12.x
Comment 9 Pozsgay Máté 2023-01-09 10:11:45 UTC
(In reply to Christoph Cullmann from comment #8)
> Can really not reproduce, please test again with e.g. version 22.12.x

Neither can I, it looks like it is fixed. I'm currently on version 23.03.70
Comment 10 Bug Janitor Service 2023-01-24 05:04:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Benjamin Huth 2023-01-24 08:36:40 UTC
Actually it seems to be fixed for me as well with kate 22.12.1. Cannot reproduce anymore. Thank you all anyways!