On Fri, Feb 01, 2008 at 08:53:32PM +0100, Viktor Griph wrote: > On Fri, 1 Feb 2008, Roman S Dubtsov wrote: [snip] > >Also, I have attached: > >* crash.log.bz2 --- log file obtained after source modifications described > >in > >Viktor's e-mail, > >* gdb.log.bz2 --- gdb log, > >* fvwm.tar.bz2 --- my config (stripped down a bit). > > It seems as if XGetGeometry does the right thing, and gets the size of the > root pixmap, but XGetImage, still generates a BadMatch error. That is > quite strange, since the XServer is grabbed until after the call to > XGetImage. If the pixmap was invalid, I'd think that XGetGeometry should > fail as well, but apparently it doesn't.
That's because it is necessary to call XSync() right after grabbing the X server. The MyXGrabServer() function in libs/Grab.c does this, and we really must never call XGrabServer or XUngrabServer directly anywhere else because My...() does reference conting (I'll fix that in my next patch). However, I have no idea why the XSync() call is necessary. I've never seen any documentation that mentions it, but real life shows that it is necessary (perhaps only with XFree86/Xorg?). > >[snip] > > > >PS. I have added a check for NULL after XGetImage with a goto to the > >cleanup > >portion of the function and was not able to reproduce the crash. > > That's as I expect. THat is actually the best solution I can come up with > right now. But it will not get rid of the X-errors. We always have to cope with unexpected errors anyway. > We should at least add > that kind of checks to all XGetImage calls. But ideally we should also > find a way to not get the error at all. Using MyX(un)Grabserver() should fix this. > I belive the error will be reduced > if the event queue is checked for additional background changes before > doing any redrawing. That should also save updating root transparancy for > a background that is remeoved directly. It will however not guarantee that > the background pixmap isn't removed during the actual update. [snip] Ciao Dominik ^_^ ^_^ -- Dominik Vogt