Project: Eclipse_Platform_UI
Bug 173442 [WorkbenchLauncher] SWTException: Invalid thread access when launching workspace with >1 window
Reported: 2007-02-08 09:11:11 | Status: verified fixed

I20070208-0010. If a target Eclipse is launched from Eclipse itself then a SWTException: 'Invalid thread access' happens if that target has more than one window. The second window's layout is destroyed and all other windows (3..n) are not opened. I'm marking this as critical since it currently stops me from testing a fix that invokes two windows being open on restart and because I don't know whether this problem might also appear during start of the very first Eclipse instance. TEST CASE: 1. start fresh workspace 2. Run > Run As > Eclipse Application 3. in the target: Window > New Window 4. repeat step 3 several times (just see those being lost later) 5. in the target: File > Exit 6. Run > Run As > Eclipse Application ==> Error dialog (see attached picture) and .log entry: eclipse.buildId=I20070208-0010 java.version=1.5.0_10 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH Framework arguments: -launcher C:\eclipse\drops\I20070208-0010\eclipse -name Eclipse 600 -product org.eclipse.sdk.ide -pdelaunch Command-line arguments: -launcher C:\eclipse\drops\I20070208-0010\eclipse -name Eclipse 600 -product org.eclipse.sdk.ide -data C:\eclipse\workspaces\tmp/../runtime-EclipseApplication -dev file:C:/eclipse/workspaces/tmp/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -pdelaunch -os win32 -ws win32 -arch x86 Error Thu Feb 08 14:59:27 CET 2007 Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:3478) at org.eclipse.swt.SWT.error(SWT.java:3401) at org.eclipse.swt.SWT.error(SWT.java:3372) at org.eclipse.swt.widgets.Widget.error(Widget.java:432) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:326) at org.eclipse.swt.widgets.Widget.getStyle(Widget.java:598) at org.eclipse.jface.action.ActionContributionItem.isDynamic(ActionContributionItem.java:603) at org.eclipse.jface.action.ContributionItem.isDirty(ContributionItem.java:128) at org.eclipse.jface.action.SubContributionItem.isDirty(SubContributionItem.java:107) at org.eclipse.jface.action.ContributionManager.isDirty(ContributionManager.java:364) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:598) at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:765) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:707) at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:765) at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars(WorkbenchWindow.java:2860) at org.eclipse.ui.internal.WorkbenchWindow.largeUpdateEnd(WorkbenchWindow.java:2910) at org.eclipse.ui.internal.Workbench.largeUpdateEnd(Workbench.java:3069) at org.eclipse.ui.internal.WorkbenchWindow.fillActionBars(WorkbenchWindow.java:3196) at org.eclipse.ui.internal.WorkbenchWindow.<init>(WorkbenchWindow.java:352) at org.eclipse.ui.internal.Workbench.newWorkbenchWindow(Workbench.java:1622) at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:3184) at org.eclipse.ui.internal.Workbench.access$32(Workbench.java:3155) at org.eclipse.ui.internal.Workbench$47.run(Workbench.java:1996) at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1711) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1994) at org.eclipse.ui.internal.Workbench.access$30(Workbench.java:1965) at org.eclipse.ui.internal.Workbench$42.run(Workbench.java:1823) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1767) at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:751) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1289) at org.eclipse.ui.internal.Workbench.access$33(Workbench.java:1234) at org.eclipse.ui.internal.Workbench$51.run(Workbench.java:2183)

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