-
Bug
-
Resolution: Duplicate
-
P3
-
6u10
-
x86
-
linux
FULL PRODUCT VERSION :
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
java full version "1.6.0_16-b01"
in Gentoo: dev-java/sun-jdk-1.6.0.16
ADDITIONAL OS VERSION INFORMATION :
Gentoo Linux with ACCEPT_KEYWORDS='~x86'
Linux beach3 2.6.30-tuxonice-r5 #1 SMP PREEMPT Mon Sep 7 14:49:01 CEST 2009 i686 Genuine Intel(R) CPU T2500 @ 2.00GHz GenuineIntel GNU/Linux
(I doubt that this information will be of any relevance for this bug report.)
EXTRA RELEVANT SYSTEM CONFIGURATION :
Probably irrelevant.
A DESCRIPTION OF THE PROBLEM :
The JVM crashes due to an assertion failure when adding a certain character to a javax.swing.JTextArea using a certain font. The running program is aborted.
The assertion seems to have something to do with font handling.
I assume that this assertion can also be triggered with other fonts than the one given in the example (see Steps to Reproduce).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Download and install the Ann-Stone font. It is included in the freefont package, which can be retrieved from the following URI:
ftp://ftp.gimp.org/pub/gimp/fonts/freefonts-0.10.tar.gz
(FYI: the package not only contains the PostScript Type 1 font file ans.pfb, but also the gzip-compressed tar archive ans.tgz, which may contain information which might help with debugging.)
2. Store the source code of the given test program (class TestFontCrash) in a file called TestFontCrash.java:
3. Compile TestFontCrash.java:
$ javac TestFontCrash.java
4. Run the compiled program:
$ java -cp . TestFontCrash
5. Check the exit status of the program:
$ echo $?
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should write the following two lines on standard error, and then exit with an exitstatus of 0 (zero):
going to crash now
has not crashed
ACTUAL -
In all my tests, the program crashes, and the following three lines are written to stderr:
going to crash now
java: ../../../src/share/native/sun/font/t2k/t2ksc.c:659: Make3rdDegreeBezierEdgeList: Assertion `!t->onCurve[ ptC ]' failed.
Aborted
Note that the first line is printed by the program itself,
the second one by java, and
the third one by my shell.
Also note that the text “has not crashed” is /not/ printed.
The exit status of the program (as returned by the command given in step 5) is 134. The used shell is bash-4.0.28(2)-release in POSIX mode.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
The following line is printed to standard error:
java: ../../../src/share/native/sun/font/t2k/t2ksc.c:659: Make3rdDegreeBezierEdgeList: Assertion `!t->onCurve[ ptC ]' failed.
I am unable to locate an hs_err_pid%p.log file, sorry.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Font;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
class TestFontCrash {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JTextArea textArea = new JTextArea();
textArea.setFont(new Font("Ann-Stone", Font.PLAIN, 12));
System.err.println("going to crash now");
System.err.flush();
textArea.setText("L");
System.err.println("has not crashed");
System.err.flush();
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I have found no workaround for this problem.
I noticed that the problem appears when using
textArea.setText("L");
as in the given test program, but there are as well characters for which this bug is not triggered. For example, try
textArea.setText("A");
instead of the line with "L" above. In my tests, this does not cause the program to crash. Instead, it produces the given Expected Result, including the exit status of 0 (zero).
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
java full version "1.6.0_16-b01"
in Gentoo: dev-java/sun-jdk-1.6.0.16
ADDITIONAL OS VERSION INFORMATION :
Gentoo Linux with ACCEPT_KEYWORDS='~x86'
Linux beach3 2.6.30-tuxonice-r5 #1 SMP PREEMPT Mon Sep 7 14:49:01 CEST 2009 i686 Genuine Intel(R) CPU T2500 @ 2.00GHz GenuineIntel GNU/Linux
(I doubt that this information will be of any relevance for this bug report.)
EXTRA RELEVANT SYSTEM CONFIGURATION :
Probably irrelevant.
A DESCRIPTION OF THE PROBLEM :
The JVM crashes due to an assertion failure when adding a certain character to a javax.swing.JTextArea using a certain font. The running program is aborted.
The assertion seems to have something to do with font handling.
I assume that this assertion can also be triggered with other fonts than the one given in the example (see Steps to Reproduce).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Download and install the Ann-Stone font. It is included in the freefont package, which can be retrieved from the following URI:
ftp://ftp.gimp.org/pub/gimp/fonts/freefonts-0.10.tar.gz
(FYI: the package not only contains the PostScript Type 1 font file ans.pfb, but also the gzip-compressed tar archive ans.tgz, which may contain information which might help with debugging.)
2. Store the source code of the given test program (class TestFontCrash) in a file called TestFontCrash.java:
3. Compile TestFontCrash.java:
$ javac TestFontCrash.java
4. Run the compiled program:
$ java -cp . TestFontCrash
5. Check the exit status of the program:
$ echo $?
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should write the following two lines on standard error, and then exit with an exitstatus of 0 (zero):
going to crash now
has not crashed
ACTUAL -
In all my tests, the program crashes, and the following three lines are written to stderr:
going to crash now
java: ../../../src/share/native/sun/font/t2k/t2ksc.c:659: Make3rdDegreeBezierEdgeList: Assertion `!t->onCurve[ ptC ]' failed.
Aborted
Note that the first line is printed by the program itself,
the second one by java, and
the third one by my shell.
Also note that the text “has not crashed” is /not/ printed.
The exit status of the program (as returned by the command given in step 5) is 134. The used shell is bash-4.0.28(2)-release in POSIX mode.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
The following line is printed to standard error:
java: ../../../src/share/native/sun/font/t2k/t2ksc.c:659: Make3rdDegreeBezierEdgeList: Assertion `!t->onCurve[ ptC ]' failed.
I am unable to locate an hs_err_pid%p.log file, sorry.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Font;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
class TestFontCrash {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JTextArea textArea = new JTextArea();
textArea.setFont(new Font("Ann-Stone", Font.PLAIN, 12));
System.err.println("going to crash now");
System.err.flush();
textArea.setText("L");
System.err.println("has not crashed");
System.err.flush();
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I have found no workaround for this problem.
I noticed that the problem appears when using
textArea.setText("L");
as in the given test program, but there are as well characters for which this bug is not triggered. For example, try
textArea.setText("A");
instead of the line with "L" above. In my tests, this does not cause the program to crash. Instead, it produces the given Expected Result, including the exit status of 0 (zero).