JDK-8190280 : [macos] Font2DTest demo started failing for Arabic range from JDK 8 u162 b01 on Mac
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8u162
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2017-10-27
  • Updated: 2018-05-14
  • Resolved: 2017-11-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u162 b07Fixed
Testsuite name: 2D
Test name(s): Font2DTest demo 
Product(s) tested: JDK 8 u162 b01
OS/architecture: Mac OS (x64)

Reproducible: Always

Is it a Regression: Yes, No such exception is encountered in jdk1.8.0_152b16, but AIOBE  is thrown for JDK 8 u162 b01

Exception/Error from Log:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 255
        at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:75)
        at sun.font.CompositeStrike.getStrikeForGlyph(CompositeStrike.java:70)
        at sun.font.CompositeStrike.getGlyphImagePtrs(CompositeStrike.java:120)
        at sun.font.StandardGlyphVector.setupGlyphImages(StandardGlyphVector.java:938)
        at sun.font.GlyphList.setFromGlyphVector(GlyphList.java:293)
        at sun.java2d.pipe.GlyphListPipe.drawGlyphVector(GlyphListPipe.java:136)
        at sun.java2d.SunGraphics2D.drawGlyphVector(SunGraphics2D.java:3003)
        at sun.font.ExtendedTextSourceLabel.handleDraw(ExtendedTextSourceLabel.java:193)
        at sun.font.Decoration.drawTextAndDecorations(Decoration.java:122)
        at sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:197)
        at java.awt.font.TextLine.draw(TextLine.java:776)
        at java.awt.font.TextLayout.draw(TextLayout.java:2647)
        at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:78)
        at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2928)
        at FontPanel$FontCanvas.modeSpecificDrawChar(FontPanel.java:606)
        at FontPanel$FontCanvas.drawText(FontPanel.java:938)
        at FontPanel$FontCanvas.paintComponent(FontPanel.java:997)
        at javax.swing.JComponent.paint(JComponent.java:1056)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
        at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
        at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)

Please see attached log file
Fix Verification: Font2DTest demo used for verification: 8u162 b01: ArrayIndexOutOfBoundsException thrown 8u162 b07: No Exception thrown The fix succeeded

critical request justification : Very straightforward .. This is a regression introduced in 8u162 b01 so needs to be fixed before 8u162 GA. The fix is in 8u-dev and does not need to be pulled into any other release train .. it is specific to 8u

It looks to be the same problem as 8172967 but this time in the ICU code path for TextLayout .. since this is JDK 8. Hence the fix is not the same as the JDK 9 one, overlapping only in that the "safety" check in CompositeStrike might be a good idea to include. So as it needs a separate review etc its best to keep this a separate 9-na bug rather than claiming to be backporting 8172967.

This looks similar to https://bugs.openjdk.java.net/browse/JDK-8172967 which was fixed in 9. It was exposed by some of the changes in 9 discussed in https://bugs.openjdk.java.net/browse/JDK-8189858 which were backported to 8u162 which may be why it now shows up there. JDK 9 is using harfbuzz so the fix cannot be identical since we did get into layout code here and why it wasn't obvious this would affect the 8 backports. I still need to verify that its the same issue by getting an instrumented 8u build .. which is not likely to be today due to build server maintenance ..

No it does not affect 9.

Does it affect 9?