<AWT Dev> Endless loop in EventDispatchThread - proposed solution
linuxhippy at gmail.com
Mon Aug 29 12:36:23 PDT 2011
we had a short offline discussion with Oleg, and we both agree there is no
> need to clear the event queue explicitly. If the interrupt() call comes from
> AppContext.dispose(), a new EDT will not be initialized (because of the
> check for AppContext.isDisposed() in initDispatchThread()).
Thanks, I updated both versions of the patch with the comment suggested by
Dave (however my englisch is not perfect, so please feel free to modify it
as you like):
If the "full" version is considered too risky for JDK7, it would be great if
the minimal could make it in, as caciocavallo-web gets bitten by this bug.
The "minimal" version has a more extensive comment, as for the "minimal"
version the check for isHeldByCurrentThread is not just cosmetic but
So your "full" version of the fix looks fine. As a sanity check, please run
> all the tests from test/java/awt/EQ and test/java/awt/EDT with your changes,
> it shouldn't take much time.
I ran the tests, but EventDispatchThread/LoopRobustness fails with:
> Caused by: java.lang.RuntimeException: Die, AWT-Event Queue thread!
> at HostileCrasher.<clinit>(LoopRobustness.java:157)
> ... 23 more
> Exception in thread "main" java.lang.RuntimeException: Test FAILED: second
> thread hasn't notified MainThread
> at LoopRobustness.main(LoopRobustness.java:70)
and HandleExceptionOnEDT seems to time out somehow:
Exception in thread "main" sun.awt.SunToolkit$OperationTimedOut: 10005
> at sun.awt.X11.XToolkit.syncNativeQueue(XToolkit.java:2443)
> at sun.awt.SunToolkit.realSync(SunToolkit.java:1580)
> at sun.awt.SunToolkit.realSync(SunToolkit.java:1512)
> at test.java.awt.regtesthelpers.Util.waitForIdle(Util.java:184)
> at HandleExceptionOnEDT.main(HandleExceptionOnEDT.java:75)
However, I get exatly the same behaviour with the proprietary release build
so I guess those tests have been broken before. Are those tests executed
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev