Community
Participate
Working Groups
With 3.2M6: My plug-in starts normally on moderate data sets and extensive debug, but hangs on a larger data set. Suspending manually reveals Thread [main] (Suspended) Object.wait(long) line: not available [native method] ArrayList<E>(Object).wait() line: 474 IOConsolePartitioner.streamAppended(IOConsoleOutputStream, String) line: 467 MessageConsoleStream(IOConsoleOutputStream).notifyParitioner(String) line: 238 MessageConsoleStream(IOConsoleOutputStream).encodedWrite(String) line: 233 MessageConsoleStream(IOConsoleOutputStream).write(String) line: 218 MessageConsoleStream.print(String) line: 49 MessageConsoleStream.println(String) line: 74 OutputStreamRedirector.println(String) line: 30 UmlxPlugin.debugPrintln(String) line: 70 E2AssociationImpl$E2AssociationListener(AbstractAdapter).notifyChanged(Notification) line: 197 E2AssociationImpl$E2AssociationListener.notifyChanged(Notification) line: 688 E2AssociationImpl(BasicNotifierImpl).eNotify(Notification) line: 230 ENotificationImpl(NotificationImpl).dispatch() line: 931 E2AssociationImpl.setForward(E2DirectedAssociation) line: 232 E2AssociationImpl.getForward() line: 195 E2AssociationImpl.getFrom(EReference) line: 375 Ecore2Utils.getDirectedAssociation(EReference, boolean) line: 95 EClassOutline.createChild(Object) line: 47 EClassOutline(AbstractEditPart).refreshChildren() line: 726 EClassOutline(NotifierOutline<M>).doRefreshChildren() line: 83 OutlineRefresher$2.refresh() line: 109 SharedCommandStack.refresh() line: 216 SharedCommandStack.execute(Runnable) line: 117 ActiveEditDomain(AbstractEditDomain).execute(Runnable) line: 70 OutlinePage.createControl(Composite) line: 101 ContentOutline.doCreatePage(IWorkbenchPart) line: 134 ContentOutline(PageBookView).createPage(IWorkbenchPart) line: 399 ContentOutline(PageBookView).partActivated(IWorkbenchPart) line: 743 ContentOutline.partBroughtToTop(IWorkbenchPart) line: 209 PartListenerList$2.run() line: 87 SafeRunner.run(ISafeRunnable) line: 37 Platform.run(ISafeRunnable) line: 816 PartListenerList.fireEvent(SafeRunnable, IPartListener, IWorkbenchPart, String) line: 57 PartListenerList.firePartBroughtToTop(IWorkbenchPart) line: 85 PartService.firePartBroughtToTop(IWorkbenchPartReference) line: 87 WorkbenchPagePartList.firePartBroughtToTop(IWorkbenchPartReference) line: 75 WorkbenchPagePartList.fireActiveEditorChanged(IWorkbenchPartReference) line: 51 WorkbenchPagePartList(PartList).setActiveEditor(IEditorReference) line: 152 WorkbenchPage.makeActiveEditor(IEditorReference) line: 1178 WorkbenchPage.updateActivePart() line: 1123 WorkbenchPage.partAdded(WorkbenchPartReference) line: 1480 EditorAreaHelper.addEditor(EditorReference, String) line: 210 EditorManager.createEditorTab(EditorReference, String) line: 819 EditorManager.openEditorFromDescriptor(EditorDescriptor, IEditorInput) line: 718 EditorManager.openEditor(String, IEditorInput, boolean) line: 679 WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean, int) line: 2501 WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int) line: 2436 WorkbenchPage.access$10(WorkbenchPage, IEditorInput, String, boolean, int) line: 2428 WorkbenchPage$9.run() line: 2413 BusyIndicator.showWhile(Display, Runnable) line: 69 WorkbenchPage.openEditor(IEditorInput, String, boolean, int) line: 2408 WorkbenchPage.openEditor(IEditorInput, String, boolean) line: 2393 IDE.openEditor(IWorkbenchPage, IFile, boolean, boolean) line: 388 IDE.openEditor(IWorkbenchPage, IFile, boolean) line: 350 EditorUtility.openInEditor(IFile, boolean) line: 275 EditorUtility.openInEditor(Object, boolean) line: 139 OpenActionUtil.open(Object, boolean) line: 49 OpenAction.run(Object[]) line: 181 OpenAction.run(IStructuredSelection) line: 165 OpenAction(SelectionDispatchAction).dispatchRun(ISelection) line: 267 OpenAction(SelectionDispatchAction).run() line: 243 PackageExplorerActionGroup.handleOpen(OpenEvent) line: 296 PackageExplorerPart$4.open(OpenEvent) line: 648 StructuredViewer$2.run() line: 810 SafeRunner.run(ISafeRunnable) line: 37 Platform.run(ISafeRunnable) line: 816 JFaceUtil$1.run(ISafeRunnable) line: 44 SafeRunnable.run(ISafeRunnable) line: 149 PackageExplorerPart$PackageExplorerProblemTreeViewer(StructuredViewer).fireOpen(OpenEvent) line: 808 PackageExplorerPart$PackageExplorerProblemTreeViewer(StructuredViewer).handleOpen(SelectionEvent) line: 1040 StructuredViewer$6.handleOpen(SelectionEvent) line: 1139 OpenStrategy.fireOpenEvent(SelectionEvent) line: 249 OpenStrategy.access$2(OpenStrategy, SelectionEvent) line: 243 OpenStrategy$1.handleEvent(Event) line: 283 EventTable.sendEvent(Event) line: 66 Tree(Widget).sendEvent(Event) line: 925 Display.runDeferredEvents() line: 3346 Display.readAndDispatch() line: 2966 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1914 Workbench.runUI() line: 1878 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 419 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143 IDEApplication.run(Object) line: 95 PlatformActivator$1.run(Object) line: 78 EclipseAppLauncher.runApplication(Object) line: 92 EclipseAppLauncher.start(Object) line: 68 EclipseStarter.run(Object) line: 376 EclipseStarter.run(String[], Runnable) line: 169 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 585 Main.invokeFramework(String[], URL[]) line: 336 Main.basicRun(String[]) line: 280 Main.run(String[]) line: 977 Main.main(String[]) line: 952 and that IOConsolePartitioner.fBuffer is 160007, a single partitions, and a single pendingPartitions. This appears to be on an unusual program control path. Has it been tested?
This is a known problem. The workaround is to not use the UI thread when writing to the console. Instead of scheduling a UIJob, we should just update the document if the write is done in the UI thread.
It's all going wrong in the platform code so how do I use the workaround?
The workaround is to not call any IOConsoleOutputStream.write() in a UI Thread. From the trace it looks like a non-sdk plugin is doing this to you (UmlxPlugin.debugPrintln). Your best bet may be to file a bug against the provider of that plugin.
As the author of UmlxPlugin, I can file a bug report against myself... The code is just: public static void debugPrintln(String message) { System.out.println(message); } I'm not sure how I change this to use a non-UI thread print mechanism, since it's not obviously using the UI thread at present.
The trace you attached shows that your code is calling MessageConsoleStream in the UI (main) thread. One potential workaround is something like: public static void debugPrintln(String message) { Job job = new Job("Console Write Job") { public IStatus run(IProgressMonitor monitor) { if (!monitor.isCancelled()) System.out.println(message); return Status.OK_STATUS; } } job.setSystem(true); job.schedule(); }
Can't call in the UI thread. Marking as dup, updated javadoc. *** This bug has been marked as a duplicate of bug 136943 ***