Felix Kühling fxkuehl at
Wed Sep 7 11:09:27 PDT 2005

Your problem with debugging this is probably related to how Xlib batches
commands. It also submits commands to the Xserver without waiting for
them to complete. So you may get an error messaged about a command that
was sent much earlier. There is a synchronous mode for Xlib that would
probably help you locate the exact command that fails. I have never done
this myself though. A quick search in Google turned up this article
about X protocol error debugging:


Am Mittwoch, den 07.09.2005, 10:48 -0700 schrieb Peter J. Bismuti:
> Day 2, running into problems creating a window using XCreateWindow.  It is 
> failing and I haven't been able to pinpoint the cause.  I'm setting _Xdebug = 
> 1 in the debugger and printing the stack tracke within _XError, but it does 
> give consistent results.  Sometimes it crashes within XCreateWindow, other 
> times it crashes within XAllocColorCells.   It is said that debuggers are 
> unreliable, how can I be certain where the problem is?  Is the X protocol 
> error message always correct?   It says that it is a "BadMatch", an error the 
> docs say cannot occur in XAllocColorCells.  Once I'm certain that it the 
> problem is in XCreateWindow, what next? Trial-and-error doesn't seem to be 
> working.  Any help would be appreciated.
> Also, if anyone has a simple "hello world" program that uses a DirectColor 
> visual,  I would appreciate it if you could send it to me.    
> Thanks.
> X Error of failed request:  BadMatch (invalid parameter attributes)
>   Major opcode of failed request:  1 (X_CreateWindow)
>   Serial number of failed request:  9
>   Current serial number in output stream:  10
> (First run)
> #0  0x00b2ed66 in _XError () from /usr/X11R6/lib/
> #1  0x00b2f557 in _XReply () from /usr/X11R6/lib/
> #2  0x00b2a0f6 in XSync () from /usr/X11R6/lib/
> #3  0x00b2a1ad in XSync () from /usr/X11R6/lib/
> #4  0x00b2c7e5 in XCreateWindow () from /usr/X11R6/lib/
> #5  0x08052c0e in grinit (argc=0xbfee3d40, argv=0xbfee3dc4) at grinit.c:117
> #6  0x08066a40 in main (argc=1, argv=0xbfee3dc4, envp=0xbfee3dcc) at tgs.c:103
> (Second run)
> (gdb) where
> #0  0x00b2ed66 in _XError () from /usr/X11R6/lib/
> #1  0x00b2f557 in _XReply () from /usr/X11R6/lib/
> #2  0x00b0b7e9 in XAllocColorCells () from /usr/X11R6/lib/
> #3  0x08052c81 in grinit (argc=0xbfe15390, argv=0xbfe15414) at grinit.c:124
> #4  0x08066a40 in main (argc=1, argv=0xbfe15414, envp=0xbfe1541c) at tgs.c:103
> _______________________________________________
> xorg mailing list
> xorg at
| Felix Kühling <fxkuehl at>            |
| PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3  B152 151C 5CC1 D888 E595 |

More information about the xorg mailing list