[Haskell-cafe] gtk2hs problem

Gregory Propf gregorypropf at yahoo.com
Tue Nov 20 18:18:03 EST 2007

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  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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071120/afc59b1d/attachment.htm

More information about the Haskell-Cafe mailing list