Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 520374 - java.lang.ArrayIndexOutOfBoundsException in StyledTextRenderer
Summary: java.lang.ArrayIndexOutOfBoundsException in StyledTextRenderer
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC All
: P3 critical with 1 vote (vote)
Target Milestone: 4.8 M5   Edit
Assignee: Fabio Zadrozny CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-31 11:55 EDT by Oliver HD CLA
Modified: 2017-12-16 04:03 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 Oliver HD CLA 2017-07-31 11:55:43 EDT
Happens e.g. when running npm build via run config

eclipse.buildId=4.7.0.I20170612-0950
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/olihd/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/olihd/.eclipse_keyring

org.eclipse.ui
Error
Mon Jul 31 17:48:05 CEST 2017
Unhandled event loop exception

java.lang.ArrayIndexOutOfBoundsException: 2380
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:765)
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:719)
	at org.eclipse.swt.custom.StyledTextRenderer.drawLine(StyledTextRenderer.java:363)
	at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:6181)
	at org.eclipse.swt.custom.StyledText.lambda$1(StyledText.java:5738)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4257)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
	at org.eclipse.swt.widgets.Control.drawWidget(Control.java:1275)
	at org.eclipse.swt.widgets.Canvas.drawWidget(Canvas.java:172)
	at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:766)
	at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:166)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5775)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSView.displayIfNeeded(NSView.java:151)
	at org.eclipse.swt.widgets.Control.update(Control.java:5129)
	at org.eclipse.swt.widgets.Canvas.scroll(Canvas.java:408)
	at org.eclipse.swt.custom.StyledText.scroll(StyledText.java:8025)
	at org.eclipse.swt.custom.StyledText.scrollText(StyledText.java:8139)
	at org.eclipse.swt.custom.StyledText.handleTextChanging(StyledText.java:6355)
	at org.eclipse.swt.custom.StyledText$5.textChanging(StyledText.java:5708)
	at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.documentAboutToBeChanged(ConsoleDocumentAdapter.java:310)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:641)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1093)
	at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1120)
	at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:92)
	at org.eclipse.ui.internal.console.IOConsolePartitioner.processQueue(IOConsolePartitioner.java:580)
	at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.runInUIThread(IOConsolePartitioner.java:530)
	at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4033)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
	at org.eclipse.jface.window.Window.open(Window.java:794)
	at org.eclipse.ui.internal.views.log.EventDetailsDialog.open(EventDetailsDialog.java:186)
	at org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:101)
	at org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:563)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:831)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:828)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1459)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1258)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
	at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:247)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:306)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4257)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1502)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1525)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1510)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1314)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4081)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	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:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Comment 1 Fabio Zadrozny CLA 2017-10-13 09:03:14 EDT
I've gotten the same error (although when redrawing using a themed scroll bar, the point where the exception is thrown is the same).

!ENTRY org.eclipse.e4.ui.css.swt.theme 4 0 2017-10-13 09:53:45.373
!MESSAGE 36
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: 36
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:765)
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:719)
	at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4525)
	at org.eclipse.swt.custom.StyledText.doMouseLinkCursor(StyledText.java:2779)
	at org.eclipse.swt.custom.StyledText.doMouseLinkCursor(StyledText.java:2776)
	at org.eclipse.swt.custom.StyledText.redraw(StyledText.java:7564)
	at org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.StyledTextThemedScrollBarAdapter$StyledTextPaintListener.redrawScrollBars(StyledTextThemedScrollBarAdapter.java:662)
	at org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.AbstractThemedScrollBarAdapter.setMouseNearScrollScrollBarWidth(AbstractThemedScrollBarAdapter.java:482)
	at org.eclipse.e4.ui.css.swt.dom.StyledTextElement.setMouseNearScrollScrollBarWidth(StyledTextElement.java:59)
	at org.eclipse.e4.ui.css.swt.properties.custom.CSSPropertyStyledTextScrollbarSWTHandler.applyCSSProperty(CSSPropertyStyledTextScrollbarSWTHandler.java:65)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyCSSProperty(AbstractCSSEngine.java:766)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyleDeclaration(AbstractCSSEngine.java:552)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:426)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:367)
	at org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles(AbstractCSSEngine.java:443)


Note: raising to critical: after this happens the editor becomes unusable.

Note 2: marking all (the original was on Mac and I had this on Windows, so, it appears it may happen anywhere).
Comment 2 Leo Ufimtsev CLA 2017-10-13 14:05:47 EDT
Can you post steps to reproduce?
Comment 3 Fabio Zadrozny CLA 2017-10-16 14:19:11 EDT
Unfortunately I can't reproduce this reliably (seen it happen twice in many months, so, it doesn't happen often -- this time it happened right after doing a save in PyDev while having a code formatter on -- so, it changed the text just before the save operation).

Still, can't seem to find a way to reliably trigger it (what I know is that when it happens the editor becomes unusable and has to be closed/reopened).
Comment 4 Eclipse Genie CLA 2017-11-14 13:00:50 EST
New Gerrit change created: https://git.eclipse.org/r/111577
Comment 6 Lars Vogel CLA 2017-12-16 04:03:31 EST
Thanks Fabio.