[PATCH xserver 1/2] xwayland: Restore wl_display_roundtrip() in InitInput

Olivier Fourdan ofourdan at redhat.com
Thu May 12 12:51:51 UTC 2016


This partially revert commit 984be78

The rountrip in Xwayland's InitInput() is unlikely the culprit for the
crash reported in bug 95337, even though it's triggered from
InitInput().

Startup goes like this:

  xwl_screen_init()
    xwl_output_create()
    wl_display_roundtrip()
  InitInput()
    wl_display_roundtrip()
  ConnectionInfo initialized

What happens in bug 95337 is that some output data is already available
when we reach InitInput()'s wl_display_roundtrip() and therefore we end
up trying to update the ConnectionInfo's data from RR routines before
ConnectionInfo is actually initialized.

Removing the wl_display_roundtrip() from InitInput() will not fix the
issue (although it would make it less lileky to happen), because
xwl_screen_init() also does a wl_display_roundtrip() after creating the
output, so the race that led to bug 95337 remains.

However, re-setting the xwl_screen->expecting_event to 0 again in
InitInput() still doesn't seem right. so this part is not restored
(thus a partial revert).

Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337
---
 hw/xwayland/xwayland-input.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index cbc1bf2..6e95d7e 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -899,6 +899,10 @@ InitInput(int argc, char *argv[])
     xwl_screen->input_registry = wl_display_get_registry(xwl_screen->display);
     wl_registry_add_listener(xwl_screen->input_registry, &input_listener,
                              xwl_screen);
+
+    wl_display_roundtrip(xwl_screen->display);
+    while (xwl_screen->expecting_event)
+        wl_display_roundtrip(xwl_screen->display);
 }
 
 void
-- 
2.7.4



More information about the xorg-devel mailing list