Java binary, can't redirect stderr on VM crash
Patrick Wright
pdoubleya at gmail.com
Thu Nov 27 22:19:39 UTC 2008
Hi Tim
Thanks for the reply.
> Is this test program ("RenderFontTest") something you could share with
> the list? Also, what font(s) are you testing when the crash happens?
Yes, first, see
http://mail.openjdk.java.net/pipermail/2d-dev/2008-November/000561.html
for the first report, with a Swing demo app. Igor asked me to try a
simpler test without getting Swing involved. The image-based test I'll
paste at the end of the mail.
> With this information we can try the testing on other platforms and
> throw additional troubleshooting resources such as libumem on Solaris
> at the problem.
That would be great. It's painstaking work given the nature of the problem.
> Looks as if this output is coming from down inside the free() implementation
> in the libc library on the native platform.
OK
> java -cp out/production/Samples RenderFontTest "AR PL UMing CN" >
> /tmp/err.txt 2>&1
Didn't work, but script did (altho output went to the console as
well), so I can capture the VM dump, at least.
Thanks for the help!
Patrick
Here's the render-glyph-to-image test. This fails on OpenJDK but not
Sun Java, for me. A font list (from getAllFonts()) is attached. The
other simple test, listed in the 2d-dev mailing list, fails on both,
but is higher level (Swing).
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
public class RenderFontTest {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
System.err.println("Need a font name");
System.exit(1);
}
// in case "" get pulled in with argument, strip em
String fontName = args[0];
if (args[0].startsWith("\"")) {
fontName = fontName.substring(1, fontName.length() - 1);
}
new RenderFontTest().run(fontName);
}
private void run(String fontName) throws IOException {
GraphicsEnvironment lge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsConfiguration gconf =
lge.getDefaultScreenDevice().getDefaultConfiguration();
Font f = loadFont(fontName);
if (f == null) {
System.err.println("Could not load font " + fontName + ",
not in JRE font list");
return;
}
System.out.println("Testing font: " + fontName + " created as
" + f.toString());
BufferedImage bimg = gconf.createCompatibleImage(100, 100);
Graphics g = bimg.getGraphics();
g.setFont(f);
g.drawString(Character.toString('\u0DDD'), 0, 0);
g.dispose();
System.out.println("OK");
}
// match exactly on font face name; constructor new Font(ffn...)
was not working?
private Font loadFont(String fontName) {
Font[] fonts =
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int i = 0; i < fonts.length; i++) {
Font font = fonts[i];
if (font.getFontName().equals(fontName)) {
return font;
}
}
return null;
}
}
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fontlist.txt
URL: <http://mail.openjdk.java.net/pipermail/discuss/attachments/20081127/5e996cfa/fontlist.txt>
More information about the discuss
mailing list