Community
Participate
Working Groups
I20050906 + ZRH HEAD + JFace HEAD The following exception kills Eclipse on startup (with existing or fresh workspace): !SESSION 2005-09-08 01:10:07.947 ----------------------------------------------- eclipse.buildId=unknown java.version=1.4.2_09 java.vendor=Apple Computer, Inc. BootLoader constants: OS=macosx, ARCH=ppc, WS=carbon, NL=en_US Framework arguments: -application org.eclipse.ui.ide.workbench -pdelaunch Command-line arguments: -application org.eclipse.ui.ide.workbench -data /Volumes/Stuff/Eclipse/ test_ws/enc16 -dev file:/Users/weinand/Eclipse/workspaces/release/.metadata/.plugins/ org.eclipse.pde.core/enc16/dev.properties -pdelaunch -consoleLog -os macosx -ws carbon -arch ppc !ENTRY org.eclipse.ui 4 4 2005-09-08 01:10:14.584 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-09-08 01:10:14.589 !MESSAGE 261 !STACK 0 java.lang.ArrayIndexOutOfBoundsException: 261 at org.eclipse.jface.bindings.BindingManager.removeDeletions(BindingManager.java:1649) at org.eclipse.jface.bindings.BindingManager.computeBindings(BindingManager.java:491) at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1466) at org.eclipse.jface.bindings.BindingManager.getActiveBindingsByParameterizedCommand (BindingManager.java:825) at org.eclipse.jface.bindings.BindingManager.getActiveBindingsFor(BindingManager.java:1071) at org.eclipse.ui.internal.keys.BindingService.getActiveBindingsFor(BindingService.java:91) at org.eclipse.ui.internal.ide.actions.QuickMenuAction.getShortCutString(QuickMenuAction.java: 108) at org.eclipse.ui.internal.ide.WorkbenchActionBuilder$6.getMenuText (WorkbenchActionBuilder.java:457) at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:221) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:627) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:549) at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:232) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:627) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:549) at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:158) at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:174) at org.eclipse.ui.internal.WorkbenchWindow.createDefaultContents(WorkbenchWindow.java:929) at org.eclipse.ui.internal.WorkbenchWindowConfigurer.createDefaultContents (WorkbenchWindowConfigurer.java:577) at org.eclipse.ui.application.WorkbenchWindowAdvisor.createWindowContents (WorkbenchWindowAdvisor.java:261) at org.eclipse.ui.internal.WorkbenchWindow.createContents(WorkbenchWindow.java:897) at org.eclipse.jface.window.Window.create(Window.java:418) at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:663) at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1317) at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1223) at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java: 190) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:706) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1671) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:377) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:164) 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:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
Shoot... and Doug is out of town. Susan, could you take a peek at this?
I'll look at this right now...
Andre - I can't reproduce this one, but I don't have anything but default key bindings. Could you attach your bindings? I think everything I should need is in <workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.u i.workbench.prefs I'm also going to attach an experimental patch, because in examining the code, I think I see the problem...
Created attachment 26988 [details] BindingManager.patch Andre - could you give this a try? This is a trial patch based on eyeballing the code. This seems an obvious problem, but I'm surprised no one else has had the exception. I'm not sure what state the key bindings have to be in to trigger the problem.
Created attachment 26989 [details] compressed org.eclipse.ui.workbench.prefs Hi Susan, here is the requested file. However, I'm seeing the problem with a fresh workspace too.
Sorry, but the patch doesn't fix the problem for me.
You are aware that the bug occured on the Mac?
sigh...the patch was a no-op (pre-post increment confusion on my part). Sorry 'bout that. I can't get this to obviously fail on Windows. Can you tell me what's loaded in your workspace (what is ZRH head?) And is there any corresponding workbench HEAD loaded?... Are your non-Mac counterparts seeing the problem with similar configs?
Comment on attachment 26988 [details] BindingManager.patch (ignore this...blush)
The calculation of "deletedCount" is wrong because null-valued slots of the "bindingsCopy" array are set to null (deleted) multiple times, thus counted as deleted more than once (line 1634). Since the resulting array is shortened by the number of deleted slots, but the copying of slots is done if a slot is non-null, an AIOOBE must occur as soon as any deleted slot is counted twice. The attached patch fixes this problem by not relying on the algorithm to maintain a correct "deletedCount". Instead the empty slots are counted before copying (and compacting) the array. The fix ensures: - that the array is in fact compacted, - that no AIOOBE can occur, - and that the new behavior of the algorithm is not worse than the original behavior.
Created attachment 26996 [details] patch for BindingManager.java
*** Bug 109707 has been marked as a duplicate of this bug. ***
Note that this flaw was also introduced into the 3.1.1 stream.
Sorry, I meant to reassign this to Doug before I left town last week. I'd rather he review the patch since he's been working in this code...
If I understand correctly, this happens because of a missing "break" statement after line 1634 of BindingManager. Another approach is to perform a second iteration over the array to count the deletions (as given by Andre's patch). The AIOOBE can happen if two or more deletions markers for the same trigger sequence match an existing binding.
Created attachment 27341 [details] Patch to BindingManager (alternate) Andre: does this patch work for you? Do I understand the problem correctly?
Yes, your patch fixes the problem for me.
Fixed in CVS. Caused by the fix for Bug 106574. Applying patch to 3.1.1 maintenance stream as well.
Andre: would you be able to confirm that the problem you see is fixed in I20050921-1600 or later?
will do...
verified for I20050921-2000
Thank you very much. I also cannot reproduce the problem anymore. Marking as verified.