[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#390646: xserver-xorg: Server crash when switching back from full screen mode



On Fri, 2006-10-13 at 12:22 +0200, Michel Dänzer wrote:
> On Wed, 2006-10-11 at 02:32 +0200, Frans Pop wrote: 
> > 
> > On Monday 02 October 2006 13:51, Frans Pop wrote:
> > > After playing a particular game (Chromium) in full screen mode, the
> > > XOrg server crashes about 2 out of 3 times when switching back to KDE.
> > 
> > With the help of David I've done some further research on this and 
> > obtained a full backtrace from gdb with both the xserver and the i810 
> > driver compiled with debugging symbols (attached).
> > 
> > I used the upstream 1.7.0 version of the i810 driver for this, so it is 
> > confirmed that the new driver does _not_ fix this issue.
> > 
> > From the Xorg log:
> > (II) Module i810: vendor="X.Org Foundation"
> >         compiled for 7.1.1, module version = 1.7.0
> >         Module class: X.Org Video Driver
> >         ABI class: X.Org Video Driver, version 1.0
> > 
> > My default screen resolution when running KDE is 1280x1024. The game 
> > switches that to fullscreen mode at 800x600.
> > The crash mostly happens when exiting the game, but also sometimes when 
> > starting it.
> > Both starting and exiting the game are also sometimes successful.
> 
> Thanks for the detailed information. This looks like a race condition
> between the mode switching code leaving pScrn->currentMode NULL for some
> time and I830SetCursorPosition() dereferencing it unconditionally,
> getting called from the SIGIO handler. 
> 
> Can you try the attached patch? Alternatively, possible workarounds are:
> 
>       * Disabling SilkenMouse
>       * Not moving the mouse while the mode is being switched ;)
> 
> Alan, if the patch works for Frans, should I push it to xf86-video-intel
> git, or would you like to fix this differently?

Makes me think we should block the signal when switching in the cursor
code as in the attached patch. Just as we do for VT switching.

Frans - this means rebuilding the Xserver - but does this work for you ?

Alan.
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 61f0ce5..bc996be 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -213,6 +213,7 @@ xf86SwitchMode(ScreenPtr pScreen, Displa
   ScreenPtr   pCursorScreen;
   Bool        Switched;
   int         px, py;
+  int         sigstate;
 
   if (!pScr->vtSema || !mode || !pScr->SwitchMode)
     return FALSE;
@@ -232,9 +233,11 @@ #endif
   if (pScreen == pCursorScreen)
     miPointerPosition(&px, &py);
 
+  sigstate = xf86BlockSIGIO ();
   xf86EnterServerState(SETUP);
   Switched = (*pScr->SwitchMode)(pScr->scrnIndex, mode, 0);
   xf86EnterServerState(OPERATING);
+  xf86UnblockSIGIO (sigstate);
   if (Switched) {
     pScr->currentMode = mode;
 

Reply to: