Re: Compositor crashes when switching tty

2019-05-29 Thread adlo
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  wrote:
> > On 29 May 2019, at 03:53, Matteo Valdina 
> > 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 

Re: Compositor crashes when switching tty

2019-05-29 Thread Matteo Valdina
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  wrote:

> On 29 May 2019, at 03:53, Matteo Valdina  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.
>
> What else might I need to do?
>
> Is this code enough to open a basic display on the DRM backend?
>
>
> https://github.com/adlocode/xfway/blob/9a676ddd9eecc7f8e23915d5c79f57c6368d6fc7/src/main-wayland.c#L276
>
> Regards
>
> adlo
>
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Re: Compositor crashes when switching tty

2019-05-29 Thread adlo
> On 29 May 2019, at 03:53, Matteo Valdina  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.

What else might I need to do?

Is this code enough to open a basic display on the DRM backend?

https://github.com/adlocode/xfway/blob/9a676ddd9eecc7f8e23915d5c79f57c6368d6fc7/src/main-wayland.c#L276

Regards

adlo___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel