meta-raspberrypi icon indicating copy to clipboard operation
meta-raspberrypi copied to clipboard

Weston crashes on mouse move

Open kronoidz opened this issue 11 months ago • 9 comments

Error

Weston starts, but then crashes as soon as moving the mouse with the following output:

root@raspberrypi5:~# XDG_RUNTIME_DIR=/run/user/1000/ weston --backend=drm
Date: 2018-03-09 UTC
[12:46:37.147] weston 14.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 14.0.1
[12:46:37.147] Command line: weston --backend=drm
[12:46:37.147] OS: Linux, 6.6.63-v8-16k, #1 SMP PREEMPT Fri Dec  6 10:10:05 UTC 2024, aarch64
[12:46:37.147] Flight recorder: enabled
[12:46:37.147] warning: XDG_RUNTIME_DIR "/run/user/1000/" is not configured
correctly.  Unix access mode must be 0700 (current mode is 0700),
and must be owned by the user UID 0 (current owner is UID 1000).
Refer to your distribution on how to get it, or
http://www.freedesktop.org/wiki/Specifications/basedir-spec
on how to implement it.
[12:46:37.147] Using config file '/etc/xdg/weston/weston.ini'
[12:46:37.147] Output repaint window is 7 ms maximum.
[12:46:37.147] WARNING: Weston was started from /dev/ttyAMA10. Messages will be dropped if not written to a file.
               Use --log for capturing Weston logs to a file.
[12:46:37.147] Loading module '/usr/lib/libweston-14/drm-backend.so'
[12:46:37.148] initializing drm backend
[12:46:37.148] Trying libseat launcher...
00:02:25.771  [c/debug/seatd/0.9.1/seatd/server.c:145] New client connected (pid: 568, uid: 0, gid: 0)
00:02:25.771  [c/debug/seatd/0.9.1/seatd/seat.c:239] Added client 1 to seat0
00:02:25.772  [c/debug/seatd/0.9.1/seatd/seat.c:563] Opened client 1 on seat0
[12:46:37.148] [c/debug/seatd/0.9.1/libseat/libseat.c:73] Seat opened with backend 'seatd'
[12:46:37.148] [c/debug/seatd/0.9.1/libseat/backend/seatd.c:212] Enabling seat
[12:46:37.148] libseat: session control granted
[12:46:37.149] using /dev/dri/card0
[12:46:37.149] DRM: supports atomic modesetting
[12:46:37.149] DRM: supports GBM modifiers
[12:46:37.149] DRM: does not support Atomic async page flip
[12:46:37.149] DRM: supports picture aspect ratio
[12:46:37.160] Loading module '/usr/lib/libweston-14/gl-renderer.so'
[12:46:37.163] Using rendering device: /dev/dri/renderD128
[12:46:37.163] EGL version: 1.4
[12:46:37.163] EGL vendor: Mesa Project
[12:46:37.163] EGL client APIs: OpenGL OpenGL_ES 
[12:46:37.164] EGL features:
               EGL Wayland extension: yes
               context priority: no
               buffer age: yes
               partial update: no
               swap buffers with damage: no
               configless context: yes
               surfaceless context: yes
               dmabuf support: modifiers
[12:46:37.164] GL version: OpenGL ES 3.1 Mesa 24.0.7
[12:46:37.164] GLSL version: OpenGL ES GLSL ES 3.10
[12:46:37.164] GL vendor: Broadcom
[12:46:37.164] GL renderer: V3D 7.1.7
[12:46:37.164] warning: Disabling render GPU timeline due to missing GL_EXT_disjoint_timer_query extension
[12:46:37.169] GL ES 3.1 - renderer features:
               read-back format: ARGB8888
               glReadPixels supports y-flip: yes
               glReadPixels supports PBO: yes
               wl_shm 10 bpc formats: yes
               wl_shm 16 bpc formats: no
               wl_shm half-float formats: no
               internal R and RG formats: yes
               OES_EGL_image_external: yes
