Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358037 - Eclipse hangs inside _gtk_widget_realize[native]()
Summary: Eclipse hangs inside _gtk_widget_realize[native]()
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 critical with 8 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 376127 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-18 19:09 EDT by Julek Kopczewski CLA
Modified: 2016-08-05 09:03 EDT (History)
14 users (show)

See Also:


Attachments
jvisualvm thread dump taken during the hang (20.26 KB, application/octet-stream)
2011-09-18 19:15 EDT, Julek Kopczewski CLA
no flags Details
jvisualvm snapshot (4.09 KB, application/octet-stream)
2011-09-18 19:15 EDT, Julek Kopczewski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julek Kopczewski CLA 2011-09-18 19:09:31 EDT
Build Identifier: I20110613-1736

Any tooltip window takes 5-10 seconds to display causing a 100% CPU load, and a UI lock up.

This problem appears in different editors from different plugins and seems to be rooted in the Eclipse UI itself - editors causing problem: PyDev *.py, Web tools HTML/CSS editor.

Following suggestions in other bug reports I've disabled Appearences > Animations. This has no effect.

Using jvisualvm I was able to capture a stacktrace as well as a sample profile of the hang.

Top of the sample profile:

org.eclipse.swt.internal.gtk.OS._gtk_widget_realize[native]()	81.86382	22996 ms (81,9%)	22996 ms
org.eclipse.swt.internal.gtk.OS.Call[native]()	17.085787	4799 ms (17,1%)	4799 ms
org.eclipse.swt.internal.gtk.OS._gtk_main_do_event[native]()	0.35481748	99.6 ms (0,4%)	99.6 ms
org.eclipse.swt.internal.gtk.OS._pango_layout_get_line_count[native]()	0.34918573	98.0 ms (0,3%)	98.0 ms
org.eclipse.jface.viewers.OwnerDrawLabelProvider$OwnerDrawListener.handleEvent()	0.3463841	97.3 ms (0,3%)	97.3 ms

Other positions seem insignificant (< 0.01% of time each)

Relevant stack trace:


"main" prio=10 tid=0x0000000040cc4000 nid=0x54e0 runnable [0x00007f9cde477000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS._gtk_widget_realize(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_widget_realize(OS.java:13086)
	at org.eclipse.swt.widgets.Shell.createHandle(Shell.java:713)
	at org.eclipse.swt.widgets.Widget.createWidget(Widget.java:412)
	at org.eclipse.swt.widgets.Control.createWidget(Control.java:570)
	at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:152)
	at org.eclipse.swt.widgets.Decorations.createWidget(Decorations.java:240)
	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:281)
	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:359)
	at org.eclipse.jface.text.AbstractInformationControl.<init>(AbstractInformationControl.java:181)
	at org.eclipse.jface.text.AbstractInformationControl.<init>(AbstractInformationControl.java:123)
	at org.eclipse.jface.text.DefaultInformationControl.<init>(DefaultInformationControl.java:282)
	at org.python.pydev.editor.hover.PyTextHover$PyInformationControl.<init>(PyTextHover.java:80)
	at org.python.pydev.editor.hover.PyTextHover$PyInformationControl.<init>(PyTextHover.java:79)
	at org.python.pydev.editor.hover.PyTextHover$1.createInformationControl(PyTextHover.java:357)
	at org.eclipse.jface.text.AbstractInformationControlManager.getInformationControl(AbstractInformationControlManager.java:819)
	at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1168)
	at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1150)
	at org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation(AbstractHoverInformationControlManager.java:902)
	at org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation(TextViewerHoverManager.java:243)
	at org.eclipse.jface.text.TextViewerHoverManager$5.run(TextViewerHoverManager.java:233)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	- locked <0x00000000f07017f0> (a org.eclipse.swt.widgets.RunnableLock)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


Reproducible: Always

Steps to Reproduce:
1. Open Eclipse on a recent Ubuntu Natty installation
2. Open any editors capable of producing hover tooltips like PyDev *.py or HTML/CSS editor
3. Hover on a content that will produce a tooltip
4. Experience a 5-10 seconds hang, during which UI is not responding and tooltip isn't yet displayed
Comment 1 Julek Kopczewski CLA 2011-09-18 19:15:09 EDT
Created attachment 203563 [details]
jvisualvm thread dump taken during the hang
Comment 2 Julek Kopczewski CLA 2011-09-18 19:15:45 EDT
Created attachment 203564 [details]
jvisualvm snapshot
Comment 3 Julek Kopczewski CLA 2011-09-18 19:18:26 EDT
For reproductibility I believe it is important to open Eclipse in a Gnome environment.
Comment 4 Julek Kopczewski CLA 2011-09-18 19:21:19 EDT
Affects both Eclipse 3.6 and 3.7, haven't tested on earlier versions.
Comment 5 Remy Suen CLA 2011-09-18 20:04:22 EDT
Think there might be another bug on this.
Comment 6 Julek Kopczewski CLA 2011-09-18 21:31:06 EDT
I've found these:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=354842
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354842

