Bug 197691 - Platform.endSplash crash
Summary: Platform.endSplash crash
Status: RESOLVED DUPLICATE of bug 188091
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-24 15:18 EDT by dev2null CLA
Modified: 2007-07-25 09:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dev2null CLA 2007-07-24 15:18:53 EDT
If Platform.endSplash() is called in the IApplication.start() method before the workbench is created a SWT No more handles exception may be thrown during Workbench instantiation and startup.

The Javadoc for org.eclipse.core.runtime.Platform states that: "A runtime 
 * exception might be thrown or incorrect result might be returned if a method 
 * from this class is called while Platform is not running.". 
 
 I therefore added a call to Platform.isRunning() to check if the platform was running. The result was true.
 
 The call to Platform.endSplash() brings down the splash screen as expected but  PlatformUI.createAndRunWorkbench() results in a crash . The code for he IApplication.start() method:
 
	public Object start(IApplicationContext context) {
		Display display = PlatformUI.createDisplay();
		try {
			boolean isRunning = Platform.isRunning();
			Platform.endSplash();
			MessageDialog.openInformation(null, "Hello",
					"Platform isRunning is " + isRunning);

			int returnCode = PlatformUI.createAndRunWorkbench(display,
					new ApplicationWorkbenchAdvisor());
			if (returnCode == PlatformUI.RETURN_RESTART) {
				return IApplication.EXIT_RESTART;
			}
			return IApplication.EXIT_OK;
		} finally {
			display.dispose();
		}
	}
	
The .log file:

!SESSION 2007-07-24 21:15:33.531 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=sv_SE
Framework arguments:  -product com.example.rcpapp.product
Command-line arguments:  -product com.example.rcpapp.product -data D:\projects\eclipse-rcp-ws/../runtime-com.example.rcpapp.product -dev file:D:/projects/eclipse-rcp-ws/.metadata/.plugins/org.eclipse.pde.core/com.example.rcpapp.product/dev.properties -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.osgi 4 0 2007-07-24 21:15:35.765
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles
	at org.eclipse.swt.SWT.error(SWT.java:3589)
	at org.eclipse.swt.SWT.error(SWT.java:3481)
	at org.eclipse.swt.SWT.error(SWT.java:3452)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
	at org.eclipse.swt.widgets.Control.createHandle(Control.java:602)
	at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:235)
	at org.eclipse.swt.widgets.Control.createWidget(Control.java:618)
	at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:131)
	at org.eclipse.swt.widgets.Control.<init>(Control.java:97)
	at org.eclipse.swt.widgets.Scrollable.<init>(Scrollable.java:72)
	at org.eclipse.swt.widgets.Composite.<init>(Composite.java:93)
	at org.eclipse.ui.splash.BasicSplashHandler.getBundleProgressMonitor(BasicSplashHandler.java:159)
	at org.eclipse.ui.splash.BasicSplashHandler.getContent(BasicSplashHandler.java:265)
	at org.eclipse.ui.internal.splash.EclipseSplashHandler.init(EclipseSplashHandler.java:84)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:595)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.createSplashWrapper(Workbench.java:611)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2248)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.example.rcpapp.intro.Application.start(Application.java:29)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1144)

	
The
Comment 1 Andrew Niefer CLA 2007-07-24 15:38:01 EDT
Please try today's build I2007240800 or tomorrows 3.3.1 build

*** This bug has been marked as a duplicate of bug 188091 ***
Comment 2 dev2null CLA 2007-07-25 03:40:57 EDT
Thanks! I've verified the fix on 3.4 I20070724-0800 but I'm targeting 3.3.x. When is 3.3.1 planned to be released?
Comment 3 Thomas Watson CLA 2007-07-25 09:11:19 EDT
The first point release is usually about 3 months after the major release.  3.3.0 was released June 29 so 3.3.1 should be released near the end of September.