-------- Forwarded Message --------
From: Ben Hutchings <[EMAIL PROTECTED]>
To: Tuomo Valkonen <[EMAIL PROTECTED]>
Cc: Ion general <[EMAIL PROTECTED]>
Subject: Re: Bug#490601: fails with many xio errors when started from
xdm
Date: Mon, 21 Jul 2008 01:00:41 +0100

I got a report of a weird and unreproducible error in Ion3 startup:
http://bugs.debian.org/490601

BadMatch is not a documented error code for XGetWindowProperty which
sends X_GetProperty requests.  However, the implementation in Xorg
appears to return BadMatch if and only if it's passed a reference to a
drawable that isn't a window:
http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=blob;hb=8822110d7d6b684f373fc883aeb7cab9734e9ddb;f=dix/dixutils.c#l197

I don't understand how the server coordinates window changes with the
WM.  Is it possible that a window can be completely deleted before the
WM has handled it?  In that case there is presumably a race condition
where a window could disppear and another drawable be created with the
same id.

This seems like a bug in Xorg, but we presumably need to work around it.
The obvious patch is below.

Ben.

--- ion3.orig/ioncore/rootwin.c
+++ ion3/ioncore/rootwin.c
@@ -58,10 +58,11 @@
     static char msg[128], request[64], num[32];
     
     /* Just ignore bad window and similar errors; makes the rest of
-     * the code simpler.
+     * the code simpler.  Due to a Xorg bug, window lookups may fail
+     * with BadMatch instead of BadWindow.
      */
     if((ev->error_code==BadWindow ||
-        (ev->error_code==BadMatch && ev->request_code==X_SetInputFocus) ||
+        ev->error_code==BadMatch ||
         (ev->error_code==BadDrawable && ev->request_code==X_GetGeometry)) &&
        ignore_badwindow)
         return 0;
--- END ---

-- 
Ben Hutchings
Usenet is essentially a HUGE group of people passing notes in class.
                      - Rachel Kadel, `A Quick Guide to Newsgroup Etiquette'

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to