JDK-7017324 : Kerning crash in JDK 7 since ICU layout update
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_vista
  • CPU: generic,x86
  • Submitted: 2011-02-04
  • Updated: 2011-04-13
  • Resolved: 2011-04-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.
JDK 7
7 b136Fixed
Related Reports
Duplicate :  
Description
The small program below crashes processing the 'kern' table since JDK 7 b123 ..

import java.io.*;
import java.awt.*;
import java.awt.font.*;
import java.util.*;

public class KernCrash extends Frame {
    private static Font font;

    public static void main(String[] args) throws Exception {
        HashMap attrs = new HashMap();
        attrs.put(TextAttribute.KERNING, TextAttribute.KERNING_ON);
        attrs.put(TextAttribute.SIZE, new Float(48f));
        font = Font.createFont(Font.TRUETYPE_FONT, new File("Vera.ttf"));
        font = font.deriveFont(attrs);
        System.out.println("using " + font);

        KernCrash f = new KernCrash();
        f.setTitle("Kerning Crash");
        f.setSize(600, 300);
        f.setForeground(Color.black);
        f.show();
    }

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D)g;
        FontRenderContext frc = g2.getFontRenderContext();
        TextLayout layout = new TextLayout("text", font, frc);
        layout.draw(g2, 10, 100);
    }
}

I've attached the Vera.ttf font and the full hs log but the
top of the native stack looks like this :

Stack: [0xd6b00000,0xd6b80000],  sp=0xd6b7e1d8,  free space=504k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libfontmanager.so+0x1744c]  void KernTable::process(LEGlyphStorage&)+0x90
C  [libfontmanager.so+0x22fac]  void LayoutEngine::adjustGlyphPositions(const unsigned short*,long,long,char,LEGlyphStorage&,LEErrorCode&)+0x1f0
C  [libfontmanager.so+0x233fc]  long LayoutEngine::layoutChars(const unsigned short*,long,long,long,char,float,float,LEErrorCode&)+0xf4
C  [libfontmanager.so+0x24a0c]  Java_sun_font_SunLayoutEngine_nativeLayout+0x1e8
j  sun.font.SunLayoutEngine.nativeLayout(Lsun/font/Font2D;Lsun/font/FontStrike;[FII[CIIIIIIILjava/awt/geom/Point2D$Float;Lsun/font/GlyphLayout$GVData;JJ)V+669586304
j  sun.font.SunLayoutEngine.nativeLayout(Lsun/font/Font2D;Lsun/font/FontStrike;[FII[CIIIIIIILjava/awt/geom/Point2D$Float;Lsun/font/GlyphLayout$GVData;JJ)V+0
j  sun.font.SunLayoutEngine.layout(Lsun/font/FontStrikeDesc;[FIILsun/font/TextRecord;ILjava/awt/geom/Point2D$Float;Lsun/font/GlyphLayout$GVData;)V+98
j  sun.font.GlyphLayout$EngineRecord.layout()V+95
j  sun.font.GlyphLayout.layout(Ljava/awt/Font;Ljava/awt/font/FontRenderContext;[CIIILsun/font/StandardGlyphVector;)Lsun/font/StandardGlyphVector;+541
j  sun.font.ExtendedTextSourceLabel.createGV()Lsun/font/StandardGlyphVector;+63
j  sun.font.ExtendedTextSourceLabel.getGV()Lsun/font/StandardGlyphVector;+9

-----

Comments
SUGGESTED FIX http://hg.openjdk.java.net/jdk7/jdk7/rev/9f88ef1d373f
08-03-2011

SUGGESTED FIX http://hg.openjdk.java.net/jdk7/jdk7/rev/9f88ef1d373f
08-03-2011

SUGGESTED FIX Kerning was actually broken, referencing off the end of the kerning table.
06-03-2011

EVALUATION Was able to confirm on b132
05-03-2011