Skip to main content



      Home
Home » Eclipse Projects » WindowBuilder » WB causes Eclipse to hang after closing Preview window
WB causes Eclipse to hang after closing Preview window [message #1698739] Wed, 17 June 2015 10:35 Go to next message
Eclipse UserFriend
Almost without fail (about 90% of the time), after closing the preview window in design mode, I find that Eclipse has completely frozen. I used jstack to attach to the eclipse process and figure out what's going on. It seems that WB's SwingImageUtils class calls java.awt.Window.dispose on the preview window, which eventually calls java.awt.EventQueue.invokeAndWait. Then it gets stuck at lock.wait() in that method. For some reason, that lock object in EventQueue never gets notified, and so Eclipse's main thread hangs forever. I have no idea how to fix this problem.

I'm running Eclipse Luna with WB 1.7.0r44 on Ubuntu. Everything appears to be fully updated. I have two thread dumps (java and mixed) showing where Eclipse gets stuck. Previously I had tried WB 1.8.0 and had the same issue, but I didn't take any thread dumps with that so I'm not sure if it's the exact same issue. I've tried both the GTK and Metal LAFs and both have the same issue (the GTK one also has the additional issue of sometimes causing Eclipse to abort due to some problem with xcb, but that's probably another issue).

Any ideas on what I can do to fix this? Or should I file a bug report somewhere?
Re: WB causes Eclipse to hang after closing Preview window [message #1698766 is a reply to message #1698739] Wed, 17 June 2015 12:20 Go to previous messageGo to next message
Eclipse UserFriend
One thing to note is that the AWT-EventQueue-0 thread seems to be missing from the thread dumps. I think the problem is that somehow, the event dispatch thread is exiting before the lock is being notified, but after the actual window is disposed, since the window does close despite Eclipse being hung. So, some sort of race condition is going on.

This all happened when I was running on OpenJDK. The issue seems to be gone with Oracle Java. There's probably a bug that needs to be reported somewhere, but I'm not sure where. Is this a bug in the way WB deals with showing preview windows, or a bug with OpenJDK? For the record, the image of the window in the Design tab works fine, and clicking the refresh button works fine too, without causing any issues. The problem only happens when opening the preview window, and then trying to close it.
Re: WB causes Eclipse to hang after closing Preview window [message #1698807 is a reply to message #1698766] Wed, 17 June 2015 21:52 Go to previous messageGo to next message
Eclipse UserFriend
I seriously doubt this has anything to do with WB. The code you are referencing has not changed in many years and has worked just fine for tens of thousands of users. This appears to be an OpenJDK bug of some sort. The fact that it works in Oracle Java (e.g., official Java) pretty much demonstrates that. I don't see anything in the WB code that we would change here.
Re: WB causes Eclipse to hang after closing Preview window [message #1698883 is a reply to message #1698807] Thu, 18 June 2015 09:48 Go to previous message
Eclipse UserFriend
All right, I'll try verifying the problem exists on OpenJDK 8 and then file a bug report. I was just wondering because I've only seen this issue pop up when using WB so I thought maybe WB was doing something unusual with window disposal to cause this. If that code has been the same for a while, then it does sound like an OpenJDK bug.
Previous Topic:Window Builder causes a copy of the project to run, and it will not close?
Next Topic:WB Fails to render custom component with NoDefClassFoundException
Goto Forum:
  


Current Time: Mon Jul 14 10:19:36 EDT 2025

Powered by FUDForum. Page generated in 0.37081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top