JDK-6386791 : Mustang: SWT application hangs with embedded swing components
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86
  • Submitted: 2006-02-16
  • Updated: 2011-04-28
From webbugs review ID 644155:

category:    java
subcategory: classes_swing
company:     SAS Institute
release:     mustang
hardware:    x86
OSversion:   Linux
priority:    2
synopsis:    SWT application hangs with embedded swing components
description: Problem: Application hangs with "Xlib: unexpected async reply" message printed while running an SWT application with embedded Swing components.

Environment: Linux (Fedora Core 4)
              JDK 1.6 (problem seen with builds 68 and 70)
              GTK Look and Feel (problem seen with GTK 2.6.7 and 2.6.10)
              SWT 3.1.1

The problem does not occur at all with JDK 5.0, and it does not occur on JDK 6.0 unless the GTK look and feel is used (Metal works fine). SWT 3.2 also displays the same problem, again only with JDK 6.0 and only with the GTK look and feel.

Un-tar the attached application, edit the "run" script for your environment, and run it.

About 25% of the time for me, it will immediately print out a message like:

Xlib: unexpected async reply (sequence 0x2e0)!

At this point the application is mostly unresponsive.

The application is a very simple example of embedding Swing into an SWT application via the SWT_AWT bridge. The source for the app is included in the tar file (see /com.sas.swtswing/com/sas/swtswing/Main.java).

EVALUATION This problem is most likely related to the introduction of GTK LAF native rendering in Mustang. Either SWT or the bridge may access GTK methods on their own, so multithreaded access may occur, which GTK does not like. The bridge should probably have some means of protection.