Hi there, First of all: I'm sorry to bother you guys but I'm not familiar with the Xtext source so I probably need some advice.
While I was writing an Xcore model I noted that Eclipse (Eclipse DSL Tools, Version: Kepler Service Release 1, Build id: 20130919-0819) often ended up hanging, so I started my profiler and attached it to my instance. It immediately showed a potential deadlock situation which would explain my issue (the report has been attached to this mail). Having a look into the code XtextDocument$XtextDocumentLocker showed up that there are two mutex mechanisms used simultaneously (monitor based and read-write-lock-based). I suspect that this might be the root cause but I need to thoroughly investigate the source in order to confirm that. Is there anyone else having the same issue or at least someone who can share some insights why the dual mutex is needed ? If not I will try to setup an xtext environment in order to create a testcase when I find the time. Best regards Daniel Kasmeroglu
Frozen threads found (potential deadlock) It seems that the following threads have not changed their stack for more than 10 seconds. These threads are possibly (but not necessarily!) in a deadlock or hung. main <--- Frozen for at least 1m 48 sec org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.outline.impl.OutlineRefreshJob.iternalRefreshOutlineModel(OutlineTreeState, OutlineTreeState, IOutlineTreeProvider) org.eclipse.xtext.ui.editor.outline.impl.OutlineRefreshJob$1.run()<2 recursive calls> org.eclipse.xtext.ui.util.DisplayRunnableWithResult$1.run() org.eclipse.ui.internal.UILockListener.doPendingWork() org.eclipse.ui.internal.UILockListener.aboutToWait(Thread) org.eclipse.core.internal.jobs.LockManager.aboutToWait(Thread) org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob, IProgressMonitor, InternalJob, Thread) org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob, IProgressMonitor) org.eclipse.core.internal.jobs.ImplicitJobs.begin(ISchedulingRule, IProgressMonitor, boolean) org.eclipse.core.internal.jobs.JobManager.beginRule(ISchedulingRule, IProgressMonitor) org.eclipse.core.internal.resources.WorkManager.checkIn(ISchedulingRule, IProgressMonitor) org.eclipse.core.internal.resources.Workspace.prepareOperation(ISchedulingRule, IProgressMonitor) org.eclipse.core.internal.resources.Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) org.eclipse.ui.actions.WorkspaceModifyOperation.run(IProgressMonitor) org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(IRunnableWithProgress, ISchedulingRule) org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(boolean, boolean, IRunnableWithProgress) org.eclipse.ui.texteditor.AbstractDocumentProvider.executeOperation(AbstractDocumentProvider$DocumentProviderOperation, IProgressMonitor) org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument(IProgressMonitor, Object, IDocument, boolean) org.eclipse.ui.texteditor.AbstractTextEditor.performSave(boolean, IProgressMonitor) org.eclipse.ui.texteditor.AbstractTextEditor.doSave(IProgressMonitor) org.eclipse.xtext.ui.editor.XtextEditor.doSave(IProgressMonitor) org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(IProgressMonitor) org.eclipse.ui.Saveable.doSave(IProgressMonitor, IShellProvider) org.eclipse.ui.internal.SaveableHelper.doSaveModel(Saveable, IProgressMonitor, IShellProvider, boolean) org.eclipse.ui.internal.SaveableHelper$3.run(IProgressMonitor) org.eclipse.ui.internal.SaveableHelper$5.run(IProgressMonitor) org.eclipse.jface.operation.ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) org.eclipse.jface.operation.ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) org.eclipse.ui.internal.WorkbenchWindow$13.run() org.eclipse.swt.custom.BusyIndicator.showWhile(Display, Runnable) org.eclipse.ui.internal.WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress, IRunnableContext, IShellProvider) org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress, IWorkbenchWindow) org.eclipse.ui.internal.SaveableHelper.saveModels(ISaveablesSource, IWorkbenchWindow, boolean) org.eclipse.ui.internal.SaveableHelper.savePart(ISaveablePart, IWorkbenchPart, IWorkbenchWindow, boolean) org.eclipse.ui.internal.WorkbenchPage.saveSaveable(ISaveablePart, IWorkbenchPart, boolean, boolean) org.eclipse.ui.internal.WorkbenchPage.saveEditor(IEditorPart, boolean) org.eclipse.ui.internal.handlers.SaveHandler.execute(ExecutionEvent) org.eclipse.ui.internal.handlers.HandlerProxy.execute(ExecutionEvent) org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(IEclipseContext, Map, Event, IEvaluationContext) sun.reflect.GeneratedMethodAccessor115.invoke(Object, Object[]) sun.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[]) java.lang.reflect.Method.invoke(Object, Object[]) org.eclipse.e4.core.internal.di.MethodRequestor.execute() org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(Object, Class, Class, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean) org.eclipse.e4.core.internal.di.InjectorImpl.invoke(Object, Class, Object, PrimaryObjectSupplier, PrimaryObjectSupplier) org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(Object, Class, IEclipseContext, IEclipseContext, Object) org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(ExecutionEvent) org.eclipse.core.commands.Command.executeWithChecks(ExecutionEvent) org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(Object, Object) org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(ParameterizedCommand, IEclipseContext) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(ParameterizedCommand, Event) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(List, Event) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(List, Event) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(Event) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher, Event) org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(Event) org.eclipse.swt.widgets.EventTable.sendEvent(Event) org.eclipse.swt.widgets.Display.filterEvent(Event) org.eclipse.swt.widgets.Widget.sendEvent(Event) org.eclipse.swt.widgets.Widget.sendEvent(int, Event, boolean) org.eclipse.swt.widgets.Widget.sendEvent(int, Event) org.eclipse.swt.widgets.Widget.sendKeyEvent(int, int, long, long, Event) org.eclipse.swt.widgets.Widget.sendKeyEvent(int, int, long, long) org.eclipse.swt.widgets.Widget.wmChar(long, long, long) org.eclipse.swt.widgets.Control.WM_CHAR(long, long) org.eclipse.swt.widgets.Canvas.WM_CHAR(long, long) org.eclipse.swt.widgets.Control.windowProc(long, int, long, long) org.eclipse.swt.widgets.Canvas.windowProc(long, int, long, long) org.eclipse.swt.widgets.Display.windowProc(long, long, long, long) org.eclipse.swt.internal.win32.OS.DispatchMessageW(MSG) org.eclipse.swt.internal.win32.OS.DispatchMessage(MSG) org.eclipse.swt.widgets.Display.readAndDispatch() 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[]) Worker-11 <--- Frozen for at least 1m 43 sec org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(IProgressMonitor) org.eclipse.xtext.ui.editor.validation.ValidationJob.run(IProgressMonitor) org.eclipse.core.internal.jobs.Worker.run() Worker-14 <--- Frozen for at least 1m 46 sec org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(IUnitOfWork) org.eclipse.xtext.ui.editor.DirtyStateEditorSupport$UpdateEditorStateJob.run(IProgressMonitor) org.eclipse.core.internal.jobs.Worker.run() Worker-6 <--- Frozen for at least 1m 55 sec org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(IUnitOfWork) org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(IUnitOfWork) org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(IProgressMonitor) org.eclipse.core.internal.jobs.Worker.run()
_______________________________________________ xtext-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/xtext-dev
