Bug 481791

Summary: QT6 applications on wayland crash with "wl_pointer" has no event 10
Product: [KDE Neon] neon Reporter: Ash <ashleysommer>
Component: Packages User EditionAssignee: Neon Bugs <neon-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bruno, jr, kde, neon-bugs, sitter, techxgames, xaver.hugl
Priority: NOR Keywords: qt6
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Output with WL_DEBUG=1

Description Ash 2024-02-24 23:56:58 UTC
SUMMARY
Using Plasma 6 that recently landed on KDE Neon "Release" distribution channel.

KWin version = 4:6.0.0-0xneon+22.04+jammy+release+build65
QT6 version = 6.6.2-0xneon+22.04+jammy+release+build75
Libinput version = 1.20.0-1ubuntu0.3

Using a logitech MX Ergo mouse with the logitech unifying receiver, and the hid_logitech_hidpp kernel driver. The driver emits "high resolution scroll" events when the scroll wheel is used.

"wl_pointer" is a Wayland protocol interface. Event 10 is the "high resolution" scroll event (aka Axis 120 event)

 

STEPS TO REPRODUCE
1. Install QT6 from Neon "release" channel (based on Ubuntu 22.04)
2. Install Plasma6 from Neon "release" channel (based on Ubuntu 22.04)
3. Launch into a Plasma Wayland Session
4. Open any QT6 application (eg, konsole v24.02, or dolphin v24.02)
5. Scroll the wheel on any logitech HID++ mouse

OBSERVED RESULT
QT6 application crashes, 
Error printed to console:
-------
interface 'wl_pointer' has no event 10
The Wayland connection experienced a fatal error: Bad address
-------

EXPECTED RESULT
Applications should not crash when receiving a high resolution scroll event.

SOFTWARE/OS VERSIONS
Linux: 6.5.0-21
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2


DISCUSSION:

This occurs only on QT6 applications. GTK3 and GTK4 apps work fine, and QT5 applications work fine.

This occurs only in Plasma6 Wayland session. Plasma6 X11 is fine, and Gnome 45 Wayland session is fine.

I suspect there is a wayland protocol mismatch between the Wayland server (kwin-wayland) and the wayland client (Qt6). Perhaps the version of QT6.6.2 in Neon "release" channel is compiled against an older libwayland-client, not sure.
This shouldn't be an issue though, because kwin _does_ check the client protocol version before sending the event:
https://github.com/KDE/kwin/blob/8029c5c7acd004bd26fd539d3948c1ecf758abab/src/wayland/pointer.cpp#L280

I have even attempted to work around this issue by filtering high-resolution scroll events in libinput using the quirks line:
AttrEventCodeDisable=REL_WHEEL_HI_RES;REL_HWHEEL_HI_RES;

I have confirmed using libinput tools this event is now disabled, but Plasma Kwin-wayland still receives high resolution scroll events and sends them to the wayland client. So either kwin is bypassing libpinput and receiving libev kernel events, or using its own libinput config without the event codes disabled? That is the extent of my digging on that.
Comment 1 Ash 2024-02-24 23:59:31 UTC
Note, I suspect this is a neon build/packaging error, or a QT6 bug. But I posted here because to see if anyone can help me debug exactly where the issue is coming from. I haven't tried with QT6 v6.7.0 yet, only using the v6.6.2 release from neon "release" channel.
Comment 2 Ash 2024-02-25 00:18:37 UTC
This article shows the high-resolution scroll event support was added in Wayland 1.21:
https://www.phoronix.com/news/Wayland-1.21-Released

libwayand-client0 libwayland-server0 on my installation are both on 1.22.0-0xneon+22.04+jammy+release+build21

qt6-wayland is on 6.6.2-0xneon+22.04+jammy+release+build18 
I've confirmed libqt6waylandclient is dynamically linked to libwayand-client0 v1.22.0-0

Support for high-resolution scroll was added to QT6 during the v6.5 development phase back in 2022, so its been in there a while:
https://github.com/qt/qtwayland/commit/f1e71327d462d2dae0b46677bbc478afb0d1b2f7
Comment 3 Zamundaaa 2024-02-25 01:40:13 UTC
Please run a Qt6 app with WAYLAND_DEBUG=1 set and attach the output here
Comment 4 Ash 2024-02-25 02:22:04 UTC
Created attachment 166078 [details]
Output with WL_DEBUG=1

