JDK-6225372 : Posslbe for EventQueue.invokeAndWait to never return, without deadlocking
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2_05
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-04
  • Updated: 2011-01-31
  • Resolved: 2005-04-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_09 b01Fixed
Related Reports
Relates :  
Description
Run the following program:

###-------------------------------
package mypackage;
import java.awt.EventQueue;
public class Class1 {
  public static void main(String[] args) throws Exception {
    EventQueue.invokeAndWait(new Runnable() {
      public void run() {
        throw new Error();
      }
    });
    System.out.println("hello");
  }
}
###-------------------------------

The stack trace for the Error is printed, but the invokeAndWait call never returns, normally or abruptly.  So the thread using invokeAndWait waits forever, and there is no deadlock.

In practice, we've seen this problem when using javax.swing.tree.DefaultMutableTreeNode, because some of its methods throw Error when an invariant is violated.
###@###.### 2005-2-04 00:06:37 GMT

Comments
EVALUATION Not reproducible with tiger or mustang on any platform. It's also unable to reproduce it with 1.4.2 on Windows. It seems that it was fixed in 4403712. ###@###.### 2005-2-08 13:13:27 GMT Retargetting to an update release manager. ###@###.### 2005-2-08 13:20:31 GMT The bug is reproduceable on 1.4.2, 1.4.2_08 on windows and sparc. It has been fixed in tiger. File: InvocationEvent.java, method: dispatch() In 1.4.2 try { runnable.run(); } catch (Exception e) { exception = e; } In 1.5.0 try { runnable.run(); } catch (Throwable t) { if (t instanceof Exception) { exception = (Exception) t; } throwable = t; } The fix in 1.5 needs to be backported to 1.4.2 ###@###.### 2005-2-10 02:44:54 GMT The bug has been fixed by adding a new private method getThrowableObject() in java/awt/event/InvocationEvent.java and retrieving the Throwable object through reflection in invokeAndWait(...) method of EventQueue.java ###@###.### 2005-03-14 23:15:15 GMT
2005-02-08