|
Description
|
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The error occurs whenever two conditions are present:
1. There is a corrupted/invalid font file in c:\winnt\fonts
2. The DragSource.getDefaultDragSource() method call is invoked
If you do not have a corrupt font file, you probably won't be able to reproduce
the condition. One that was sent to me is called Johnny-b.ttf but I am not
stating that all copies of this font are corrupt or invalid.
Example source code is a modified version of SwingApplication, renamed to
swingapplication.
<java source>
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.dnd.*;
public class swingapplication {
private static String labelPrefix = "Number of button clicks: ";
private int numClicks = 0;
public Component createComponents() {
final JLabel label = new JLabel(labelPrefix + "0 ");
// The following line causes assertion failure when an invalid font file is present
DragSource dragSource = DragSource.getDefaultDragSource();
// Normal op from here...
JButton button = new JButton("I'm a Swing button!");
button.setMnemonic('i');
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
numClicks++;
label.setText(labelPrefix + numClicks);
}
});
label.setLabelFor(button);
/*
* An easy way to put space between a top-level container
* and its contents is to put the contents in a JPanel
* that has an "empty" border.
*/
JPanel pane = new JPanel();
pane.setBorder(BorderFactory.createEmptyBorder(
300, //top
300, //left
100, //bottom
300) //right
);
pane.setLayout(new GridLayout(0, 1));
pane.add(button);
pane.add(label);
return pane;
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(
// UIManager.getSystemLookAndFeelClassName());
UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) { }
//Create the top-level container and add contents to it.
JFrame frame = new JFrame("swingapplication");
swingapplication app = new swingapplication();
Component contents = app.createComponents();
frame.getContentPane().add(contents, BorderLayout.CENTER);
//Finish setting up the frame, and show it.
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
}
</java source>
Error message when run from command line:
Assertion failed: offset < fFileSize, file
..\..\..\..\src\share\native\sun\awt\font\fontmanager\fontobjects\fontObject.cpp
, line 240
If similar code is invoked in an applet, you will see a similar error in
structure to the error message reported in bug # 4474833.
The corrupted font file has done some serious damage to other applications, so I
will not respond to requests for copies except to Sun engineers. Thanks for
respecting my concerns in this regard.
(Review ID: 135656)
======================================================================
FULL PRODUCT VERSION :
> java -version
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition
(build 1.4.1-rc-b19)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)
FULL OPERATING SYSTEM VERSION :
customer Windows 2000 [Version
5.00.2195]
A DESCRIPTION OF THE PROBLEM :
On trying to launch a PARTICULAR Swing-based application through an
executable error, we get the following error ( using java -jar
cmd).
"Assertion failed: offset < fFileSize, file
../../../src/share/native/sun/awt/fon
t/fontmanager/fontobjects/fontObject.cpp,
line 418
abnormal program termination"
The program doesnt
launch.
REGRESSION. Last worked in version 1.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Reproducing the bug:
====================
i) Create a JAR file
anew - I created one for my open source project - jreversepro - located at
www.sourceforge.net using the jar utility.
Please check out the
latest code available in the CVS repository of
http://www.sourceforge.net/projects/jrevpro ( anonymous access )
and try to run the ant task - makejar.
It will create the JAR file in the
directory lib.
java -jar jreversepro.jar , then we get the error as -
"Assertion failed: offset < fFileSize, file
../../../src/share/native/sun/awt/fon
t/fontmanager/fontobjects/fontObject.cpp,
line 418
abnormal program termination"
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected Result:
=================
When I try to launch the
Swingbased UI, I should get the UI correctly.
Instead I am getting an
error as follows.
"Assertion failed: offset < fFileSize, file
../../../src/share/native/sun/awt/fon
t/fontmanager/fontobjects/fontObject.cpp,
line 418
abnormal program termination"
ERROR MESSAGES/STACK TRACES THAT OCCUR :
"Assertion failed: offset < fFileSize, file
../../../src/share/native/sun/awt/fon
t/fontmanager/fontobjects/fontObject.cpp,
line 418
abnormal program termination"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Go to http://www.sourceforge.net/projects/jrevpro.
It uses CVS .
Use anonymous access
and
Check out the latest code on the repository on the branch - dev_1_3_4.
Try to run the task -
'ant makejar' .
( For this you need the ANT utility available at jakarta. customer .org/ant
).
Then after creating the JAR file try to launch by saying -
"java -jar jreversepro.jar".
It should ideally laucnh a swing-based UI. Instead it reports error.
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
No Work around as of now.
Kindly look into this at a high priority.
As
of now managing with cmd.line utility. Unless this bug is resolved, I cant
release that particular product.
Thanks in advance for helping in
this regard.
Cheers.
Karthik.
(Review ID: 164834)
======================================================================
|
|
Comments
|
Submitted On 04-JAN-2002
epenak
The corrupted font file is available on the BMC Software,
Inc ftp site: ftp.bmc.com
Logon as anonymous and use your email address as password.
cd outgoing/bugid4593165
get abadfont.ttf
Submitted On 03-MAY-2002
tomkwong
on my system batang.ttf causes the problem.
Submitted On 15-APR-2003
Kierone
I've the same problem. I've removed batang.ttf and the error
still occurs. I'd like to start using the web services but my
current project will only run using 1.2.x and I need to be using
1.3. In short - I'm stuck. Is there any way I can find out what
font is causing the problem? I've tried comparing the DOS list
to the Explorer view with no joy.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|