Added attachment, running Konsole v24.02.0 with WL_DEBUG=1
Log records the application opening, I move the mouse around the Konsole window for about 1 second, then I scroll the scrollwheel wheel down, the application immediately crashes.
Comment 5 Ash 2024-02-25 02:24:31 UTC
(In reply to Ash from comment #4)
> Created attachment 166078 [details]
> Output with WL_DEBUG=1
> 
> Added attachment, running Konsole v24.02.0 with WL_DEBUG=1
> Log records the application opening, I move the mouse around the Konsole
> window for about 1 second, then I scroll the scrollwheel wheel down, the
> application immediately crashes.

Typo in previous comment, I ran with WAYLAND_DEBUG=1, not WL_DEBUG. Correct debug variable can be seen in the log file.
Comment 6 Ash 2024-02-26 22:17:02 UTC
This seems to be resolved now.

Yesterday I updated some packages to newer releases on the neon "release" channel.
These included:
* kf6-kguiaddons=6.0.0-0xneon+22.04+jammy+release+build4
* kf6-purpose=6.0.0-0xneon+22.04+jammy+release+build9
* kwin-common=4:6.0.0-0xneon+22.04+jammy+release+build66
* kwin-data=4:6.0.0-0xneon+22.04+jammy+release+build66
* kwin-wayland=4:6.0.0-0xneon+22.04+jammy+release+build66
* libkwineffects14=4:6.0.0-0xneon+22.04+jammy+release+build66
* libkwinglutils=4:6.0.0-0xneon+22.04+jammy+release+build66

After that, general QT6 applications like Konsole and Dolphin were _no longer_ crashing on scroll inputs. But KDE Plasma components (panels, panel widgets, app launcher, networks popup) were all still crashing on scroll input.

Then early this morning I just updated some more new package releases that appeared on the neon "release" channel.
This included:
* libplasma6=6.0.0-0xneon+22.04+jammy+release+build8
* kf6-plasma-framework=6.0.0-0xneon+22.04+jammy+release+build8
* plasma-framework6=6.0.0-0xneon+22.04+jammy+release+build8

Now I no longer see any crash on scroll input in KDE Plasma components.

So I suppose this has resolved itself, this can be closed.
Comment 7 Daniel Bull 2024-02-29 16:21:46 UTC
It looks like I have a problem which may be closely related if not the same...

Running fully patched KDE Neon "Release".
Recently upgraded to Plasma 6 Wayland on 2 different machines.
Both show this same issue, one using a Logitech MX Master 3 one a Logitech G502.
One running Solaar (Logitech receiver manager) one not.

PROBLEM:
File open dialog box vanishes (crashes) when scrolling for files with error "interface 'wl_pointer' has no event 10"

STEPS TO REPRODUCE
1. Open Google Chrome
2. Go to any website with an file upload box <input type="file">
3. Click in the box or click to choose file (or however its implemented) to launch the open file dialog
4. Scroll in dialog

OBSERVED RESULT
File open dialog disappears and /var/log/syslog records "interface 'wl_pointer' has no event 10"

EXPECTED RESULT:
File open dialog scrolls

SOFTWARE/OS VERSIONS
Kernel Version: 6.5.0-21
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Graphics Platform: Wayland
kwin-wayland = 4:6.0.0-0xneon+22.04+jammy+release+build67
qt6-base = 6.6.2-0xneon+22.04+jammy+release+build88
libinput-bin =  1.20.0-1ubuntu0.3

ADDITIONAL INFORMATION:
Relevant /var/log/syslog in full....

xdg-desktop-portal-kde[47975]: interface 'wl_pointer' has no event 10
xdg-desktop-portal-kde[47975]: The Wayland connection experienced a fatal error: Resource temporarily unavailable
xdg-desktop-por[3023]: Backend call failed: Message recipient disconnected from message bus without replying
systemd[2739]: plasma-xdg-desktop-portal-kde.service: Main process exited, code=exited, status=255/EXCEPTION
xdg-desktop-portal-kde[48076]: warning: queue 0x55ffb535b270 destroyed while proxies still attached:
xdg-desktop-portal-kde[48076]:   zwp_linux_dmabuf_v1@46 still attached
systemd[2739]: plasma-xdg-desktop-portal-kde.service: Failed with result 'exit-code'.
systemd[2739]: plasma-xdg-desktop-portal-kde.service: Consumed 1.097s CPU time.
Comment 8 bruno 2024-03-01 12:35:26 UTC
related to https://bugs.kde.org/show_bug.cgi?id=481972
can reproduce
Comment 9 Ash 2024-03-03 22:34:00 UTC
Yep, I can confirm I was still having this error in xdg-desktop-portal-kde windows (file open, in firefox and chrome) even after my last comment.
Also since https://bugs.kde.org/show_bug.cgi?id=481972 is now fixed, this issue is now resolved.
Comment 10 Daniel Bull 2024-03-04 08:57:07 UTC
I can confirm resolved on both my machines as well..