Subject: proposed fix for XF4 crashing
To: None <current-users@netbsd.org>
From: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
List: tech-x11
Date: 01/08/2002 22:39:27
Hi,

I think I've finally found the cause of often crashes of XFree 4.x
servers, which annoyed me for ~2 years.
For me, these crashes usually happen if I try to move a mouse while an
X server is busy loading or resizing Asian characters.
If you use European (1 byte) characters only, it is likely you aren't
aware of this problem.

Although I tried the following patch on several machines, I'm not
yet very sure this actually fix the problem. So I'd like to here some
more test result before committing this.  If you are having the same
trouble as mine, please try this patch and report the result.

My guess is that the crashes are due to race between pointer motion
event queueing (which happens from signal handler) and removal of
events from the queue.


Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c
===================================================================
RCS file: /cvs/cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 bsd_mouse.c
--- bsd/bsd_mouse.c	2001/03/18 17:33:05	1.1.1.2
+++ bsd/bsd_mouse.c	2002/01/07 12:02:36
@@ -236,7 +236,7 @@
 		pInfo->fd = -1;
 	    } else {
 		xf86FlushInput(pInfo->fd);
-		if (!xf86InstallSIGIOHandler (pInfo->fd, wsconsSigioReadInput, pInfo))
+/*		if (!xf86InstallSIGIOHandler (pInfo->fd, wsconsSigioReadInput, pInfo)) */
 		    AddEnabledDevice(pInfo->fd);
 	    }
 	}
@@ -427,8 +427,8 @@
 		pInfo->fd = -1;
 	    } else {
 		xf86FlushInput(pInfo->fd);
-		if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput, 
-					      pInfo))
+/*		if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput, 
+					      pInfo)) */
 		    AddEnabledDevice(pInfo->fd);
 	    }
 	}