but in the case of the first the workaround (disabling animations) doesn't really have any effect. The latter case looks indeed similar, but the native function call and the stacktrace look different, so I'm not entirely sure.
Comment 7 Julek Kopczewski CLA 2011-09-19 11:57:09 EDT
(In reply to comment #6)
> I've found these:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=354842
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=354842

and as a second one I meant this one:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=345093
Comment 8 Julek Kopczewski CLA 2011-09-21 16:19:08 EDT
Hello, 

Could I at least get a confirmation on whether or not this affects all Linux installations with Gnome3 or is it just my particular case?

If it affects all of them I seriously think this is a *very* *very* important issue. Gnome3 is gaining popularity among various distributions. It will be available in Ubuntu in the next release. 

And I kid you not, Eclipse is unusable with this bug in place. You have to wait for completion dialogs. You have to wait for annotation hints, you have to wait for in-code symbol hints. You have to wait and wait, and the CPU gets hot. I mean, if each time this happens one has to wait for 5-10 seconds, I don't think it's very likely people will stay on Eclipse.
Comment 9 Arun Thondapu CLA 2011-09-22 05:46:08 EDT
I don't see the problem with Eclipse running on Ubuntu 11.04, Unity desktop.
I haven't tested with GNOME 3 yet but I'll try to do it and then provide an update about the same.
Comment 10 Julek Kopczewski CLA 2011-09-22 12:25:01 EDT
(In reply to comment #9)
> I don't see the problem with Eclipse running on Ubuntu 11.04, Unity desktop.
> I haven't tested with GNOME 3 yet but I'll try to do it and then provide an
> update about the same.

To test it with Gnome 3 you need to actually install Gnome 3 from PPA. Also note that this breaks Gnome 2/Unity installations, however is reversible.
Comment 11 Arun Thondapu CLA 2011-09-26 08:03:53 EDT
(In reply to comment #10)
> 
> To test it with Gnome 3 you need to actually install Gnome 3 from PPA. Also
> note that this breaks Gnome 2/Unity installations, however is reversible.

I tried installing GNOME 3 from PPA and ended up with a situation where neither Unity nor GNOME 3 was loading properly!
Luckily, it was a virtual machine setup and so I'm gonna uninstall and reinstall and give it another try.
Comment 12 Julek Kopczewski CLA 2011-10-05 08:19:53 EDT
> I tried installing GNOME 3 from PPA and ended up with a situation where neither
> Unity nor GNOME 3 was loading properly!
> Luckily, it was a virtual machine setup and so I'm gonna uninstall and
> reinstall and give it another try.

I'll give it a try with a Gnome 3 live CD in a few days.
Comment 13 Sergey Prigogin CLA 2012-04-04 18:30:19 EDT
*** Bug 376127 has been marked as a duplicate of this bug. ***
Comment 14 Sergey Prigogin CLA 2012-04-04 18:31:54 EDT
Bumped up priority since Eclipse is unusable with this bug.
Comment 15 Patrick Decat CLA 2013-06-21 11:50:43 EDT
Still an issue with eclipse 4.3RC4 (Build id: I20130605-2000).

YourKit reports a potential deadlock :

main <--- Frozen for at least 6m 45s
     org.eclipse.swt.internal.gtk.OS.Call(long, long, int, int)
     org.eclipse.swt.widgets.Display.sleep()
     org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(Display)
     org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.eventLoopIdle(Display)
     org.eclipse.ui.internal.Workbench$3.eventLoopIdle(Display)
     org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run()
     org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm, Runnable)
     org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(MApplicationElement, IEclipseContext)
     org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(MApplicationElement)
     org.eclipse.ui.internal.Workbench$5.run()
     org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm, Runnable)
     org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
     org.eclipse.ui.PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
     org.eclipse.ui.internal.ide.application.IDEApplication.start(IApplicationContext)
     org.eclipse.equinox.internal.app.EclipseAppHandle.run(Object)
     org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Object)
     org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Object)
     org.eclipse.core.runtime.adaptor.EclipseStarter.run(Object)
     org.eclipse.core.runtime.adaptor.EclipseStarter.run(String[], Runnable)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
     sun.reflect.NativeMethodAccessorImpl.invoke(Object, Object[])
     sun.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[])
     java.lang.reflect.Method.invoke(Object, Object[])
     org.eclipse.equinox.launcher.Main.invokeFramework(String[], URL[])
     org.eclipse.equinox.launcher.Main.basicRun(String[])
     org.eclipse.equinox.launcher.Main.run(String[])
     org.eclipse.equinox.launcher.Main.main(String[])
