Bug 2168 - [OLE] Core dump when opening .html file in composer (1GEY95R)
Summary: [OLE] Core dump when opening .html file in composer (1GEY95R)
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:27 EDT by Kevin Haaland CLA
Modified: 2002-09-05 14:43 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 Kevin Haaland CLA 2001-10-10 22:27:49 EDT
TM (6/7/2001 14:05:54)
	SDK 119

	1) I opened the file <org.eclipse.jdt.launching/doc/org_eclipse_jdt_launching.html> via a double click in the packages view
	2) Netscape 4.75 opens as an inplace editor
	3) There is a link (to a non-existing file) in there. Hovering over this link,  I selected "open link in composer"
	4) observe: an error dialog box pops up saying:

		Title: "cvs over ssh - one project locks the workbench: netscape.exe - Application Error"

		Msg: "The instruction at "..." referenced memory at "...". The memory could not be "read".

		When I clicked ok, netscape was terminated and I ended up with a blank editor tab.

	Follow up: I double clicked the html file again and got an error dialog box: "an error occurred when
					 opening this editor" and the workbench died.
					 The log showed:

Log: Thu Jun 07 14:09:53 GMT+02:00 2001
2 org.eclipse.ui 2 Problems occurred when invoking code from plug-in: org.eclipse.ui.
java.lang.NegativeArraySizeException
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java(Compiled Code))
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java(Compiled Code))
	at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:515)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java(Compiled Code))
	at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:515)
	at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars(WorkbenchWindow.java:1025)
	at org.eclipse.ui.internal.WorkbenchPage.updateActionBars(WorkbenchPage.java:1464)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:1333)
	at org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:1152)
	at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:239)
	at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:191)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:3205)
	at org.eclipse.swt.widgets.Tree.WM_SETFOCUS(Tree.java:1269)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code))
	at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:474)
	at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations.java:465)
	at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:889)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code))
	at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
	at org.eclipse.swt.internal.ole.win32.IOleObject.DoVerb(IOleObject.java:21)
	at org.eclipse.swt.ole.win32.OleClientSite.doVerb(OleClientSite.java:536)
	at org.eclipse.ui.internal.editorsupport.OleEditor.setFocus(OleEditor.java:433)
	at org.eclipse.ui.internal.WorkbenchPage$1.run(WorkbenchPage.java:112)
	at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java(Compiled Code))
	at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code))
	at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:107)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:1327)
	at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:95)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:1001)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:922)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:120)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:101)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:91)
	at org.eclipse.jdt.internal.ui.packageview.OpenResourceAction.run(OpenResourceAction.java:57)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.handleDoubleClick(PackageExplorerPart.java:619)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.access$1(PackageExplorerPart.java:608)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$3.doubleClick(PackageExplorerPart.java:293)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:281)
	at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:431)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.widgetDefaultSelected(AbstractTreeViewer.java:654)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
	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:732)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:815)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:69)
	at org.eclipse.core.launcher.Main.run(Main.java:311)
	at org.eclipse.core.launcher.UIMain.main(UIMain.java:43)

TM (6/7/2001 14:17:49)
	While the crash might very well be a Netscape bug. We should handle the crashed editor better.

KM (6/7/01 12:40:24 PM)
	Moving to UI for consideration on exception in MenuManager.

DS (6/7/01 6:06:42 PM)
	From the stack trace it looks like we are trying to update a pulldown within
	the window menu.

	NegativeArraySizeException =  Thrown if an application tries to create 
	an array with negative size.

	I am confused.  Within MenuManager we don't allocate any arrays.  The only
	allocation is a "new ArrayList" (see below).  If some inline optimization is performed 
	the error may occur in the ArrayList constructor where a real array is allocated.  But that 
	implies that "items.length" < 0.  According to the java spec "length may be positive 
	or zero".

		protected void update(boolean force, boolean recursive) {
			if (isDirty() || force) {
				if (menu != null && !menu.isDisposed()) {
					// clean contains all active items without double separators
					IContributionItem[] items= getItems();
					List clean= new ArrayList(items.length);

	We also call menu.getItems further down in the method.  The getItems method will
	query the system to determine the item count for the menu.  If an error occurs in
	OS.GetMenuItemCount the result is -1.  Then menu.getItems tries to
	allocate an array of size -1.  This probably causes the exception.

	The netscape editor opens  in an OleEditor, so it will replace some pulldown menus
	within the window menubar.   It is not clear how MenuManager.update will cooperate if
	we do an update.  

	Hypothesis # 1: The menubar contains a combination of our own menus and those 
	contributed by netscape.  MenuManager.update removes all which are unknown.  And 
	our own pulldown menus which have a menu manager ( probably the case above ) may 
	not be "realized".  Either type of pulldown menu may return -1 if OS.GetMenuItemCount
	is called.

	Hypothesis # 2: Kevin says there is complete separation between the ole menu and
	our own.  In my own testing I find that we can normally query the items in our menubar
	even when another menu is active.  The error situation above may just be a
	side effect of the netscape error.

	Have asked Veronika to comment.

VI (6/8/2001 10:02:50 AM)
	OLE creates its own menubar which it super imposes on the applications menubar.
	The ole menu bar is completely separate from the applications menubar.
	The only entries in the ole menu bar that come  from the application are those provided
	in OleFrame.setFileMenus, OleFrame.setWindowMenus and OleFrame.setContainerMenus.

	Is some cleanup being done on the MenuItem objects passed in to these methods?

DS (6/8/01 11:37:01 AM)
	We may modify the contents of these menus while the ole editor is active.  For
	instance, we may add items to File New or the Perspective menu.

DS (6/8/01 12:44:25 PM)
	I talked with VI about this.  It should be OK to modify the contents of our menus while
	an OLE editor is active.  And in my own testing I am able to modify the actions which
	appear in the menu ( via action sets ) with no problems.

	Getting back to the original problem, ie the workbench died without putting up a dialog,
	our menu bar is corrupted.  There is nothing we can do.  At least we log the
	problem.  We can do a readme for this scenario.

NE (6/15/01 12:17:29 PM)
	Readme doc:
99.1.1.1 If an OLE editor crashes, it can cause the Workbench to also crash

If an OLE editor crashes, this can cause the Workbench to either crash, or to have its menus become inconsistent.
Comment 1 Kevin Haaland CLA 2002-01-21 21:01:09 EST
Another attempt was made to fix this. The changes were very risky. 
Comment 2 Randy Giffen CLA 2002-08-07 16:18:02 EDT
Reopen for investigation
Comment 3 Kevin Haaland CLA 2002-09-03 14:45:23 EDT
Pls try again with latest Netscape. List time it was determined to be a defect 
in their OLE control.
Comment 4 Chris McLaren CLA 2002-09-04 10:52:21 EDT
i tried this again with netscape 7.0 and eclipse 2.0.1. i altered the registry to open composer on the open verb. i was not able to get netscape 7.0 to open inplace. i embedded an html document in word and could also not get composer to open in place. possibly inplace editing functionality is absent in netscape 7.0 (it is a new codebase from 4.75)
Comment 5 Kevin Haaland CLA 2002-09-05 14:43:40 EDT
Closing based on comments above.