JDK-7180898 : Exception thrown from FileFontStrike.getCachedGlyphPtr in Java2Demo
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2012-06-29
  • Updated: 2012-07-17
  • Resolved: 2012-07-17
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.
JDK 8
8Resolved
Related Reports
Duplicate :  
Description
The following exception was first seen in JDK 8 PIT by the integrator
when clicking on the Fonts tab and resizing Java2Demo :-

#0 Mon Jun 25 10:26:33 PDT 2012, 6896.2266K used
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 36
    at sun.font.FileFontStrike.getCachedGlyphPtr(FileFontStrike.java:459)
    at sun.font.FileFontStrike.getGlyphImagePtrs(FileFontStrike.java:406)
    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:2908)
    at sun.font.ExtendedTextSourceLabel.handleDraw(ExtendedTextSourceLabel.java:193)
    at sun.font.Decoration$DecorationImpl.drawTextAndEmbellishments(Decoration.java:258)
    at sun.font.Decoration$DecorationImpl.drawTextAndDecorations(Decoration.java:337)
    at sun.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:197)
    at java.awt.font.TextLine.draw(TextLine.java:794)
    at java.awt.font.TextLayout.draw(TextLayout.java:2647)
    at java2d.demos.Fonts.AttributedStr.render(AttributedStr.java:181)

Comments
EVALUATION It was a bug in the font code that happens to show up with CCM. See bug 7183251
17-07-2012

EVALUATION This reproduces only occasionally but on all platforms and appears to be a race condition. Eventually I was also able to see the same in JDK7u6 b16 PIT when enabling alternative hashing. JDK 8 doesn't allow disabling that, but I also reverted a change to go back from ConcurrentHashMap to HashMap in SunLayoutEngine.java That also *appears* to cure the problem. Java2Demo executes on multiple threads and that may be what exposes this. So it looks like it might be a bug in ConcurrentHashMap, under MT usage, when using alternate hashing. Needs more work to be sure and to see exactly how that change in SunLayoutEngine.java resulted in the exception. Broadly speaking it looks like we get some incorrect value out of the Map so we are indexing into one font but using glyph ids from another.
29-06-2012