[12:46:37.170] Using GL renderer
[12:46:37.174] event4  - SIGMACHIP Trust Keyboard: is tagged by udev as: Keyboard
[12:46:37.174] event4  - SIGMACHIP Trust Keyboard: device is a keyboard
[12:46:37.175] event6  - SIGMACHIP Trust Keyboard Consumer Control: is tagged by udev as: Keyboard
[12:46:37.175] event6  - SIGMACHIP Trust Keyboard Consumer Control: device is a keyboard
[12:46:37.175] event7  - SIGMACHIP Trust Keyboard System Control: is tagged by udev as: Keyboard
[12:46:37.175] event7  - SIGMACHIP Trust Keyboard System Control: device is a keyboard
[12:46:37.176] event5  - PixArt USB Optical Mouse: is tagged by udev as: Mouse
[12:46:37.176] event5  - PixArt USB Optical Mouse: device set to 1000 DPI
[12:46:37.176] event5  - PixArt USB Optical Mouse: device is a pointer
[12:46:37.176] event8  - pwr_button: is tagged by udev as: Keyboard
[12:46:37.176] event8  - pwr_button: device is a keyboard
[12:46:37.176] event0  - vc4-hdmi-0: is tagged by udev as: Keyboard Pointingstick
[12:46:37.176] event0  - vc4-hdmi-0: device is a pointer
[12:46:37.176] event0  - vc4-hdmi-0: device is a keyboard
[12:46:37.177] event1  - vc4-hdmi-0 HDMI Jack: is tagged by udev as: Switch
[12:46:37.215] event1  - not using input device '/dev/input/event1'
[12:46:37.215] event2  - vc4-hdmi-1: is tagged by udev as: Keyboard Pointingstick
[12:46:37.215] event2  - vc4-hdmi-1: device is a pointer
[12:46:37.215] event2  - vc4-hdmi-1: device is a keyboard
[12:46:37.216] event3  - vc4-hdmi-1 HDMI Jack: is tagged by udev as: Switch
[12:46:37.247] event3  - not using input device '/dev/input/event3'
[12:46:37.253] libinput: configuring device "SIGMACHIP Trust Keyboard".
[12:46:37.253] libinput: configuring device "SIGMACHIP Trust Keyboard Consumer Control".
[12:46:37.253] libinput: configuring device "SIGMACHIP Trust Keyboard System Control".
[12:46:37.253] libinput: configuring device "PixArt USB Optical Mouse".
[12:46:37.253] libinput: configuring device "pwr_button".
[12:46:37.253] libinput: configuring device "vc4-hdmi-0".
[12:46:37.253] libinput: configuring device "vc4-hdmi-1".
[12:46:37.304] DRM: EDID for the following head fails conformity:
Block 0, Base EDID:
  Digital Video Interface Standard set to reserved value 0xa2.

Block 1, CTA-861 Extension Block:
  Video Capability Data Block: IT video formats are always overscanned, but bit 7 of Byte 3 of the CTA-861 Extension header is set to underscanned.

[12:46:37.304] DRM: head 'HDMI-A-1' found, connector 32 is connected, EDID make 'Invalid Vendor Codename - RTK', model 'A05-P156AT1', serial 'demoset-1'
               Supported EOTF modes: SDR, ST2084
               Supported colorimetry modes: default, BT.2020 (YCC), BT.2020 (RGB)
[12:46:37.306] DRM: head 'HDMI-A-2' found, connector 42 is disconnected.
[12:46:37.306] Registered plugin API 'weston_drm_output_api_v1' of size 40
[12:46:37.306] Color manager: no-op
                 protocol support: no
[12:46:37.306] Output 'HDMI-A-1' attempts EOTF mode SDR and colorimetry mode default.
[12:46:37.306] Output 'HDMI-A-1' using color profile: stock sRGB color profile
[12:46:37.307] Chosen EGL config details: id:  25 rgba: 8 8 8 0 buf: 24 dep:  0 stcl: 0 int: 1-1 type: win vis_id: XRGB8888 (0x34325258)
[12:46:37.307] Output HDMI-A-1 (crtc 93) video modes:
               [email protected], preferred, current, 148.5 MHz
               [email protected] 16:9, 148.5 MHz
               [email protected] 16:9, 148.4 MHz
               [email protected] 16:9, 148.5 MHz
               [email protected], 123.8 MHz
               [email protected], 74.2 MHz
               [email protected] 16:9, 74.2 MHz
               [email protected], 108.0 MHz
               [email protected], 85.0 MHz
               [email protected], 74.2 MHz
               [email protected] 16:9, 74.2 MHz
               [email protected] 16:9, 74.2 MHz
               [email protected] 16:9, 74.2 MHz
               [email protected] 16:9, 74.2 MHz
               [email protected], 65.0 MHz
               [email protected] 16:9, 54.1 MHz
               [email protected] 16:9, 54.0 MHz
               [email protected], 40.0 MHz
               [email protected] 16:9, 27.0 MHz
               [email protected] 16:9, 27.0 MHz
               [email protected] 4:3, 25.2 MHz
               [email protected], 25.2 MHz
[12:46:37.307] associating input device event4 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event6 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event7 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event5 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event8 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event0 with output HDMI-A-1 (none by udev)
[12:46:37.307] associating input device event2 with output HDMI-A-1 (none by udev)
[12:46:37.307] Output 'HDMI-A-1' enabled with head(s) HDMI-A-1
[12:46:37.307] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
               cursor planes: yes
               arbitrary resolutions: no
               view mask clipping: yes
               explicit sync: yes
               color operations: no
               presentation clock: CLOCK_MONOTONIC, id 1
               presentation clock resolution: 0.000000001 s
