JDK-4599491 : Assertion failed: pos <= t->maxPos, in share/native/sun/awt/font//t2k/t2kstrm.c
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0,1.4.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_98,windows_nt,windows_xp
  • CPU: x86
  • Submitted: 2001-12-12
  • Updated: 2005-05-10
  • Resolved: 2002-10-16
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.
Other Other
1.4.1_03 03Fixed 1.4.2Fixed
Related Reports
Relates :  
Description

Name: jl125535			Date: 12/12/2001


java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

I wrote an application which loads UnionWay Japanese True Type Font (uwjmg3.ttf
2.9MB) dynamically and tried to render a label with the dynamic loaded font.

On JDK 1.4.0 beta 3 (with either Solaris 8 or Windows 2000). the following
output appears:

% java DynamicFontLoadingTest
Font=java.awt.Font[family=UWJMG3 (SJIS),name=UWJMG3 (SJIS),style=plain,size=1]
Assertion failed: pos <= t->maxPos, file ../../../src/share/native/sun/awt/font/t2k/t2kstrm.c, line 94
Abort (core dumped)

On JDK 1.3.1 (with either Solaris 8 or Windows 2000). the following
output appears:

% java DynamicFontLoadingTest
Font=java.awt.Font[family=UWJMG3 (SJIS),name=UWJMG3 (SJIS),style=plain,size=1]
Assertion failed: size > 0, file ../../../src/share/native/sun/awt/font/fontmanager/fontobjects/fontObject.cpp, line 298
Abort (core dumped)


Sourcecode of the test:

import java.awt.*;
import java.net.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;

/**
 * An application that displays a JLabel in an dynamic loaded true type font
 */
public class DynamicFontLoadingTest extends JPanel {
    static JFrame frame;

    public DynamicFontLoadingTest() {

        try
        {
            // try to load font
            FileInputStream fontStream = new FileInputStream("uwjmg3.ttf");
            Font myFont = Font.createFont(Font.TRUETYPE_FONT, fontStream);
            System.out.println("Font="+myFont);
            fontStream.close();

            // Create a label and set font
            JLabel label = new JLabel("Hello in UnionWay Japanese True Type Font");
            if (myFont != null)
                label.setFont(myFont.deriveFont(java.awt.Font.BOLD, 20));
            add(label);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    public static void main(String s[]) {

        DynamicFontLoadingTest panel = new DynamicFontLoadingTest();
    
        frame = new JFrame("DynamicFontLoadingTest");
        frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {System.exit(0);}
            });
        frame.getContentPane().add("Center", panel);
        frame.pack();
        frame.setVisible(true);
    }
}


The attached font file, "uwjmg3.ttf," must be in the same directory as the class file.
(Review ID: 136806) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.1_03 mantis FIXED IN: 1.4.1_03 mantis INTEGRATED IN: 1.4.1_03 mantis mantis-b04
14-06-2004

EVALUATION I'm going to guess that this is a 2D issue based on the directory in the Synopsis. Also, it is a font problem, but doesn't use peered AWT components. ###@###.### 2001-12-12 The EBSC table entry is invalid in the uwjmg2.ttf 2. 'EBSC' - chksm = 0x00000000, off = 0x00000000, len = 0 The fix checks the length before reading EBSC information. ###@###.### 2002-09-24
24-09-2002