I've written a small program using the gtk2hs library and it crashes at
unpredictable times with X windows errors like the one below. I looked for the
messages online and found various people talking about buggy gtk libraries but
no clear solutions. I don't know a lot about X windows or what these errors
mean. Has anyone else had this problem or know what to do? The program is a
simple implementation of the Conway Life game. It doesn't have very much going
on except that the main window is an animation showing the evolution of the
game. I tried running with the --sync option as it said and you get an almost
immediate error like "Xlib: unexpected async reply (sequence 0x1652)!". Even
these are not predictable and often come after several screen updates. I'm
using the Gtk.timeoutAddFull function to do the animation. Note that the
error_code, request_code, etc.. changes with each crash. It's as though it
picks a random error code each time. I've compiled with both
ghc 6.4.2 and 6.6.1 and gtk2hs 0.9.12 and 0.9.12.1. I've tried various
combinations of -O flags as well. Same problem every time.
A typical crash message
-----------------------------------------------------------------------
The program 'hlh' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 236321 error_code 9 request_code 62 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
---------------------------------
Never miss a thing. Make Yahoo your homepage.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe