Project: Eclipse_Platform_UI
Bug 41925 dead lock when organizing imports
Reported: 2003-08-25 11:46:54 | Status: resolved fixed

i20030820 This seems to be always reproducible (regardless the VM in use): when doing a massive organize imports operation on a project, if you try to cancel it, a dead lock will occur. Steps: 1 - select a Java project in the Project Explorer 2 - press Ctrl-Shift-O (Organize imports) 3 - when the progress dialog appears, press the cancel button. Eclipse will freeze (no CPU activity). Stack trace dump: Stack Traces of Threads: ThreadName=main(00034F44) Status=Waiting Monitor=01805B38 (Object monitor for org/eclipse/core/internal/jobs/ImplicitJobs $ThreadJob @ 013840F0) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait()V In org/eclipse/core/internal/jobs/ImplicitJobs$ThreadJob.joinRun()V In org/eclipse/core/internal/jobs/ImplicitJobs.begin(Lorg/eclipse/core/r untime/jobs/ISchedulingRule;)V In org/eclipse/core/internal/jobs/JobManager.beginRule(Lorg/eclipse/core /runtime/jobs/ISchedulingRule;)V In org/eclipse/core/internal/resources/WorkManager.checkIn(Lorg/eclipse/ core/runtime/jobs/ISchedulingRule;)V In org/eclipse/core/internal/resources/Workspace.prepareOperation(Lorg/e clipse/core/runtime/jobs/ISchedulingRule;)V In org/eclipse/core/internal/resources/Workspace.run(Lorg/eclipse/core/r esources/IWorkspaceRunnable;Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/ eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/core/internal/resources/Workspace.run(Lorg/eclipse/core/r esources/IWorkspaceRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/corext/textmanipulation/TextBufferFactory.co mmitChanges(Lorg/eclipse/jdt/internal/corext/textmanipulation/TextBuffer;ZLorg/e clipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/corext/textmanipulation/TextBuffer.commitCha nges(Lorg/eclipse/jdt/internal/corext/textmanipulation/TextBuffer;ZLorg/eclipse/ core/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/corext/codemanipulation/ImportsStructure.cre ate(ZLorg/eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/corext/codemanipulation/OrganizeImportsOpera tion.run(Lorg/eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction$3.run()V In org/eclipse/ui/internal/UILockListener.doPendingWork()V In org/eclipse/ui/internal/UISynchronizer$1.run()V In org/eclipse/swt/widgets/RunnableLock.run()V In org/eclipse/swt/widgets/Synchronizer.runAsyncMessages()Z In org/eclipse/swt/widgets/Display.runAsyncMessages()Z In org/eclipse/swt/widgets/Display.readAndDispatch()Z In org/eclipse/jface/operation/ModalContext$ModalContextThread.block()V In org/eclipse/jface/operation/ModalContext.run(Lorg/eclipse/jface/opera tion/IRunnableWithProgress;ZLorg/eclipse/core/runtime/IProgressMonitor;Lorg/ecli pse/swt/widgets/Display;)V In org/eclipse/jface/dialogs/ProgressMonitorDialog.run(ZZLorg/eclipse/jf ace/operation/IRunnableWithProgress;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction.runOnMultiple([Lorg/ eclipse/jdt/core/ICompilationUnit;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction.run(Lorg/eclipse/jfa ce/viewers/IStructuredSelection;)V In org/eclipse/jdt/ui/actions/SelectionDispatchAction.dispatchRun(Lorg/e clipse/jface/viewers/ISelection;)V In org/eclipse/jdt/ui/actions/SelectionDispatchAction.run()V In org/eclipse/jface/action/Action.runWithEvent(Lorg/eclipse/swt/widgets /Event;)V In org/eclipse/ui/actions/RetargetAction.runWithEvent(Lorg/eclipse/swt/w idgets/Event;)V In org/eclipse/ui/internal/WWinPluginAction.runWithEvent(Lorg/eclipse/sw t/widgets/Event;)V In org/eclipse/jface/action/ActionContributionItem.handleWidgetSelection (Lorg/eclipse/swt/widgets/Event;Z)V In org/eclipse/jface/action/ActionContributionItem.access$4(Lorg/eclipse /jface/action/ActionContributionItem;Lorg/eclipse/swt/widgets/Event;Z)V In org/eclipse/jface/action/ActionContributionItem$6.handleEvent(Lorg/ec lipse/swt/widgets/Event;)V In org/eclipse/swt/widgets/EventTable.sendEvent(Lorg/eclipse/swt/widgets /Event;)V In org/eclipse/swt/widgets/Widget.sendEvent(Lorg/eclipse/swt/widgets/Eve nt;)V In org/eclipse/swt/widgets/Display.runDeferredEvents()Z In org/eclipse/swt/widgets/Display.readAndDispatch()Z In org/eclipse/ui/internal/Workbench.runEventLoop(Lorg/eclipse/jface/win dow/Window$IExceptionHandler;)V In org/eclipse/ui/internal/Workbench.run(Ljava/lang/Object;)Ljava/lang/O bject; In org/eclipse/core/internal/boot/InternalBootLoader.run(Ljava/lang/Stri ng;Ljava/net/URL;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/Runnable;)Ljava /lang/Object; In org/eclipse/core/boot/BootLoader.run(Ljava/lang/String;Ljava/net/URL; Ljava/lang/String;[Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object; In java/lang/reflect/AccessibleObject.invokeL(Ljava/lang/Object;[Ljava/l ang/Object;)Ljava/lang/Object; In java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object; )Ljava/lang/Object; In org/eclipse/core/launcher/Main.basicRun([Ljava/lang/String;)Ljava/lan g/Object; In org/eclipse/core/launcher/Main.run([Ljava/lang/String;)Ljava/lang/Obj ect; In org/eclipse/core/launcher/Main.main([Ljava/lang/String;)V ThreadName=Gc Thread(00035094) Status=Waiting Monitor=00034550 (System monitor) Count=0 Owner=(00000000) ThreadName=Finalizer thread(000350E8) Status=Waiting Monitor=00034B50 (System monitor) Count=0 Owner=(00000000) ThreadName=Java indexing(0003513C) Status=Waiting Monitor=01805238 (Object monitor for org/eclipse/jdt/internal/core/search/indexi ng/IndexManager @ 00FDF5EC) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait()V In org/eclipse/jdt/internal/core/search/processing/JobManager.run()V In java/lang/Thread.run()V ThreadName=org.eclipse.jdt.internal.ui.text.JavaReconciler(00035238) Status=Waiting Monitor=01805568 (System monitor) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/jface/text/reconciler/AbstractReconciler$BackgroundThread .run()V ThreadName=org.eclipse.jdt.internal.ui.text.JavaReconciler(000352E0) Status=Waiting Monitor=01805958 (System monitor) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/jface/text/reconciler/AbstractReconciler$BackgroundThread .run()V ThreadName=org.eclipse.jdt.internal.ui.text.JavaReconciler(0003528C) Status=Waiting Monitor=01805658 (System monitor) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/jface/text/reconciler/AbstractReconciler$BackgroundThread .run()V ThreadName=org.eclipse.jdt.internal.ui.text.JavaReconciler(000355D4) Status=Waiting Monitor=01805AA8 (System monitor) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/jface/text/reconciler/AbstractReconciler$BackgroundThread .run()V ThreadName=Worker-20(00035430) Status=Waiting Monitor=018054A8 (Object monitor for org/eclipse/core/internal/jobs/WorkerPool @ 009280D8) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/core/internal/jobs/WorkerPool.sleep(J)V In org/eclipse/core/internal/jobs/WorkerPool.startJob()Lorg/eclipse/core /runtime/jobs/Job; In org/eclipse/core/internal/jobs/Worker.run()V ThreadName=ModalContext(00035388) Status=Waiting Monitor=01805BF8 (Object monitor for org/eclipse/ui/internal/Semaphore @ 012C01E 4) Count=0 Owner=(00000000) In java/lang/Object.wait(JI)V In java/lang/Object.wait(J)V In org/eclipse/ui/internal/Semaphore.acquire(J)Z In org/eclipse/ui/internal/UISynchronizer.syncExec(Ljava/lang/Runnable;) V In org/eclipse/swt/widgets/Display.syncExec(Ljava/lang/Runnable;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction.runInSync(Lorg/eclip se/jdt/internal/corext/codemanipulation/OrganizeImportsOperation;Ljava/lang/Stri ng;Lorg/eclipse/core/runtime/MultiStatus;Lorg/eclipse/core/runtime/IProgressMoni tor;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction.doRunOnMultiple([Lor g/eclipse/jdt/core/ICompilationUnit;Lorg/eclipse/core/runtime/MultiStatus;Lorg/e clipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/ui/actions/OrganizeImportsAction.access$0(Lorg/eclips e/jdt/ui/actions/OrganizeImportsAction;[Lorg/eclipse/jdt/core/ICompilationUnit;L org/eclipse/core/runtime/MultiStatus;Lorg/eclipse/core/runtime/IProgressMonitor; )V In org/eclipse/jdt/ui/actions/OrganizeImportsAction$1.run(Lorg/eclipse/c ore/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/core/BatchOperation.executeOperation()V In org/eclipse/jdt/internal/core/JavaModelOperation.execute()V In org/eclipse/jdt/internal/core/JavaModelOperation.run(Lorg/eclipse/cor e/runtime/IProgressMonitor;)V In org/eclipse/core/internal/resources/Workspace.run(Lorg/eclipse/core/r esources/IWorkspaceRunnable;Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/ eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/core/internal/resources/Workspace.run(Lorg/eclipse/core/r esources/IWorkspaceRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/core/JavaCore.run(Lorg/eclipse/core/resources/IWorksp aceRunnable;Lorg/eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jdt/internal/ui/actions/WorkbenchRunnableAdapter.run(Lorg /eclipse/core/runtime/IProgressMonitor;)V In org/eclipse/jface/operation/ModalContext$ModalContextThread.run()V

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/UILockListener.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/progress/UIJob.java