Public bug reported:

Binary package hint: ttf-gujarati-fonts

The Java HotSpot VM causes libfontmanager.so to SIGSEGV when displaying
font from the ttf-gujarati-fonts package.

Step to reproduce (initial bug description, test file and work-around
from
http://www.intellij.net/forums/thread.jspa?forumID=27&threadID=189420) :

-----FontTest.java------
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.BorderLayout;
 
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
 
public class FontTest {
  public static void main(String[] args) {
    final JFrame frame = new JFrame("Font test window");
    frame.setSize(800, 600);
    frame.getContentPane().setLayout(new BorderLayout());
    final JLabel label = new JLabel("The quick brown fox jumped over the lazy 
dog's back!" +
                                    
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +
                                    "@#$%^&*()_+-=,./<>?'\";:[{]}\\|`~");
    label.setFont(label.getFont().deriveFont(16.0f));
    frame.getContentPane().add(label, BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
    try {
        final Font[] fonts = 
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
        for (int i = 0; i < fonts.length; i++) {
          final int idx = i;
          SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
              final Font font = fonts[idx];
              final String name = font.getName();
    
              System.out.println("Checking Font: " + name);
    
              final boolean t1 = testChars(font, 'a', 'z');
              final boolean t2 = testChars(font, 'A', 'Z');
              final boolean t3 = testChars(font, '0', '9');
              System.out.println("Executing canDisplayUpTo...");
              final boolean t4 = font.canDisplayUpTo("The quick brown fox 
jumped over the lazy dog's [EMAIL PROTECTED]&*()_+-=,./<>?'\";:[{]}\\|`~") == 
-1;
              System.out.println("Executing printTest...");
              printTest(frame, label, font);
    
              if (t1 && t2 && t3 && t4) {
                System.out.println(" OK.");
              } else {
                System.out.println();
              }
            }
          });
        }
        System.out.println("Finished");
        System.exit(0);
    } catch(Exception e) {
      throw new RuntimeException(e);
    }
  }
 
  private static boolean testChars(final Font font, final int start, final int 
end)
  {
    System.out.println("testChars('" + (char)start + "', '" + (char)end + "')");
    boolean ret = true;
 
    for(int i = start;i <= end;i++) {
      if(!font.canDisplay((char)i)) {
        ret = false;
      }
    }
 
    return ret;
  }
 
  private static void printTest(final JFrame frame, final JLabel label, final 
Font font)
  {
    System.out.println("Entering printTest.");
    final Font derived = font.deriveFont(16.0f);
    System.out.println("Derived font");
    label.setFont(derived);
    System.out.println("Set font");
    frame.repaint();
    System.out.println("Repainted and leaving printTest.");
  }
}
-----------

$ javac FontTest.java
$ java FontTest
[snip]
Checking Font: Rekha-normal
testChars('a', 'z')
testChars('A', 'Z')
testChars('0', '9')
Executing canDisplayUpTo...
Executing printTest...
Entering printTest.
Derived font
Set font
Repainted and leaving printTest.
 OK.
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x8c8fccf6, pid=9182, tid=2356358064
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_07-b03 mixed mode)
# Problematic frame:
# C  [libfontmanager.so+0x31cf6]
#
# An error report file with more information is saved as hs_err_pid9182.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted

Workaround : removing ttf-gujarati-fonts package fixes the problem.

** Affects: ttf-indic-fonts (Ubuntu)
     Importance: Untriaged
         Status: Unconfirmed

-- 
SIGSEGV in Java HotSpot when displaying Rekha-normal and aakar-MagNet fonts
https://launchpad.net/bugs/57056

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to