Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8132850

java.lang.ArrayIndexOutOfBoundsException during text rendering with many fonts installed

XMLWordPrintable

    • 2d
    • b80

        When a lot of fonts are installed on a target Linux system, rendering of some characters leads to ArrayIndexOutOfBoundsException.

        To reproduce the issue, run the attached simple program after installing texlive package.

        Expected result - is that the program runs normally.
        Actual result - exception is thrown.

        To install texlive:

        * On OpenSuSE 13.2 it's enough to install texlive package from distribution's repository.
        * On SuSE Linux Enterprise Server 12:

          - download installer from https://www.tug.org/texlive/acquire-netinstall.html
          - run install-tl script, change target installation directory TEXDIR to ~/texlive, complete installation
          - create file ~/.fonts.conf with the following contents:

        <?xml version="1.0"?>
        <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
        <fontconfig>
          <dir>~/texlive/texmf-dist/fonts</dir>
        </fontconfig>

         - run 'fc-cache -f' to update fontconfig caches
         - to verify the procedure, run 'fc-list | grep texlive'. The command should produce non-empty output.

        The issue is reproduced with latest java version:
        java version "1.8.0_51"
        Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
        Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

        Additional technical information:
        The issue will occur when the number of physical fonts discovered using libfontconfig for a certain logical font is larger than 128.

        The only known workaround is decreasing the number of fonts installed in the system. Avoiding the usage of logical fonts in application would also help but it's not easy to achieve.

          1. exception.txt
            4 kB
          2. fonts.conf
            0.1 kB
          3. Test.java
            0.4 kB

              prr Philip Race
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: