Bug 449378 - wayland: Crash when trying to open context menu
Summary: wayland: Crash when trying to open context menu
Status: RESOLVED FIXED
Alias: None
Product: kwayland
Classification: Frameworks and Libraries
Component: client (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-01-30 16:59 UTC by Waqar Ahmed
Modified: 2024-06-07 14:14 UTC (History)
5 users (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 Waqar Ahmed 2022-01-30 16:59:35 UTC
STEPS TO REPRODUCE
1. Open kate
2. Try to open context menu a few times by clicking on different places in the view. Use right click / two finger tap
3. Crash

Backtrace:

==494679==ERROR: AddressSanitizer: SEGV on unknown address 0x0000558001f3 (pc 0x7feb8f4136a1 bp 0x7ffc788e31b8 sp 0x7ffc788e3110 T0)
==494679==The signal is caused by a READ memory access.
    #0 0x7feb8f4136a1 in operator<<(QDebug, QObject const*) (/usr/lib/libQt5Core.so.5+0x2bb6a1)
    #1 0x7feb745816c6 in QtWaylandClient::QWaylandXdgSurface::setGrabPopup(QtWaylandClient::QWaylandWindow*, QtWaylandClient::QWaylandInputDevice*, int) (/usr/lib/qt/plugins/wayland-shell-integration/libxdg-shell.so+0xa6c6)
    #2 0x7feb74581b4f in QtWaylandClient::QWaylandXdgSurface::QWaylandXdgSurface(QtWaylandClient::QWaylandXdgShell*, xdg_surface*, QtWaylandClient::QWaylandWindow*) (/usr/lib/qt/plugins/wayland-shell-integration/libxdg-shell.so+0xab4f)
    #3 0x7feb745822a5 in QtWaylandClient::QWaylandXdgShell::getXdgSurface(QtWaylandClient::QWaylandWindow*) (/usr/lib/qt/plugins/wayland-shell-integration/libxdg-shell.so+0xb2a5)
    #4 0x7feb8d1fc881 in QtWaylandClient::QWaylandWindow::initWindow() (/usr/lib/libQt5WaylandClient.so.5+0x7b881)
    #5 0x7feb8d1fcc1a in QtWaylandClient::QWaylandWindow::setVisible(bool) (/usr/lib/libQt5WaylandClient.so.5+0x7bc1a)
    #6 0x7feb8f9380a2 in QWindowPrivate::setVisible(bool) (/usr/lib/libQt5Gui.so.5+0x14b0a2)
    #7 0x7feb900e77ae in QWidgetPrivate::show_sys() (/usr/lib/libQt5Widgets.so.5+0x1aa7ae)
    #8 0x7feb900eb268 in QWidgetPrivate::show_helper() (/usr/lib/libQt5Widgets.so.5+0x1ae268)
    #9 0x7feb900eb87c in QWidgetPrivate::setVisible(bool) (/usr/lib/libQt5Widgets.so.5+0x1ae87c)
    #10 0x7feb90236fde  (/usr/lib/libQt5Widgets.so.5+0x2f9fde)
    #11 0x7feb902375f0 in QMenu::popup(QPoint const&, QAction*) (/usr/lib/libQt5Widgets.so.5+0x2fa5f0)
    #12 0x7feb9383ad05 in KateViewInternal::contextMenuEvent(QContextMenuEvent*) /home/waqar/kde/src/frameworks/ktexteditor/src/view/kateviewinternal.cpp:2910
    #13 0x7feb900ecd46 in QWidget::event(QEvent*) (/usr/lib/libQt5Widgets.so.5+0x1afd46)
    #14 0x7feb900b61a5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x1791a5)
    #15 0x7feb900ba874 in QApplication::notify(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x17d874)
    #16 0x7feb8f3e39b9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib/libQt5Core.so.5+0x28b9b9)
    #17 0x7feb9010afae  (/usr/lib/libQt5Widgets.so.5+0x1cdfae)
    #18 0x7feb9010c3db  (/usr/lib/libQt5Widgets.so.5+0x1cf3db)
    #19 0x7feb900b61a5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt5Widgets.so.5+0x1791a5)
    #20 0x7feb8f3e39b9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib/libQt5Core.so.5+0x28b9b9)
    #21 0x7feb8f929f5f in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (/usr/lib/libQt5Gui.so.5+0x13cf5f)
    #22 0x7feb8f9155e4 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt5Gui.so.5+0x1285e4)
    #23 0x7feb8d22ebb4  (/usr/lib/libQt5WaylandClient.so.5+0xadbb4)
    #24 0x7feb8d3f5fd2 in g_main_context_dispatch (/usr/lib/libglib-2.0.so.0+0x54fd2)
    #25 0x7feb8d44c048  (/usr/lib/libglib-2.0.so.0+0xab048)
    #26 0x7feb8d3f3544 in g_main_context_iteration (/usr/lib/libglib-2.0.so.0+0x52544)
    #27 0x7feb8f42ec89 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt5Core.so.5+0x2d6c89)
    #28 0x7feb8f3dbbaa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt5Core.so.5+0x283baa)
    #29 0x7feb8f3e73e6 in QCoreApplication::exec() (/usr/lib/libQt5Core.so.5+0x28f3e6)
    #30 0x55c34b37cade in main /home/waqar/kde/src/utilities/kate/kate/main.cpp:700
    #31 0x7feb8ec3eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
    #32 0x55c34b36df4d in _start (/home/waqar/kde/src/utilities/kate/build/bin/kate+0xe6f4d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/libQt5Core.so.5+0x2bb6a1) in operator<<(QDebug, QObject const*)
==494679==ABORTING
E[21:52:12.980] Transport error: Input/output error


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.90
Qt Version:
Comment 1 Waqar Ahmed 2022-01-30 17:02:26 UTC
Seems like it crashed while trying to print one of these warnings:

qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x6080002b8a20) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x608000365da0) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
Comment 2 Christoph Cullmann 2022-03-27 17:16:22 UTC
Perhaps the KWayland people can help us here.
Comment 3 guimarcalsilva 2022-05-25 15:30:08 UTC
(In reply to Waqar Ahmed from comment #1)
> Seems like it crashed while trying to print one of these warnings:
> 
> qt.qpa.wayland: setGrabPopup called with a parent,
> QtWaylandClient::QWaylandXdgSurface(0x6080002b8a20) which does not match the
> current topmost grabbing popup,
> QtWaylandClient::QWaylandXdgSurface(0x608000365da0) According to the
> xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently
> handling it by setting the parent to the topmost grabbing popup. Note,
> however, that this may cause positioning errors and popups closing
> unxpectedly because xdg-shell mandate that child popups close before parents

I hit a similar bug but in my case it doesn't crash anything.

While on Dolphin, I clicked on the hamburger menu and was navigating the submenus, suddenly, the menu disappeared, but the hamburger button still seemed like it was pressed. I kept moving the mouse and some submenus were still getting triggered. In the terminal, this message was repeated over and over:

qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x55a143bd5790) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x55a144b651f0) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents

I'm not sure it's a new bug or the same as this one, since it doesn't crash the session.

To trigger it, just keep navigating the hamburger menu on Dolphin until it suddenly disappears. I think it might be easier to trigger it with many submenus open in the "More" submenu.
Comment 4 guimarcalsilva 2022-05-25 15:36:09 UTC
I tested this in Kate and the menu also disappears sometimes just like in Dolphin, but I can't make it crash. It must be the same bug as this one.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.13.0-44-generic (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-9400F CPU @ 2.90GHz
Memory: 7,6 GiB of RAM
Graphics Processor: Radeon RX 570 Series
Comment 5 Akseli Lahtinen 2024-06-07 14:14:39 UTC
Can't reproduce this on Plasma 6, it should be fixed.