#1112: "Xlib: unexpected async reply" with threaded RTS and --sync command line
parameter
----------------------------------+-----------------------------------------
 Reporter:  guest                 |       Owner:  somebody
     Type:  defect                |      Status:  new     
 Priority:  normal                |   Milestone:          
Component:  general (Gtk+, Glib)  |     Version:  0.9.12  
 Keywords:  threads               |  
----------------------------------+-----------------------------------------
 A trivial program which uses unsafeInitGUIForThreadedRTS, and doesn't even
 start additional threads, causes the above error message when started with
 the "--sync" command line parameter. It has to be compiled with
 "-threaded", but multithreading doesn't need to be enabled at runtime for
 the error to occur. The same problem occurs even without the "--sync"
 parameter, but only in a much more complex program. All the parameter does
 is tell X to report errors synchronously.

 Calling XInitThreads at the start of main makes the error disappear, which
 indicates that Haskell calls Gtk (which in turn calls X) from multiple OS
 threads.

 The attached archive contains three versions of the same program:
  1. broken.hs prints the error and hangs. Some fierce resizing (i. e.
 Expose events) may be necessary to trigger the error.
  1. working.hs merely adds a call to XInitThreads and doesn't hang
 regardless of the amount of resizing.
  1. test.c is an equivalent program in C, which works fine without calling
 XInitThreads.

-- 
Ticket URL: <http://hackage.haskell.org/trac/gtk2hs/ticket/1112>
Gtk2Hs <http://haskell.org/gtk2hs/>
The Gtk2Hs project
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gtk2hs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to