xserver/hw
Olivier Fourdan f6cd99ed79 xwayland: remove dirty window unconditionally on unrealize
This is a rare occurrence of a crash in Xwayland for which I don't have
the reproducing steps, just a core file.

The backtrace looks as follow:

  #0  raise () from /usr/lib64/libc.so.6
  #1  abort () from /usr/lib64/libc.so.6
  #2  OsAbort () at utils.c:1361
  #3  AbortServer () at log.c:877
  #4  FatalError () at log.c:1015
  #5  OsSigHandler () at osinit.c:154
  #6  <signal handler called>
  #7  xwl_glamor_pixmap_get_wl_buffer () at xwayland-glamor.c:162
  #8  xwl_screen_post_damage () at xwayland.c:514
  #9  block_handler () at xwayland.c:665
  #10 BlockHandler () at dixutils.c:388
  #11 WaitForSomething () at WaitFor.c:219
  #12 Dispatch () at dispatch.c:422
  #13 dix_main () at main.c:287

The crash is caused by dereferencing “xwl_pixmap->buffer” in
xwl_glamor_pixmap_get_wl_buffer() because “xwl_pixmap” is NULL.

Reason for this is because the corresponding pixmap is from the root
window and xwayland is rootless by default.

This can happen if the window was mapped, redirected, damaged and
unredirected immediately, before the damage is processed by Xwayland.

Make sure to remove the dirty window from the damage list on unrealize
to prevent this from happening.

Credit goes to Adam Jackson <ajax@nwnk.net> and Daniel Stone
<daniel@fooishbar.org> for finding the root cause the issue.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 3362422e84)
2018-02-12 14:50:39 -05:00
..
dmx Unvalidated lengths 2017-10-12 12:25:02 -04:00
kdrive xephyr: Check for host XVideo support before trying to use it 2017-09-22 18:45:59 +02:00
vfb Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xfree86 xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when freeing pAdapt 2018-02-12 14:49:50 -05:00
xnest Remove fd_set from Block/Wakeup handler API 2016-07-18 15:27:51 -04:00
xquartz glx: Fix glXQueryContext for GLX_FBCONFIG_ID and GLX_RENDER_TYPE (v2) 2017-12-13 10:08:40 -05:00
xwayland xwayland: remove dirty window unconditionally on unrealize 2018-02-12 14:50:39 -05:00
xwin hw/xwin: Add 'dri' to DIST_SUBDIRS 2016-09-16 10:57:23 -07:00
Makefile.am Xwayland DDX 2014-04-03 15:19:22 -07:00