Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 373646 - ArithmeticException makes the Eclipse window unusable
Summary: ArithmeticException makes the Eclipse window unusable
Status: CLOSED DUPLICATE of bug 373529
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 373796 396166 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-08 10:00 EST by Remy Suen CLA
Modified: 2012-12-10 07:09 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2012-03-08 10:00:01 EST
1. Start a new inner.
2. Close the 'Welcome' view.
3. Window > Open Perspective > Debug
4. Minimize the stack with the 'Variables' and 'Breakpoints' view in it.
5. Drag it to the bottom trim.
6. Click on the 'Breakpoints' view's icon to make it show up, then click on the 'Restore' button in the stack.
7. Window > Preferences > General > Appearance
8. Switch to the 'Windows 7 Classic' theme.
9. Window > New Window
10. Close the first window.
11. Try resizing the new window horizontally. Exceptions will be thrown.

I also appear to have two perspective switchers in the new window.

java.lang.ArithmeticException: divide by zero
	at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.tileLine(TrimBarLayout.java:234)
	at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.layout(TrimBarLayout.java:210)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1263)
	at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:1673)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4603)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2540)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.WM_WINDOWPOSCHANGED(Control.java:5408)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4616)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.EndDeferWindowPos(Native Method)
	at org.eclipse.swt.widgets.Composite.resizeChildren(Composite.java:949)
	at org.eclipse.swt.widgets.Composite.resizeChildren(Composite.java:915)
	at org.eclipse.swt.widgets.Composite.setResizeChildren(Composite.java:1126)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1264)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1249)
	at org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1086)
	at org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:4189)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3747)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1015)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:909)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:85)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:580)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:535)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:628)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:583)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1437)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1413)
Comment 1 Remy Suen CLA 2012-03-08 11:12:29 EST
I'm having problems reproducing it in an outer with I20120306-2200 so it might be something with my workspace's plug-ins. Probably rogue contributions up to no good.
Comment 2 Remy Suen CLA 2012-03-08 11:28:35 EST
Suspected e1b2a24fdb25939d58ec89391aa2580be2ce04dd but doesn't look like that was the cause.
Comment 3 Remy Suen CLA 2012-03-08 11:52:06 EST
We end up instantiating WorkbenchWindow twice it seems.

