Bad pointer address causes weston crash
I've got an app that uses a webkitgtk based browser that runs on our LCD display. I can sometimes start up the app and all works well for hours with the app running and LCD behaving as expected. Other times, the browser and app quits - often within seconds or minutes of launching.
When weston gets killed, the display itself may be updating due to what's on the browser, but it's not being used otherwise.
I first thought I might be running out of memory, but I've got couple hundred megabytes free as far as I can tell. I did try to increase galcore continuous memory from 32M to 64M, but that didn't help.
I also used the weston log, with logging scopes log, proto, drm_backend but I didn't get any useful information from the crash.
With strace I think I've determined that it's the weston process that quits with a SIGSEGV signal.
From the snippet below, it looks like a memory access error at address 0x10 during a g2d_alloc call. Am I reading that right?
Can anyone suggest a way to debug further so that I can solve this problem?
Thanks!
Architecture arm64 with linux build from Yocto Kirkstone.
Snippet from weston.log to show version and kernel version
[19:37:52.551] weston 10.0.0
https://wayland.freedesktop.org
Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Build: lf-5.15.32-2.0.0
[19:37:52.551] Command line: /usr/bin/weston --debug -l log,proto,drm-backend --log=/run/user/0/weston.log --modules=systemd-n
otify.so
[19:37:52.551] OS: Linux, 5.15.32+g1ce8a2b83886, #1 SMP PREEMPT Tue Jun 7 02:34:46 UTC 2022, aarch64
[19:37:52.551] Flight recorder: enabled
[19:37:52.552] Using config file '/etc/xdg/weston/weston.ini'
[19:37:52.553] Output repaint window is 16 ms maximum.
[19:37:52.554] Loading module '/usr/lib/libweston-10/drm-backend.so'
[19:37:52.564] initializing drm backend
[19:37:52.564] Trying logind launcher...
[19:37:52.581] logind: session control granted
[19:37:52.597] using /dev/dri/card1
[19:37:52.597] DRM: supports atomic modesetting
[19:37:52.597] DRM: does not support GBM modifiers
[19:37:52.597] DRM: supports picture aspect ratio
[19:37:52.598] Loading module '/usr/lib/libweston-10/g2d-renderer.so'
[19:37:52.654] event0 - 30370000.snvs:snvs-powerkey: is tagged by udev as: Keyboard
[19:37:52.654] event0 - 30370000.snvs:snvs-powerkey: device is a keyboard
[19:37:52.664] event1 - fts_ts: is tagged by udev as: Touchscreen
[19:37:52.666] event1 - fts_ts: device is a touch device
[19:37:52.710] libinput: configuring device "30370000.snvs:snvs-powerkey".
[19:37:52.710] Touchscreen - fts_ts - /sys/devices/platform/soc@0/30800000.bus/30a40000.i2c/i2c-2/2-0038/input/input1/event1
[19:37:52.710] libinput: configuring device "fts_ts".
[19:37:52.710] input device event1 has no enabled output associated (none named), skipping calibration for now.
[19:37:52.710] DRM: head 'DSI-1' updated, connector 35 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[19:37:52.711] DRM: head 'DSI-1' found, connector 35 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[19:37:52.712] Registered plugin API 'weston_drm_output_api_v1' of size 24
[19:37:52.712] Color manager: no-op
[19:37:52.712] Module '/usr/lib/libgbm.so' already loaded
[19:37:52.712] Output 'DSI-1' using color profile: built-in default sRGB SDR profile
[19:37:52.716] Create File /run/user/0/use-g2d-renderer
[19:37:52.716] Output DSI-1 (crtc 33) video modes:
720x1280@60.0, preferred, current, 59.8 MHz
[19:37:52.716] associating input device event0 with output DSI-1 (none by udev)
[19:37:52.716] associating input device event1 with output DSI-1 (none by udev)
[19:37:52.717] Output 'DSI-1' enabled with head(s) DSI-1
[19:37:52.717] 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
[19:37:52.718] Loading module '/usr/lib/weston/desktop-shell.so'
[19:37:52.723] launching '/usr/libexec/weston-keyboard'
[19:37:52.725] Warning: support for deprecated wl_shell interface is enabled. Please migrate legacy clients to xdg-shell.
[19:37:52.727] Loading module '/usr/lib/weston/screen-share.so'
[19:37:52.729] Loading module '/usr/lib/weston/systemd-notify.so'
[19:37:52.730] info: add 1 socket(s) provided by systemd
[19:37:52.730] launching '/usr/libexec/weston-desktop-shell'
Snippet from strace:
write(4, "[atomic] drmModeAtomicCommit\n", 29) = 29
write(4, "[repaint] flushed pending_state "..., 47) = 47
epoll_pwait(5, [{events=EPOLLIN, data={u32=3678100672, u64=187650799262912}}], 32, -1, NULL, 8) = 1
recvmsg(43, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\25\0\0\0\1\0\24\0\33\0\0\0\0\0\0\0\0\0\0\0\25\0\0\0\10\0\f\0\1\0\0\0"..., iov_len=2580}, {iov_base="", iov_len=1516}], msg_iovlen=2, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = 132
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.641][proto]"..., 99) = 99
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.641][proto]"..., 92) = 92
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.641][proto]"..., 96) = 96
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.641][proto]"..., 95) = 95
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.642][proto]"..., 93) = 93
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.642][proto]"..., 110) = 110
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.642][proto]"..., 101) = 101
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(4, "[2023-08-11 18:05:02.642][proto]"..., 81) = 81
ioctl(17, _IOC(_IOC_NONE, 0x75, 0x30, 0), 0xfffffbf95078) = 0
ioctl(17, _IOC(_IOC_NONE, 0x75, 0x30, 0), 0xfffffbf95078) = 0
ioctl(17, _IOC(_IOC_NONE, 0x75, 0x30, 0), 0xfffffbf94cc8) = 0
ioctl(17, _IOC(_IOC_NONE, 0x75, 0x30, 0), 0xfffffbf94d38) = 0
ioctl(17, _IOC(_IOC_NONE, 0x75, 0x30, 0), 0xfffffbf95028) = 0
write(2, "g2d_alloc: alloc memory fail wit"..., 48) = 48
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x10} ---
+++ killed by SIGSEGV +++