[PATCH weston 0/8] libweston: Make input object destruction safe

Alexandros Frantzis alexandros.frantzis at collabora.com
Fri Jan 26 16:47:54 UTC 2018


When an weston seat or input object is destroyed, any associated client
resources should become inert and put in a state in which they can
safely handle client requests. Currently, client requests to such
resources may lead to crashes and/or memory errors in the server.

This patchset aims to fix (or at least greatly improve) the situation.

Patches (1) to (4) ensure that when the various input objects are
destroyed, any associated resources are made inert and can safely handle
client requests.

Patches (5) to (7) update the test infrastructure to properly support
requests to dynamically add and remove the test seat.

Patch (8) introduces a test for removing and re-adding the test seat.
This test indirectly checks some of the input code fixes made in the
patches 1-4. Two things to note about this test:

1. As mentioned in more detail in the commit, the test needs to be in
its own file for now.  I haven't investigated in depth but the problem
seems to be in desktop-shell's lack of support for wl_seat
removal/re-addition. As a test, I tried running with the
fullscreen-shell and the problem is gone. This was too deep of a rabbit
hole to go into in this patchset, but I will investigate further and
hopefully we can remove this workaround.

2. Even without some of the fixes in the patches 1-4, the test may seem
to pass. However, running with a memory debugger reveals a different
story, since without the fixes we encounter various memory errors.

Alexandros Frantzis (8):
  libweston: Make weston_pointer destruction safe
  libweston: Make weston_keyboard destruction safe
  libweston: Make weston_touch destruction safe
  libweston: Make weston_seat release safe
  tests: Support setting the test client input dynamically
  tests: Support weston_test request for adding a test seat
  tests: Handle removal of seat global in test clients
  tests: Add test for seat destruction and creation

 Makefile.am                       |   5 ++
 libweston/input.c                 | 115 ++++++++++++++++++++++++-----
 tests/devices-seat-test.c         |  53 ++++++++++++++
 tests/weston-test-client-helper.c | 147 +++++++++++++++++++++++++++++---------
 tests/weston-test-client-helper.h |   2 +
 tests/weston-test.c               |  32 +++++++--
 6 files changed, 294 insertions(+), 60 deletions(-)
 create mode 100644 tests/devices-seat-test.c

-- 
2.14.1



More information about the wayland-devel mailing list