Bug 565735

Summary: [win32] Index out of bounds after ToolBar.getItem / COMObject.callback10
Product: [Eclipse Project] Platform Reporter: Johannes Merkert <johannes.merkert>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, rolf.theunissen
Version: 4.10Keywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
eclipse.log none

Description Johannes Merkert CLA 2020-07-31 05:38:20 EDT
Some of our customers recently experience application crashes. The application was released about 7 months ago (with STW 4.10) and the crashes occur since the last days. Some of the users can reproduce them, some not.
A newer version of our application with SWT 4.15 has the same issues.

Unfortunately we developers cannot reproduce the error so we cannot debug it.

java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4576)
	at org.eclipse.swt.SWT.error(SWT.java:4510)
	at org.eclipse.swt.SWT.error(SWT.java:4481)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:451)
	at org.eclipse.swt.widgets.ToolBar.getItem(ToolBar.java:519)
	at org.eclipse.jface.action.ToolBarManager$1.getName(ToolBarManager.java:149)
	at org.eclipse.swt.accessibility.Accessible.get_accName(Accessible.java:2732)
	at org.eclipse.swt.accessibility.Accessible$1.method10(Accessible.java:170)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback10(COMObject.java:158)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3545)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
Comment 1 Andrey Loskutov CLA 2020-07-31 05:45:23 EDT
Please attach full JVM crash log & Eclipse workspace log.

Looking at the provided stack trace most likely closing embedded Windows application (like Excel or Word) could be a problem.
Comment 2 Johannes Merkert CLA 2020-07-31 06:20:48 EDT
Created attachment 283768 [details]
eclipse.log

The corresponding error (in the bug description) occured 2020-07-29 11:26:42:025
Comment 3 Johannes Merkert CLA 2020-07-31 06:22:30 EDT
The JVM does not crash, so we cannot provide a JVM crash log.
Comment 4 Andrey Loskutov CLA 2020-07-31 06:33:46 EDT
(In reply to Johannes Merkert from comment #3)
> The JVM does not crash, so we cannot provide a JVM crash log.

OK, but what did you mean by "experience application crashes" then?
Comment 5 Andrey Loskutov CLA 2020-07-31 06:41:23 EDT
(In reply to Johannes Merkert from comment #2)
> Created attachment 283768 [details]
> eclipse.log
> 
> The corresponding error (in the bug description) occured 2020-07-29
> 11:26:42:025

The stack trace from comment 0 is not in the attached log.

Without proper problem description I see no way how we can help here, especially if it is about a custom closed source application.
Comment 6 Johannes Merkert CLA 2020-07-31 07:06:47 EDT
The stack trace provided in the description is from our application log.
The attached log is the eclipse log.
The description is misleading, sorry: we catch the exception and exit the application then.
Comment 7 Andrey Loskutov CLA 2020-07-31 07:20:05 EDT
(In reply to Johannes Merkert from comment #0)
> application was released about 7 months ago (with STW 4.10) and the crashes
> occur since the last days. 

So what did change recently?

> Some of the users can reproduce them, some not.

Sounds like a Windows / Office update related, if users have different Windows/Office patches applied.

> A newer version of our application with SWT 4.15 has the same issues.

If you can, you could try to build your application on 4.16 and see if that changes anything, who knows.
Comment 8 Johannes Merkert CLA 2020-08-01 06:27:01 EDT
I reduced criticality because we found the item that causes the problem and a way that seems to avoid it. First tests look good.
Culprit is a MToolBarElement that we do only need in special situations. We show/hide the element with its setVisible() method.
The error occures when the element is hidden or revealed (not every time and only on some machines).

We "fixed" the problem by not hiding it anymore but making it inactive instead.

We do not know what changes are made on the customer's IT-infrastructure, we guess it is about Windows updates or perhaps changes in the anti virus software rules.
Comment 9 Rolf Theunissen CLA 2020-08-03 02:02:15 EDT
The exception seems to be related to accessibility, do the customers for which the issue occurs use a screen-reader or some other accessibility tool?

The index out of bounds is triggered by the AccessibleAdapter returned from the ToolBarManager#getAccessibleListener method.
As the call is triggered by a callback from the OS, there might be a race condition here.
Comment 10 Johannes Merkert CLA 2020-08-06 06:03:59 EDT
The customers that experienced the problem do not use any accessability tools.