Bug 477224 - Crash after pressing both mouse buttons
Summary: Crash after pressing both mouse buttons
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.08.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-11-19 10:07 UTC by Grósz Dániel
Modified: 2024-03-14 17:12 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 Grósz Dániel 2023-11-19 10:07:45 UTC
Application: kate (23.08.1)

Qt Version: 5.15.10
Frameworks Version: 5.110.0
Operating System: Linux 6.5.4-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.8 [KCrashBackend]

-- Information about the crash:
I accidentally pressed the right and the left mouse buttons at the same time over the text editor area. Kate immediately crashed.

I think I pressed the right one first. I don't know whether the mouse moved slightly over the context menu in the meantime (where the first action would be Cut), nor if anything was selected. Pressing both of them at the same time is NOT configured to emulate middle click. It's a regular mouse (not touchpad), and the system is X11.

The crash does not seem to be reproducible.

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

[KCrash Handler]
#4  QObjectPrivate::setParent_helper(QObject*) (this=0x55c1384a82a0, o=0x55c1382dba00) at kernel/qobject.cpp:2168
#5  0x00007fdf88723629 in QObject::setParent(QObject*) (this=<optimized out>, parent=<optimized out>) at kernel/qobject.cpp:2124
#6  0x00007fdf41bc3897 in LSPClientPluginViewImpl::prepareContextMenu(KTextEditor::View*, QMenu*) (this=0x55c138479110, view=<optimized out>, menu=0x55c1382dba00) at /usr/src/debug/kate-23.08.1/addons/lspclient/lspclientpluginview.cpp:2460
#7  0x00007fdf88725812 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc92b17f90, r=0x55c138479110, this=0x55c138bcb150) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#8  doActivate<false>(QObject*, int, void**) (sender=0x55c138c810c0, signal_index=12, argv=0x7ffc92b17f90) at kernel/qobject.cpp:3925
#9  0x00007fdf8871e47f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=<optimized out>, local_signal_index=local_signal_index@entry=5, argv=argv@entry=0x7ffc92b17f90) at kernel/qobject.cpp:3985
#10 0x00007fdf87a221b7 in KTextEditor::View::contextMenuAboutToShow(KTextEditor::View*, QMenu*) (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at /usr/src/debug/ktexteditor-5.110.0/build/src/KF5TextEditor_autogen/include/moc_view.cpp:428
#11 0x00007fdf88725812 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc92b18040, r=0x55c138c810c0, this=0x7fdf740402b0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#12 doActivate<false>(QObject*, int, void**) (sender=0x55c1382dba00, signal_index=7, argv=0x7ffc92b18040) at kernel/qobject.cpp:3925
#13 0x00007fdf8871e47f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55c1382dba00, m=m@entry=0x7fdf89ac7be0 <QMenu::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3985
#14 0x00007fdf89724240 in QMenu::aboutToShow() (this=this@entry=0x55c1382dba00) at .moc/moc_qmenu.cpp:270
#15 0x00007fdf89729d3e in QMenuPrivate::popup(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) (this=0x55c13d507c30, p=..., atAction=atAction@entry=0x0, positionFunction=...) at widgets/qmenu.cpp:2409
#16 0x00007fdf8972ab9e in QMenu::popup(QPoint const&, QAction*) (this=this@entry=0x55c1382dba00, p=..., atAction=atAction@entry=0x0) at widgets/qmenu.cpp:2353
#17 0x00007fdf879d8e78 in KateViewInternal::contextMenuEvent(QContextMenuEvent*) (this=<optimized out>, e=<optimized out>) at /usr/src/debug/ktexteditor-5.110.0/src/view/kateviewinternal.cpp:3371
#18 0x00007fdf895e6d68 in QWidget::event(QEvent*) (this=0x55c138c6d110, event=0x7ffc92b18610) at kernel/qwidget.cpp:9045
#19 0x00007fdf895a519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x55c136ec58a0, receiver=receiver@entry=0x55c138c6d110, e=e@entry=0x7ffc92b18610) at kernel/qapplication.cpp:3640
#20 0x00007fdf895adaaa in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=<optimized out>, e=0x7ffc92b18610) at kernel/qapplication.cpp:3246
#21 0x00007fdf886ed568 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c138c6d110, event=0x7ffc92b18610) at kernel/qcoreapplication.cpp:1064
#22 0x00007fdf886ed5b2 in QCoreApplication::forwardEvent(QObject*, QEvent*, QEvent*) (receiver=<optimized out>, event=<optimized out>, originatingEvent=<optimized out>) at kernel/qcoreapplication.cpp:1079
#23 0x00007fdf895fff59 in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=this@entry=0x55c138c06600, event=event@entry=0x7ffc92b18900) at kernel/qwidgetwindow.cpp:692
#24 0x00007fdf89602d1f in QWidgetWindow::event(QEvent*) (this=0x55c138c06600, event=0x7ffc92b18900) at kernel/qwidgetwindow.cpp:300
#25 0x00007fdf895a519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55c138c06600, e=0x7ffc92b18900) at kernel/qapplication.cpp:3640
#26 0x00007fdf886ed568 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c138c06600, event=0x7ffc92b18900) at kernel/qcoreapplication.cpp:1064
#27 0x00007fdf886ed73e in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#28 0x00007fdf88b7d0eb in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0x55c13d3ce7e0) at kernel/qguiapplication.cpp:2285
#29 0x00007fdf88b5036c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#30 0x00007fdf8431b1aa in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#31 0x00007fdf85f13ef0 in  () at /lib64/libglib-2.0.so.0
#32 0x00007fdf85f15b18 in  () at /lib64/libglib-2.0.so.0
#33 0x00007fdf85f161cc in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#34 0x00007fdf887464a6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55c13702ffb0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#35 0x00007fdf886ebffb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc92b18c30, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#36 0x00007fdf886f4490 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#37 0x00007fdf88b7055c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#38 0x00007fdf895a5115 in QApplication::exec() () at kernel/qapplication.cpp:2832
#39 0x000055c1362d4478 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kate-23.08.1/apps/kate/main.cpp:609
[Inferior 1 (process 31494) detached]

