Bug 380671

Summary: FIXED IN SVN: X11 ONLY: crash/hang when using Gtk2 packages
Product: [Applications] rkward Reporter: RKWard Team <rkward-devel>
Component: generalAssignee: RKWard Team <rkward-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RKWard Team 2008-01-23 23:37:17 UTC
-- Originally posted by (AT sourceforge.net): *anonymous --

-- This ticket was imported from http://sourceforge.net/p/rkward/bugs/21 on 2017-05-30 15:26:34 +0100 --
library\(RGtk2\) \# hangs

the message in konsole is 

Xlib: unexpected async reply \(sequence 0x55\)\!

Can someone confirm? It might just be a Debian thing \(using r-cran-rgtk2 here\)

Ben Goodrich
Comment 1 Thomas Friedrichsmeier 2008-01-24 23:38:43 UTC
Logged In: YES 
user\_id=300591
Originator: NO

I see the same issue \(also on Debian, but downloaded RGtk2 from CRAN via R\).

The issue is not 100% reproducible, but perhaps 98% so.

If you run
&gt; Sys.setenv \(DISPLAY=":0.123412"\)
&gt; library \(RGtk2\)
there is no hang, but RGtk2 complains about failing to initialize. Now do
&gt; gdkDisplayOpen\(":0.0"\)
and you get the hang, again, so this is where the problem is at.

Somehow the issue seems to be that RGtk2 \(running in the "R thread" in RKWard\) tries to talk to the X server concurrently with Qt. However, I don't really understand, why this should be a problem, since RGtk2 should use its own XDisplay/connection, which should be fine, as far as I am aware. Also in RKWard 0.4.9 there is no such problem.

Unfortunately, I have no good idea on this at all. Any help will be much appreciated.

Starting rkward with
\# rkward --sync
makes the problem go away most \(but not all\) of the time.
Comment 2 Thomas Friedrichsmeier 2009-04-02 19:51:55 UTC
The issue has changed somewhat \(without any changes on rkward's side\).
library \(RGtk2\)
does not hang, now. However, calling
gdkDisplayOpen\(":0"\)
after that, makes the R thread hang, while the main thread continues.

library\(gWidgetsRGtk2\)
causes similar symptoms.

Any help is still much appreciated.
Comment 3 Thomas Friedrichsmeier 2009-04-02 19:51:55 UTC
- **summary**: rkward 0.5.0a hangs when loading the RGtk2 package --> 0.5.0x hangs when loading Gtk2 packages
Comment 4 Thomas Friedrichsmeier 2009-09-07 09:24:12 UTC
Minor update:

After a recent fix, on Windows, RGtk2 and friends appear to work fine.

On Linux / X11 the situation is unchanged. Debugging indicates that the R thread is stuck waiting in XSync\(\) or \_XReply\(\) \(typically from within gdk\_display\_open\(\)\).
Comment 5 Thomas Friedrichsmeier 2009-09-07 09:24:13 UTC
- **summary**: 0.5.0x hangs when loading Gtk2 packages --> X11 ONLY: 0.5.0x hangs when loading Gtk2 packages
Comment 6 Thomas Friedrichsmeier 2010-10-21 10:36:57 UTC
An experimental fix is in SVN: http://p.sf.net/rkward/svn . If you are affected by this problem, please give this a try.
Comment 7 Thomas Friedrichsmeier 2010-10-21 10:36:57 UTC
- **summary**: X11 ONLY: 0.5.0x hangs when loading Gtk2 packages --> NEEDS TESTING: X11 ONLY: crash/hang when using Gtk2 packages
Comment 8 Thomas Friedrichsmeier 2010-11-19 12:17:45 UTC
The experimental fix caused troubles, and I have reverted it.

Instead, in the SVN version, the R backend now runs in a separate process \(at least by default\). This fixes the incompatiblities with rJava and RGtk2 on X11.

Please test\!
Comment 9 Thomas Friedrichsmeier 2010-11-19 12:17:45 UTC
- **summary**: NEEDS TESTING: X11 ONLY: crash/hang when using Gtk2 packages --> FIXED IN SVN: X11 ONLY: crash/hang when using Gtk2 packages
- **status**: open --> open-fixed
Comment 10 Thomas Friedrichsmeier 2011-03-20 11:27:51 UTC
- **status**: open-fixed --> closed-fixed