[12:46:37.307] Loading module '/usr/lib/weston/desktop-shell.so'
[12:46:37.307] Loading module '/usr/lib/libweston-14/xwayland.so'
[12:46:37.315] Registered plugin API 'weston_xwayland_v3' of size 32
[12:46:37.315] Registered plugin API 'weston_xwayland_surface_v2' of size 24
[12:46:37.315] unlinking stale lock file /tmp/.X0-lock
[12:46:37.315] xserver listening on display :0
[12:46:37.315] launching '/usr/libexec/weston-keyboard'
[12:46:37.316] launching '/usr/libexec/weston-desktop-shell'
could not load cursor 'dnd-move'
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
could not load cursor 'dnd-none'
weston: /usr/src/debug/weston/14.0.1/libweston/backend-drm/state-propose.c:533: drm_output_find_plane_for_view: Assertion `fb' failed.
00:02:27.997  [c/debug/seatd/0.9.1/seatd/client.c:496] Client disconnected
Aborted
root@raspberrypi5:~# 00:02:28.269  [c/debug/seatd/0.9.1/seatd/seat.c:158] No clients on seat0 to activate
00:02:28.320  [c/debug/seatd/0.9.1/seatd/seat.c:290] Removed client 1 from seat0

Relevant part of the error:

weston: /usr/src/debug/weston/14.0.1/libweston/backend-drm/state-propose.c:533: drm_output_find_plane_for_view: Assertion `fb' failed.

Steps to reproduce

  • clone meta-raspberrypi -- current HEAD at the time of writing: 880d36b7c2be9cf7fa7cb287d8eefe3a27d7ede9;
  • clone poky -- current HEAD: 59db27de565fb33f9e4326e76ebd6fa3935557b9;
  • run source poky/oe-init-build-env rpi-build;
  • add meta-raspberrypi to bblayers.conf;
  • set MACHINE=raspberrypi5 and LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch" in local.conf;
  • build image: bitbake core-image-weston;
  • flash uSD and boot Raspberry Pi 5 with mouse and keyboard connected;
  • run XDG_RUNTIME_DIR=/run/user/1000/ weston;
  • weston starts;
  • move mouse;
  • error.

Also tested on branch scarthgap, and no error occurs (meta-raspberry: 6df7e028a2b7b2d8cab0745dc0ed2eebc3742a17, poky: 2240b92d62618d6125bd825647392d3bb5a2d038).

kronoidz avatar Jan 27 '25 09:01 kronoidz

The issue appears to be specific to kernel version 6.6.63.

It's introduced by: https://github.com/agherzan/meta-raspberrypi/pull/1392, https://github.com/agherzan/meta-raspberrypi/pull/1400.

kronoidz avatar Jan 28 '25 17:01 kronoidz

Problem is caused by this line: /usr/src/debug/weston/14.0.1/libweston/backend-drm/state-propose.c:533 There is assert(fb) which cause crash. Just remove it and it should work. Weston main branch has already change this code but there is no release version yet.

janeczkos avatar Feb 03 '25 16:02 janeczkos

Problem is caused by this line: /usr/src/debug/weston/14.0.1/libweston/backend-drm/state-propose.c:533 There is assert(fb) which cause crash. Just remove it and it should work. Weston main branch has already change this code but there is no release version yet.

thanks @janeczkos can you point to the particular fix ? I think it would be better to backport it into OE weston recipe for the time we do not have a release.

kraj avatar Feb 03 '25 17:02 kraj

This is commit which removes this assert gitlab_weston_fix.

janeczkos avatar Feb 03 '25 17:02 janeczkos

Problem is caused by this line: /usr/src/debug/weston/14.0.1/libweston/backend-drm/state-propose.c:533 There is assert(fb) which cause crash. Just remove it and it should work. Weston main branch has already change this code but there is no release version yet.

Hello, I try remove the assert(fb) and now it doesn't crash. BUT on cm5, the color is wrong, like if the configuration of framebuffer was not good... On PI5, it works...

sefram avatar Feb 26 '25 17:02 sefram

I got the same issue with latest scarthgap branch on CM5. weston 14.0.2 has been releases to fixed this crash.

lonhtm avatar Jun 13 '25 10:06 lonhtm

14.0.2 does not solve the assert for me. I use scarthgap as base, and up'ing weston to 14.0.2. Removing the assert seems to work.

d99roric avatar Oct 05 '25 16:10 d99roric

@d99roric can you try couple of things

  1. Use 6.6.78 kernel, its proposed for master here - https://github.com/agherzan/meta-raspberrypi/pull/1547
  2. Try using 6.12 kernel and see if issue happens with 6.12 as well.

kraj avatar Nov 20 '25 20:11 kraj

It looks like the culprit is this commit. They changed some 32-bit ints to 64-bit ones, and weston seems to be unhappy about it. It can be reverted at least in 6.6 cleanly - it's an rpi-specific change, not upstreamed. Currently trying to figure out if it would be easier to patch weston.

OldManYellsAtCloud avatar Nov 21 '25 18:11 OldManYellsAtCloud