[Haskell-cafe] gtk2hs problem

Stefan O'Rear stefanor at cox.net
Tue Nov 20 18:59:27 EST 2007

On Tue, Nov 20, 2007 at 03:18:03PM -0800, Gregory Propf wrote:
> 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.)

What happens if you run 'gdb ./hlh', 'b gdk_x_error', 'run --sync' ?

(Are the backtraces consistent?)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071120/4e354b24/attachment-0001.bin

More information about the Haskell-Cafe mailing list