Comment 16 Patrick Decat CLA 2013-06-21 12:03:26 EDT
This is on an up to date Ubuntu 13.04 64bit.
 
$ uname -a
Linux gf213240 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 13.04 \n \l

Regards,
Patrick.
Comment 17 Patrick Decat CLA 2013-06-21 12:44:51 EDT
Or is it a false positive?
As this is inside an 'eventLoopIdle' method call, it may the expected behavior.

Anyway, eclipse 4.2/4.3 is slow on Ubuntu 13.04, the UI freezes for several seconds every now and then.

Regards,
Patrick.
Comment 18 Raul Contreras CLA 2014-08-23 04:08:08 EDT
It's happening to me with Eclipse Luna Version: 4.4.0 Build id: 20140612-0600 on Windows 7 Ultimate in the java editor only when hovering over problems, if I disable Preferences > Java > Editor > Hovers > Problem Description, hovering docs or source is quick.
Comment 19 Mandar Khire CLA 2014-08-27 09:12:26 EDT
Same problem occurs in Eclipse Kepler running in Centos.
In Kepler i use lots of plugins like team, findbug,hibernate,etc
linux version 2.6.18-274.18.1.el5.centos.plusPAE
following from .log in matadata:-
eclipse.buildId=4.3.2.M20140221-1700
java.version=1.7.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US

Eclipse hangs after every few minutes so by visualvm i try to understand whats going on.
I see 
org.eclipse.swt.internal.gtk.OS.call[native]
&
org.eclipse.swt.internal.gtk.OS._gtk_tree_model_get_path[native]
org.eclipse.swt.internal.gtk.OS._gtk_tree_store_set[native]
org.eclipse.swt.internal.gtk.OS._gtk_tree_model_get[native]
utilizing CPU self time in sampler.
So now i use Eclipse Luna without any plugin for just for compile & run my code.
i afraid to download any plugin in Luna due to cpu utilization.
Comment 20 Hannes Janetzek CLA 2014-10-05 22:53:59 EDT
For me eclipse 4.4 hangs occasionally on Ubuntu 14.04 with openjdk 1.7 when opening menus from the menubar. From visualvm it seems all cpu is used around this:

"main" prio=10 tid=0x00007f799000a800 nid=0x4627 runnable [0x00007f79991ba000]    java.lang.Thread.State: RUNNABLE 	at org.eclipse.swt.widgets.Display.asyncExec(Display.java:734) 	- locked <0x0000000601c8dae8> (a java.lang.Class for org.eclipse.swt.graphics.Device) 	at org.eclipse.ui.texteditor.AbstractTextEditor$ActivationListener.windowActivated(AbstractTextEditor.java:1006) 	at org.eclipse.ui.internal.Workbench$11.run(Workbench.java:1045) 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) 	at org.eclipse.ui.internal.Workbench.fireWindowActivated(Workbench.java:1042) 	at org.eclipse.ui.internal.WorkbenchWindow$14.shellActivated(WorkbenchWindow.java:2272) 	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:88) 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4486) 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388) 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1412) 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1393) 	at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:759) 	at org.eclipse.swt.widgets.Display.filterProc(Display.java:1586) 	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) 	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2473) 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3439) 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) 	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135) 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 	at java.lang.reflect.Method.invoke(Method.java:606) 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) 	at org.eclipse.equinox.launcher.Main.run(Main.java:1465) 	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 21 Hannes Janetzek CLA 2014-10-05 22:59:42 EDT
I should add that the menu does not become visible - only the dropshadows of the menu become visible. One can still click outside and close the menu but from then on eclipse is unresponsive.
Comment 22 Eric Williams CLA 2016-08-05 09:03:24 EDT
A hang like this in Shell.createHandle() would be visible all over SWT/Eclipse. I can't reproduce something like this using either Neon or some of the early 4.7 builds. Marking as closed, please re-open if the issue persists.

There were a lot of GTK3 fixes in Neon, please try the stable Neon release or a nightly build for 4.7 to see if the issue is still present.