Thread [main] (Suspended (breakpoint at line 1226 in Workbench))	
	Workbench.createWorkbenchWindow(IAdaptable, IPerspectiveDescriptor, MWindow, boolean) line: 1226	
	Workbench.getActiveWorkbenchWindow() line: 1210	
	BuildAction.isEnabled() line: 237	
	RetargetActionWithDefault(RetargetAction).setActionHandler(IAction) line: 273	
	RetargetActionWithDefault.setActionHandler(IAction) line: 47	
	RetargetActionWithDefault(RetargetAction).propagateChange(PropertyChangeEvent) line: 211	
	RetargetAction$1.propertyChange(PropertyChangeEvent) line: 61	
	ActionBars(SubActionBars).firePropertyChange(PropertyChangeEvent) line: 291	
	ActionBars(SubActionBars).fireActionHandlersChanged() line: 273	
	ActionBars(SubActionBars).updateActionBars() line: 612	
	ActionBars.updateActionBars() line: 128	
	DefaultDetailPane$4.focusLost(FocusEvent) line: 452	
	TypedListener.handleEvent(Event) line: 143	
	EventTable.sendEvent(Event) line: 84	
	StyledText(Widget).sendEvent(Event) line: 1053	
	StyledText(Widget).sendEvent(int, Event, boolean) line: 1077	
	StyledText(Widget).sendEvent(int) line: 1058	
	StyledText(Control).sendFocusEvent(int) line: 2822	
	StyledText(Widget).wmKillFocus(long, long, long) line: 1921	
	StyledText(Control).WM_KILLFOCUS(long, long) line: 4900	
	StyledText(Canvas).WM_KILLFOCUS(long, long) line: 434	
	StyledText(Control).windowProc(long, int, long, long) line: 4562	
	StyledText(Canvas).windowProc(long, int, long, long) line: 341	
	Display.windowProc(long, long, long, long) line: 4985	
	OS.DefWindowProcW(long, int, long, long) line: not available [native method]	
	OS.DefWindowProc(long, int, long, long) line: 2540	
	Shell.callWindowProc(long, int, long, long) line: 498	
	Shell(Control).windowProc(long, int, long, long) line: 4623	
	Shell(Canvas).windowProc(long, int, long, long) line: 341	
	Shell(Decorations).windowProc(long, int, long, long) line: 1627	
	Shell.windowProc(long, int, long, long) line: 2069	
	Display.windowProc(long, long, long, long) line: 4972	
	OS.BringWindowToTop(long) line: not available [native method]	
	Shell(Decorations).bringToTop() line: 231	
	Shell.open() line: 1217	
	WBWRenderer.postProcess(MUIElement) line: 710	
	PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 632	
	PartRenderingEngine.safeCreateGui(MUIElement) line: 718	
	PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 689	
	PartRenderingEngine$7.run() line: 683	
	SafeRunner.run(ISafeRunnable) line: 42	
	PartRenderingEngine.createGui(MUIElement) line: 668	
	PartRenderingEngine$4.handleEvent(Event) line: 261	
	UIEventHandler$1.run() line: 41	
	UISynchronizer(Synchronizer).syncExec(Runnable) line: 180	
	UISynchronizer.syncExec(Runnable) line: 150	
	Display.syncExec(Runnable) line: 4683	
	E4Application$1.syncExec(Runnable) line: 184	
	UIEventHandler.handleEvent(Event) line: 38	
	EventHandlerWrapper.handleEvent(Event, Permission) line: 197	
	EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197	
	EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1	
	EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230	
	ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148	
	EventAdminImpl.dispatchEvent(Event, boolean) line: 135	
	EventAdminImpl.sendEvent(Event) line: 78	
	EventComponent.sendEvent(Event) line: 39	
	EventBroker.send(String, Object) line: 81	
	UIEventPublisher.notifyChanged(Notification) line: 57	
	ApplicationImpl(BasicNotifierImpl).eNotify(Notification) line: 374	
	ElementContainerImpl$1(EcoreEList<E>).dispatchNotification(Notification) line: 249	
	ElementContainerImpl$1(NotifyingListImpl<E>).addUnique(E) line: 294	
	ElementContainerImpl$1(AbstractEList<E>).add(E) line: 301	
	Workbench.createWorkbenchWindow(IAdaptable, IPerspectiveDescriptor, MWindow, boolean) line: 1232	
	Workbench.openWorkbenchWindow(IAdaptable, IPerspectiveDescriptor, MWindow, boolean) line: 2257	
	Workbench.openWorkbenchWindow(String, IAdaptable) line: 2249	
	OpenInNewWindowHandler.execute(ExecutionEvent) line: 58
Comment 4 Remy Suen CLA 2012-03-08 12:02:10 EST
(In reply to comment #2)
> Suspected e1b2a24fdb25939d58ec89391aa2580be2ce04dd but doesn't look like that
> was the cause.

Is indeed introduced by e1b2a24fdb25939d58ec89391aa2580be2ce04dd as the 'Build Project' action now has a default handler set.
Comment 6 Remy Suen CLA 2012-03-09 10:59:16 EST
*** Bug 373796 has been marked as a duplicate of this bug. ***
Comment 7 Remy Suen CLA 2012-03-12 16:35:28 EDT
Reverted for now. Still broken on the Mac.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=209df4386633e6ae4b8f931f2f136a4c00c2f3da
Comment 8 Oleg Besedin CLA 2012-03-29 13:58:08 EDT
I can not duplicate the problem using I20120313-0610 on Mac. Works for me.
Comment 9 Remy Suen CLA 2012-03-29 16:53:55 EDT
(In reply to comment #8)
> I can not duplicate the problem using I20120313-0610 on Mac. Works for me.

If I recall correctly, this only happens if the "fix" for bug 373529 is in.
Comment 10 Eric Moffatt CLA 2012-04-04 11:28:45 EDT
What's the current status of this defect ? It's a bit unclear given the comments...
Comment 11 Remy Suen CLA 2012-04-04 11:38:57 EDT
(In reply to comment #10)
> What's the current status of this defect ? It's a bit unclear given the
> comments...

It's dependent on bug 373529. When that bug is fixed, we need to ensure this problem doesn't surface.
Comment 12 Eric Moffatt CLA 2012-04-17 13:20:29 EDT
Marking for an SR1 fix. If this shows up during testing we may move it back to the RC's.
Comment 13 Oleg Besedin CLA 2012-04-24 11:16:05 EDT

*** This bug has been marked as a duplicate of bug 373529 ***
Comment 14 Dani Megert CLA 2012-12-10 07:09:11 EST
*** Bug 396166 has been marked as a duplicate of this bug. ***