Community
Participate
Working Groups
All the 2.1 GTK builds of the last few months seem to hang/deadlock some of the time. This is on a Redhat 7.3 system with updates GTK 2.0 to the latest version. The problem seems to occur especially when Eclipse is not used for some time or when opening a file or doing a CVS update.
Created attachment 3696 [details] kill -3 on the jvm hosting a locked up eclipse
Two nested calls to get the clipboard contents. Klassjan, It appears you are pasting something and then close a dialog - looks like a refactoring operation. Can you describe the steps you were doing at the time? Relevant part of stack trace: at org.eclipse.swt.internal.gtk.OS.gtk_clipboard_wait_for_contents (Native Method) - locked <0x585d4760> (a java.lang.Class) at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:146) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.getClipboar dResources(PasteResourcesFromClipboardAction.java:195) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.canOperateO n(PasteResourcesFromClipboardAction.java:105) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.selectionCh anged(PasteResourcesFromClipboardAction.java:49) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:181) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:176) at org.eclipse.jdt.internal.ui.reorg.DualReorgAction.selectionChanged (DualReorgAction.java:40) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:153) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:151) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1287) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:654) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected (StructuredViewer.java:678) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:172) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:167) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:302) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:897) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1507) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1324) at org.eclipse.jface.window.Window.runEventLoop(Window.java:577) at org.eclipse.jface.window.Window.open(Window.java:557) at org.eclipse.ui.internal.dialogs.MessageDialogWithToggle.openConfirm (MessageDialogWithToggle.java:144) at org.eclipse.ui.internal.WorkbenchWindow.canHandleShellCloseEvent (WorkbenchWindow.java:439) at org.eclipse.jface.window.Window$2.shellClosed(Window.java:448) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:152) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:897) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:922) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:906) at org.eclipse.swt.widgets.Shell.closeWidget(Shell.java:424) at org.eclipse.swt.widgets.Shell.gtk_delete_event(Shell.java:624) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1134) at org.eclipse.swt.widgets.Display.windowProc(Display.java:1917) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Native Method) at org.eclipse.swt.widgets.Display.eventProc(Display.java:577) at org.eclipse.swt.internal.gtk.OS.gtk_clipboard_wait_for_contents (Native Method) - locked <0x585d4760> (a java.lang.Class) at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:146) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.getClipboar dResources(PasteResourcesFromClipboardAction.java:195) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.canOperateO n(PasteResourcesFromClipboardAction.java:105) at org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.selectionCh anged(PasteResourcesFromClipboardAction.java:49) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:181) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:176) at org.eclipse.jdt.internal.ui.reorg.DualReorgAction.selectionChanged (DualReorgAction.java:40) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:153) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:151) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1287) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:654) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected (StructuredViewer.java:678) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:172) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:167) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:302) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:897) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1507) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1324) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
That's the strange thing, this happens sometimes without doing anything in Eclipse at all, just having it running and doing other things. When I switch focus back to Eclipse it hangs. The X clipboard is of course very "active"; by selecting something it's put on the clipboard. Could be that Eclipse is confused by this clipboard activity? Btw. system is Redhat7.3+all updates with xinerama (multi-head) enabled.
Can you report the results of the following: rpm -q atk gtk2 glib freetype pango SWT requires the following: Gtk 2.0.6-1 Atk 1.0.1-1 Glib 2.0.4-1 Pango 1.0.3-2 Freetype 2.1.2 Older versions of the GTK library (e.g. GTK 2.0.5) have threading issues would could be causing the problem.
Seems I've got most of them up to date. atk-1.0.3-1 gtk2-2.0.9-1 glib2-2.0.7-1 freetype-2.0.9-2gtk pango-1.0.1-1 I'll update Freetype/pango anyway and let you know if something's changed. However, with the current Eclipse 2.1 RC2 I've got all kinds of interesting hard to reproduce problems on this configuration (much less on rh8), so I'm planning to upgrade this system.
Downgrading to P2 for now because no one else is seeing the problem. This doesn't mean we believe the problem is fixed but there is nothing we can do now for 2.1. Several things. First of all, thanks to GTK for the "free event loop" with every gtk_clipboard_wait_for_contents(). Very helpful to have UI events dispatched here! Given that this is happening, I see in the stack trace we are running stacked event loops in this call. VI to construct a simple case. Try Thread.sleep() before getting the clipboard contents and "clicking like mad" to ensure that events are queued for gtk_clipboard_wait_for_contents() to dispatch.
*** Bug 36175 has been marked as a duplicate of this bug. ***
*** Bug 39223 has been marked as a duplicate of this bug. ***
The error is in: org.eclipse.jdt.internal.ui.reorg.PasteResourcesFromClipboardAction.getClipboar dResources(PasteResourcesFromClipboardAction.java:195) This is code is calling Clipboard.getContents from a thread other than the UI thread. GTK runs an OS event loop when the contents of the clipboard are requested. This can only be done in the UI thread. As a result, I have added a check to the Clipboard API to ensure that it is being called from the UI thread. In >M2, this will result in an invalid thread access exception. Please update your code to call all Clipboard API from the UI thread.
Adam, please adjust the code accordingly. Veronika, are you going to backport this to 2.x stream. If so we have to fix it there as well.
I am not going to back port this to 2.x.
*** Bug 39898 has been marked as a duplicate of this bug. ***
In bug 39898, the same problem is occurring but with: at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction.canOperateOn (PasteAction.java:92)
fixed
*** Bug 40740 has been marked as a duplicate of this bug. ***
*** Bug 41076 has been marked as a duplicate of this bug. ***
Forgive my impertenance, but why is this bug only a P2? I can only guess as to the number of Eclipse/Linux/GTK users, but I imagine that the number is large. This problem is so severe, in fact, that I personally have started to feel a little "gun shy" with Eclipse. Anything that erodes user confidence in the stability of the tool should get a P1, IMHO. No matter how you decide on this matter, thanks for your hard work and for producing a wonderful tool!
Josh, see comment 6 ;-)
verified in I20030826-rebuild