Bug 2041 - POST-RELEASE: PAF: Workbench crash (1GDSB6Z)
Summary: POST-RELEASE: PAF: Workbench crash (1GDSB6Z)
Status: RESOLVED DUPLICATE of bug 2859
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 98
: P1 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 2147 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:25 EDT by DJ Houghton CLA
Modified: 2002-01-31 17:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2001-10-10 22:25:11 EDT
I commonly die a horrible death because of the following SWT error. (no more handles)
	This causes other programs (like Notes) to look weird when trying to draw icons, etc.
	In a common day I have to reboot my machine 3 or 4 times to "reclaim" all lost resources.

org.eclipse.swt.SWTError: No more handles
	at java.lang.Error.<init>(Error.java:52)
	at org.eclipse.swt.SWTError.<init>(SWTError.java:45)
	at org.eclipse.swt.SWTError.<init>(SWTError.java:34)
	at org.eclipse.swt.SWT.error(SWT.java:1798)
	at org.eclipse.swt.SWT.error(SWT.java:1707)
	at org.eclipse.swt.graphics.Image.init(Image.java(Compiled Code))
	at org.eclipse.swt.graphics.Image.<init>(Image.java(Compiled Code))
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:106)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:77)
	at org.eclipse.jface.action.ActionContributionItem$ImageCache.getImage(ActionContributionItem.java:90)
	at org.eclipse.jface.action.ActionContributionItem.updateImages(ActionContributionItem.java:586)
	at org.eclipse.jface.action.ActionContributionItem.update(ActionContributionItem.java:493)
	at org.eclipse.jface.action.ActionContributionItem.fill(ActionContributionItem.java:249)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:434)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:364)
	at org.eclipse.ui.internal.ShortcutMenu.updateMenu(ShortcutMenu.java:119)
	at org.eclipse.ui.internal.ShortcutMenu.pageActivated(ShortcutMenu.java:67)
	at org.eclipse.ui.internal.PageListenerList$1.run(PageListenerList.java:38)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:606)
	at org.eclipse.core.runtime.Platform.run(Platform.java:388)
	at org.eclipse.ui.internal.PageListenerList.firePageActivated(PageListenerList.java:36)
	at org.eclipse.ui.internal.WorkbenchWindow.firePageActivated(WorkbenchWindow.java:428)
	at org.eclipse.ui.internal.WorkbenchWindow.access$10(WorkbenchWindow.java:427)
	at org.eclipse.ui.internal.WorkbenchWindow$5.run(WorkbenchWindow.java:840)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:81)
	at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:827)
	at org.eclipse.ui.internal.SetPageAction.run(SetPageAction.java:41)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:406)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:360)
	at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:351)
	at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:45)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:643)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:610)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:850)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:280)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:67)
	at org.eclipse.core.launcher.Main.run(Main.java:299)
	at org.eclipse.core.launcher.UIMain.main(UIMain.java:43)

NOTES:

NE (06/11/01 10:01:27 AM)
	See 1GE8K2O: ITPUI:WIN98 - GDI usage stats for opening perspectives

ARCH (7/11/01 11:11:01 AM)
	Fix in 1.0

NE (07/19/01 2:31:16 PM)
	ImageDescriptor.createImage() is spec'ed to always return a new image, 
	so it can't return null, and can't return a shared image (i.e. the missing image).
	And it can't be changed to catch the out-of-handles SWTError and create a new missing image, 
	since it's out of handles.

	Only alternative is to change all cases to use ImageDescriptor.createImage(boolean), 
	and handle the null case and SWTError.
	
	SWTError states: SWTErrors should not occur in typical programs, although "high reliability" applications 
	should still catch them.
	Could change ImageDescriptor.createImage(boolean) to catch the SWTError for the out-of-handles condition
	(SWTError has a code), and have it return null.  So this would avoid the need for all users to catch it.

	Of course, it would be better not to run out of handles in the first place, but we can't control this in general.
	We can only minimize the number of images we create.


KH (8/1/2001 8:37:17 AM)
	Your proposal makes sense. Hold off making these changes until the SWT team fixes their part of this 
	problem. They are going to be releasing changes that significantly reduce the number of images that need
	to be created. 

NE (8/8/2001 3:19:49 PM)
	Try changing ActionContributionItem to not create extra images on Win98: disabled and hot image.
	Use the hot image as the regular one.
Comment 1 DJ Houghton CLA 2001-10-29 17:47:25 EST
PRODUCT VERSION:
	0.106 JRE on Win98

Comment 2 Nick Edgar CLA 2001-12-14 15:39:03 EST
*** Bug 2147 has been marked as a duplicate of this bug. ***
Comment 3 Nick Edgar CLA 2002-01-28 21:21:21 EST
Shouldn't this be throwing SWTException instead of SWTError?
Is it really a fatal SWT error if it can't allocate an image?

Eduardo, can you please investigate whether the exception can be handled 
better.
Comment 4 Mike Wilson CLA 2002-01-29 10:12:52 EST
Unfortunately, by the time you have run out of handles, your application is 
potentially in an unstable situation. For example, any o/s mechanisms which 
rely on painting images may fail in ways that *they* weren't expecting to deal 
with, causing GPs or similar.

Comment 5 Eduardo Pereira CLA 2002-01-31 17:13:42 EST

*** This bug has been marked as a duplicate of 2859 ***