1. 04 Nov, 2020 1 commit
    • Marius Vlad's avatar
      kiosk-shell: Keep track of seats created and destroy them at end · 092130c4
      Marius Vlad authored
      kiosk_shell_destroy() will free up weston_desktop, but still keeping
      listeners set-up (keyboard/seat/caps), which will fire
      when the the compositor is stopped/shutdown by clients still connected.
      
      This patch maintains a list of seats and uses it to remove any listeners
      when calling kiosk_shell_destroy(). desktop-shell and ivi-shell do not
      appear to be using weston_desktop_destroy() in their respective destroy
      parts.
      
      This avoids an illegal access happening when calling one of the
      listeners, after weston_desktop has been free'ed, like the following:
      
      ==2002==    at 0x10F3F8FD: weston_desktop_get_display (libweston-desktop.c:125)
      ==2002==    by 0x10F450A7: weston_desktop_xdg_surface_schedule_configure (xdg-shell.c:1022)
      ==2002==    by 0x10F44793: weston_desktop_xdg_toplevel_set_activated (xdg-shell.c:643)
      ==2002==    by 0x10F41AA5: weston_desktop_surface_set_activated (surface.c:468)
      ==2002==    by 0x10F32E7E: kiosk_shell_seat_handle_keyboard_focus (kiosk-shell.c:329)
      ==2002==    by 0x4A726A7: wl_signal_emit (wayland-server-core.h:478)
      ==2002==    by 0x4A75BD1: weston_keyboard_set_focus (input.c:1586)
      ==2002==    by 0x4A776FE: notify_keyboard_focus_out (input.c:2314)
      ==2002==    by 0x5902BC1: udev_seat_destroy (libinput-seat.c:469)
      ==2002==    by 0x59028C5: udev_input_destroy (libinput-seat.c:375)
      ==2002==    by 0x58F0449: drm_destroy (drm.c:2571)
      ==2002==    by 0x4A6EE39: weston_compositor_destroy (compositor.c:7814)
      ==2002==  Address 0x10bd1780 is 0 bytes inside a block of size 152 free'd
      ==2002==    at 0x48399AB: free (vg_replace_malloc.c:538)
      ==2002==    by 0x10F3F8DA: weston_desktop_destroy (libweston-desktop.c:112)
      ==2002==    by 0x10F34357: kiosk_shell_destroy (kiosk-shell.c:1009)
      ==2002==    by 0x4A5F618: wl_signal_emit (wayland-server-core.h:478)
      ==2002==    by 0x4A6EE06: weston_compositor_destroy (compositor.c:7809)
      ==2002==    by 0x4855548: wet_main (main.c:3420)
      ==2002==    by 0x109154: main (executable.c:33)
      ==2002==  Block was alloc'd at
      ==2002==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
      ==2002==    by 0x10F3F681: zalloc (zalloc.h:38)
      ==2002==    by 0x10F3F724: weston_desktop_create (libweston-desktop.c:65)
      ==2002==    by 0x10F34458: wet_shell_init (kiosk-shell.c:1045)
      ==2002==    by 0x484F83D: wet_load_shell (main.c:924)
      ==2002==    by 0x48552D3: wet_main (main.c:3361)
      ==2002==    by 0x109154: main (executable.c:33)
      Signed-off-by: Marius Vlad's avatarMarius Vlad <marius.vlad@collabora.com>
      092130c4
  2. 27 Oct, 2020 9 commits
  3. 26 Oct, 2020 2 commits
  4. 21 Oct, 2020 2 commits
  5. 19 Oct, 2020 2 commits
  6. 16 Oct, 2020 3 commits
  7. 01 Oct, 2020 1 commit
  8. 30 Sep, 2020 2 commits
  9. 16 Sep, 2020 11 commits
  10. 15 Sep, 2020 1 commit
    • Manuel Stoeckl's avatar
      compositor: avoid setting WAYLAND_DISPLAY=wayland-0 · ae69381b
      Manuel Stoeckl authored
      This commit alters the way that Weston picks a Wayland display socket
      name. Instead of using wl_display_add_socket_auto to look for the first
      available name in wayland-0, wayland-1, .... to wayland-32, the code now
      checks names wayland-1, wayland-2, .... up to wayland-32.
      
      This change is a workaround for a suboptimal behavior of
      libwayland-client. If a client program calls wl_display_connect(NULL) and
      the WAYLAND_DISPLAY environment variable is not set, then the program will
      by default try to connect to 'wayland-0'. This is a problem when a
      computer has a running Wayland compositor but is being accessed in some
      other fashion, such as through an X session on a different virtual
      terminal, over ssh, etc. Client programs launched through those means may
      attempt to connect to an unrelated compositor. Changing libwayland
      behavior to remove the default would also work, but a) libraries have
      stronger backward compatibility expectations b) that would likely break
      more people's setups than just changing Weston would.
      Signed-off-by: default avatarManuel Stoeckl <code@mstoeckl.com>
      ae69381b
  11. 09 Sep, 2020 1 commit
    • Denys Dmytriyenko's avatar
      tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and O_CREAT · b10c0e84
      Denys Dmytriyenko authored
      musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(),
      O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors:
      
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock':
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:7: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
      |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
      |       |       ^~~~
      |       |       popen
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function)
      |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
      |       |                       ^~~~~~
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: note: each undeclared identifier is reported only once for each function it appears in
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function)
      |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
      |       |                                ^~~~~~~~~
      | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function)
      |   135 |  fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
      |       |                                            ^~~~~~~
      Signed-off-by: default avatarDenys Dmytriyenko <denys@ti.com>
      b10c0e84
  12. 08 Sep, 2020 1 commit
  13. 07 Sep, 2020 4 commits