Community
Participate
Working Groups
Build Identifier: I20110613-1736 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ArithmeticException: / by zero) at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) 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:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Caused by: java.lang.ArithmeticException: / by zero at org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramDataModel.scaleTo(HistogramDataModel.java:221) at org.eclipse.linuxtools.lttng.ui.views.histogram.Histogram$1.run(Histogram.java:383) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) ... 23 more Reproducible: Always Steps to Reproduce: 1.Create LTTng project 2.Import some trace files 3.double click on the imported trace to display the traces 4.Maximize the Events view, then restore the view 5.You will now receive the SWTException on ava.lang.ArithmeticException: / by zero at org.eclipse.linuxtools.lttng.ui.views.histogram.HistogramDataModel.scaleTo(HistogramDataModel.java:221)
I'll take this one.
Created attachment 203626 [details] Fix Couldn't reproduce the problem in my environment but there is definitely a possibility for div by 0. The method had assert statements to cover for this case but, in Java, you have to provide a run-time switch (-ea) to enable them. The patch does the following: - Replace "assert" by an an AssertionError - Ensure that the caller validates its data before calling this method - Added a unit test
Comment on attachment 203626 [details] Fix Patch committed
Done.
I have verified the fix with latest code in master and I am no longer getting the ArithmeticException. thanks for fixing it quickly!
(In reply to comment #5) > I have verified the fix with latest code in master and I am no longer getting > the ArithmeticException. > thanks for fixing it quickly! You're welcome.
Delivered in 0.9.0