Compositor crashes when switching tty

adlo adloconwy at gmail.com
Wed May 29 23:50:32 UTC 2019


On Wed, 2019-05-29 at 08:19 -0500, Matteo Valdina wrote:
> Re-iterate the process.Run valgrind, read the log, search for bugs. 
> Until valgrind run smoothly. 
> 
> Best
> 
> On Wed, May 29, 2019, 02:32 adlo <adloconwy at gmail.com> wrote:
> > On 29 May 2019, at 03:53, Matteo Valdina <matteo.valdina at gmail.com>
> > wrote:
> > 
> > > As valgrind pointing out at shell.c line 982
> > > 
> > > 
> > >       
> > >       
> > >         shell = zalloc (sizeof (shell));
> > > 
> > > Here you are allocating the pointer size not the structure size.
> > > You probably want type Shell.
> > > 
> > 
> > This reduces the amount of crashing, but does not completely
> > eliminate it. My compositor still coredumps when switching vt
> > multiple times, especially when also opening and closing windows on
> > my compositor.
> > 

Here is the valgrind output:

==13998== Memcheck, a memory error detector
==13998== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et
al.
==13998== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright
info
==13998== Command: src/xfway
==13998== Parent PID: 11262
==13998== 
==13998== Warning: noted but unhandled ioctl 0x6458 with no
size/direction hints.
==13998==    This could cause spurious value errors to appear.
==13998==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on
writing a proper wrapper.
==13998== Invalid write of size 8
==13998==    at 0x4884ADB: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A2585: weston_view_set_output (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A41AD: weston_view_unmap (in /usr/lib64/libweston-
6.so.0.0.0)
==13998==    by 0x48A5587: weston_view_destroy (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A5664: weston_surface_destroy (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4884A7F: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4884FC3: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880AA1: wl_client_destroy (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880EDD: wl_display_flush_clients (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F17: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x9fcda10 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid read of size 8
==13998==    at 0x4884AB4: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x485F6AF: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E61C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E77B: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x4863A45: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x636D6BC: dbus_connection_dispatch (in
/usr/lib64/libdbus-1.so.3.19.10)
==13998==    by 0x486291B: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x48823E8: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x9fcda10 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ABF: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x485F6AF: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E61C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E77B: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x4863A45: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x636D6BC: dbus_connection_dispatch (in
/usr/lib64/libdbus-1.so.3.19.10)
==13998==    by 0x486291B: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x48823E8: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x9fcda10 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ADB: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x485F896: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E487: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E654: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485423C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x486398D: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x636D6BC: dbus_connection_dispatch (in
/usr/lib64/libdbus-1.so.3.19.10)
==13998==    by 0x486291B: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x48823E8: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x9fcda10 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ADF: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A2585: weston_view_set_output (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A26B1: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A3E5C: weston_view_update_transform (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A53AF: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A9459: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x9fcda08 is 24 bytes inside a block of size 92
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x6BD239B: drmModeAtomicCommit (in
/usr/lib64/libdrm.so.2.4.0)
==13998==    by 0x4857392: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485A26C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x48A97B3: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x6BD22C4: drmModeAtomicCommit (in
/usr/lib64/libdrm.so.2.4.0)
==13998==    by 0x4857392: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485A26C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x48A97B3: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ADB: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A2585: weston_view_set_output (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A26B1: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A3E5C: weston_view_update_transform (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A53AF: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A9459: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x8db37f0 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid read of size 8
==13998==    at 0x4884AB4: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A26B1: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A3E5C: weston_view_update_transform (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A53AF: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A9459: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x8db37f0 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ABF: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A26B1: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A3E5C: weston_view_update_transform (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A53AF: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A9459: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4881C8C: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Address 0x8db37f0 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ADB: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A2585: weston_view_set_output (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A41AD: weston_view_unmap (in /usr/lib64/libweston-
6.so.0.0.0)
==13998==    by 0x48A42E7: weston_surface_unmap (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48AA7E7: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48AF8F9: weston_seat_release_pointer (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x485F8C7: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E487: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485E654: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x485423C: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x486398D: ??? (in /usr/lib64/libweston-6/drm-
backend.so)
==13998==    by 0x636D6BC: dbus_connection_dispatch (in
/usr/lib64/libdbus-1.so.3.19.10)
==13998==  Address 0x8db37f0 is 96 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ADF: wl_list_remove (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x48A2585: weston_view_set_output (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A41AD: weston_view_unmap (in /usr/lib64/libweston-
6.so.0.0.0)
==13998==    by 0x48A5587: weston_view_destroy (in
/usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x4045DE: surface_removed (shell.c:303)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D7C65: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4884A7F: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4884FC3: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880AA1: wl_client_destroy (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==  Address 0x8db37e8 is 88 bytes inside a block of size 120
free'd
==13998==    at 0x4839A0C: free (vg_replace_malloc.c:540)
==13998==    by 0x48DD073: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D8E53: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x4880927: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880993: wl_resource_destroy (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998==  Block was alloc'd at
==13998==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
==13998==    by 0x40447E: surface_added (shell.c:255)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCDCE: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==    by 0x4880F24: wl_display_run (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x403A57: main (main-wayland.c:625)
==13998== 
==13998== Invalid read of size 8
==13998==    at 0x4884AB4: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4044B8: surface_added (shell.c:262)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D97D0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48A476D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A508D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==  Address 0x8db37f0 is 32 bytes before a block of size 48 in
arena "client"
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884ABF: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4044B8: surface_added (shell.c:262)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D97D0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48A476D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A508D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==  Address 0x8db37f0 is 32 bytes before a block of size 48 in
arena "client"
==13998== 
==13998== Invalid write of size 8
==13998==    at 0x4884AC7: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4044B8: surface_added (shell.c:262)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D97D0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48A476D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A508D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==  Address 0x70 is not stack'd, malloc'd or (recently) free'd
==13998== 
==13998== 
==13998== Process terminating with default action of signal 11
(SIGSEGV)
==13998==  Access not within mapped region at address 0x70
==13998==    at 0x4884AC7: wl_list_insert (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4044B8: surface_added (shell.c:262)
==13998==    by 0x48D81EB: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48DCBF0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48D97D0: ??? (in /usr/lib64/libweston-desktop-
6.so.0.0.0)
==13998==    by 0x48A476D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x48A508D: ??? (in /usr/lib64/libweston-6.so.0.0.0)
==13998==    by 0x5984B27: ffi_call_unix64 (in
/usr/lib64/libffi.so.6.0.2)
==13998==    by 0x5984338: ffi_call (in /usr/lib64/libffi.so.6.0.2)
==13998==    by 0x48841B6: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4880D31: ??? (in /usr/lib64/libwayland-
server.so.0.1.0)
==13998==    by 0x4882369: wl_event_loop_dispatch (in
/usr/lib64/libwayland-server.so.0.1.0)
==13998==  If you believe this happened as a result of a stack
==13998==  overflow in your program's main thread (unlikely but
==13998==  possible), you can try to increase the size of the
==13998==  main thread stack using the --main-stacksize= flag.
==13998==  The main thread stack size used in this run was 8388608.
==13998== 
==13998== HEAP SUMMARY:
==13998==     in use at exit: 2,042,884 bytes in 7,593 blocks
==13998==   total heap usage: 436,459 allocs, 428,866 frees,
142,293,940 bytes allocated
==13998== 
==13998== LEAK SUMMARY:
==13998==    definitely lost: 1,600 bytes in 99 blocks
==13998==    indirectly lost: 571 bytes in 9 blocks
==13998==      possibly lost: 1,450,240 bytes in 4,867 blocks
==13998==    still reachable: 590,473 bytes in 2,618 blocks
==13998==                       of which reachable via heuristic:
==13998==                         newarray           : 42,088 bytes in
153 blocks
==13998==         suppressed: 0 bytes in 0 blocks
==13998== Rerun with --leak-check=full to see details of leaked memory
==13998== 
==13998== For lists of detected and suppressed errors, rerun with: -s
==13998== ERROR SUMMARY: 178 errors from 13 contexts (suppressed: 0
from 0)

It seems to mention shell.c line 262 which is:

shell_surface_set_output (self, get_default_output (self->server-
>compositor));

shell_surface_set_output is this:

static void
shell_surface_set_output(CWindowWayland *cw,
                         struct weston_output *output)
{
	struct weston_surface *es =
		weston_desktop_surface_get_surface(cw-
>desktop_surface);

	/* get the default output, if the client set it as NULL
	   check whether the output is available */
	if (output)
		cw->output = output;
	else if (es->output)
		cw->output = es->output;
	else
		cw->output = get_default_output(es->compositor);

	if (cw->output_destroy_listener.notify) {
		wl_list_remove(&cw->output_destroy_listener.link);
		cw->output_destroy_listener.notify = NULL;
	}

	if (!cw->output)
		return;

	cw->output_destroy_listener.notify = notify_output_destroy;
	wl_signal_add(&cw->output->destroy_signal,
		      &cw->output_destroy_listener);
}

It mentions a call to wl_list_insert. Maybe it refers to the call to
wl_signal_add? What could need fixing there?

Also, there are lots of "Invalid writes of size 8", but a lot of them
don't seem to originate from functions in my program, but from the
Wayland libraries themselves. What is going on there?

Regards

adlo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20190530/5e33b8c5/attachment-0001.html>


More information about the wayland-devel mailing list