Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366189

Summary: UI Freeze in "Configure Git Repository" Dialog
Product: [Technology] EGit Reporter: Marcel Bruch <marcel.bruch>
Component: UIAssignee: Project Inbox <egit.ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jens.baumgart, markus.kell.r, matthias.sohn
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
The dialog window - not much to see. Used to explain the where exactly the freeze happend. none

Description Marcel Bruch CLA 2011-12-09 09:23:56 EST
Created attachment 208163 [details]
The dialog window - not much to see. Used to explain the where exactly the freeze happend.

I reshared an existing project with egit. In "Configure Git Repository" Dialog, the ui freezed after some click and is not returning for 5 minutes now.

 It's hard to provide more data. Thus,  I just add the jstack dump - hoping that you can find the cause.

Used version of EGit:
Eclipse EGit	1.1.0.201109151100-r	org.eclipse.egit.feature.group	Eclipse EGit



---
$ jstack 4188
2011-12-09 15:13:08
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.4-b02-402 mixed mode):



"Worker-153" prio=5 tid=12179d800 nid=0x120dc1000 in Object.wait() [120dc0000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <7dd07e3d8> (a org.eclipse.ui.internal.Semaphore)
	at org.eclipse.ui.internal.Semaphore.acquire(Semaphore.java:43)
	- locked <7dd07e3d8> (a org.eclipse.ui.internal.Semaphore)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:168)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4613)
	at org.eclipse.egit.ui.Activator.isActive(Activator.java:220)
	at org.eclipse.egit.ui.Activator$RepositoryChangeScanner.run(Activator.java:429)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



"main" prio=6 tid=114000800 nid=0x7fff701efcc0 runnable [7fff5fbfb000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1092)
	at org.eclipse.swt.widgets.Tree.mouseDownSuper(Tree.java:2052)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1084)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2519)
	at org.eclipse.swt.widgets.Tree.mouseDown(Tree.java:2007)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5471)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2252)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5535)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4989)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5138)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard.openWizard(ConfigureProjectWizard.java:224)
	at org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard.shareProjects(ConfigureProjectWizard.java:124)
	at org.eclipse.team.internal.ui.actions.ConfigureProjectAction$1.run(ConfigureProjectAction.java:39)
	at org.eclipse.team.internal.ui.actions.TeamAction$3.run(TeamAction.java:266)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.team.internal.ui.actions.TeamAction.run(TeamAction.java:263)
	at org.eclipse.team.internal.ui.actions.ConfigureProjectAction.execute(ConfigureProjectAction.java:33)
	at org.eclipse.team.internal.ui.actions.TeamAction.run(TeamAction.java:515)
	at org.eclipse.team.internal.ui.actions.TeamAction.runWithEvent(TeamAction.java:549)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
	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)
Comment 1 Jens Baumgart CLA 2011-12-20 11:31:08 EST
I can't see a freeze here in the main thread.
Can you reproduce the problem? If yes, does it help to increase heap / perm size?
Comment 2 Marcel Bruch CLA 2011-12-21 02:19:43 EST
(In reply to comment #1)

> Can you reproduce the problem? If yes, does it help to increase heap / perm
> size?
It's not one of my daily operations. I'll add more info when I experiencing it again.

> I can't see a freeze here in the main thread.

I've no detailed understanding of your code, but at least I want to try explaining what I 'believe' to see (ignore if it's dumb).

There is an operation ConfigureProjectWizard.openWizard that runs in the UI thread.
This operation locks the Display so that no other thread can execute an UI operation.

Activator.isActive makes a syncExec call to Display and get's blocked by the operation in ConfigureProjectWizard (here in this case). 
The Activator.IsActive method is called by a Activator$RepositoryChangeScanner.run (executed in some other thread) that somehow got scheduled (by whomever). Since ConfigureOperationWizard.openWizard seems to wait for something from within the UI thread (line openWizard:224 opens a new window) this seems to become a deadlock.

So, I 'think' I can see a deadlock. My question would be: (i) what is the new window created in openWizard waiting for? (ii) why did it cause a lock with a RepositoryChangeScanner.

But again, just my 2 cents. I'm not a concurrency expert and might be totally wrong.
Comment 3 Markus Keller CLA 2012-05-21 07:13:25 EDT
I don't think ConfigureProjectWizard.openWizard is to blame here. It's Display.readAndDispatch that seems to block the UI thread, see bug 344818.
Comment 4 Matthias Sohn CLA 2014-12-17 19:31:50 EST
here EGit isn't involved in main thread hence closing this old bug report