Community
Participate
Working Groups
This is really the same as bug 178875, which is still not fixed. There is a period during workbench start up where the workbench is not yet able to honor its API contracts (specifically, until the Workbench.init() call has run to completion). The workbench must not invoke any asyncExecs until this has happened, since an asyncExec is allowed to use the workbench's public APIs which won't work at that time. For example, calling PlatformUI.getWorkbench().getAdapter(ICommandService.class) before initialization will throw an exception... and an exception during plugin activation will often prevent Eclipse from starting. Currently, the workbench seems to trigger these unsafe asyncExecs in two places: the event loop is pumped "for free" by the call to Display.setSynchronizer (bug 479435) and the second is around line 2955 of Workbench.java, which looks like this: while (true) { if (!display.readAndDispatch()) { if (initDone) break; display.sleep(); } } As long as this remains the case, the Workbench is likely to crash on startup any time a plugin runs an asyncExec in its plugin startup code. Note: there is no way to make syncExecs completely safe. If they're deferred until after startup, we risk deadlock. If they're not, we risk a crash to desktop. We can make asyncExec completely safe but should also make a best effort not to make syncExec any worse than it is now.
New Gerrit change created: https://git.eclipse.org/r/57891
Gerrit change https://git.eclipse.org/r/57891 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=0a0004d043ec213109226e793703783a29268b01
To help with triage: if you see a bug which reports a crash on startup due to a NoClassDefFoundError and a stack trace which contains either this: at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:xxxx) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:xxxx) ...or this: at org.eclipse.swt.widgets.Display.setSynchronizer(Display.java:xxxx) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:xxxx) ...then it is most likely a dupe of this bug.
*** Bug 471908 has been marked as a duplicate of this bug. ***
Possible dupe: bug 241927
*** Bug 241927 has been marked as a duplicate of this bug. ***
(In reply to Eclipse Genie from comment #2) > Gerrit change https://git.eclipse.org/r/57891 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=0a0004d043ec213109226e793703783a29268b01 I assume this closes this bug for platform UI. You have a separate bug for SWT. If not, please reopen.
The crashes won't go away until the SWT change goes in, too... so the bugs marked as duplicates won't really be fixed until bug 479435 is fixed.