Java binary, can't redirect stderr on VM crash

Patrick Wright pdoubleya at
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

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.


>  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!

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;

public class RenderFontTest {
    public static void main(String[] args) throws IOException {
        if (args.length == 0) {
            System.err.println("Need a font name");
        // 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 =
        GraphicsConfiguration gconf =

        Font f = loadFont(fontName);
        if (f == null) {
            System.err.println("Could not load font " + fontName + ",
not in JRE font list");
        System.out.println("Testing font: " + fontName + " created as
" + f.toString());
        BufferedImage bimg = gconf.createCompatibleImage(100, 100);
        Graphics g = bimg.getGraphics();
        g.drawString(Character.toString('\u0DDD'), 0, 0);

    // match exactly on font face name; constructor new Font(ffn...)
was not working?
    private Font loadFont(String fontName) {
        Font[] fonts =
        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: <>

More information about the discuss mailing list