Reported using DrKonqi
Comment 1 Christoph Cullmann 2023-11-25 17:16:20 UTC
Hmmm, instead of that self managing, can we not just add these actions to the xmlgui file like the ctags plugin does it?

  <Menu name="ktexteditor_popup" noMerge="1">
    <Action name="popup_ctags"/>
  </Menu>

We can even add some merge area if we need that.
Comment 2 Grósz Dániel 2023-11-25 21:13:16 UTC
(In reply to Christoph Cullmann from comment #1)
> Hmmm, instead of that self managing, can we not just add these actions to
> the xmlgui file like the ctags plugin does it?
> 
>   <Menu name="ktexteditor_popup" noMerge="1">
>     <Action name="popup_ctags"/>
>   </Menu>
> 
> We can even add some merge area if we need that.

Did you mean to post this under this bug?
Comment 3 Christoph Cullmann 2023-11-25 22:15:39 UTC
Yes, as comment how we might fix the stuff in LSPClientPluginViewImpl::prepareContextMenu that seems to crash below.
Comment 4 Grósz Dániel 2023-11-25 23:11:01 UTC
(In reply to Christoph Cullmann from comment #3)
> Yes, as comment how we might fix the stuff in
> LSPClientPluginViewImpl::prepareContextMenu that seems to crash below.

Ah, OK.
Comment 5 Bug Janitor Service 2023-12-09 18:14:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1371
Comment 6 Christoph Cullmann 2024-03-14 17:12:24 UTC
Git commit 02d8b49b0995ce616f9a7ffbedda7e7fecb8c5eb by Christoph Cullmann.
Committed on 14/03/2024 at 17:12.
Pushed by cullmann into branch 'master'.

move lsp context menu actions to xmlgui

avoids crashes

M  +9    -62   addons/lspclient/lspclientpluginview.cpp
M  +11   -1    addons/lspclient/ui.rc

https://invent.kde.org/utilities/kate/-/commit/02d8b49b0995ce616f9a7ffbedda7e7fecb8c5eb