Bug 1479563 - Exception using stix-fonts with openjdk
Exception using stix-fonts with openjdk
Status: CLOSED DUPLICATE of bug 1484079
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-openjdk (Show other bugs)
7.3
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Mario Torre
BaseOS QE - Apps
:
Depends On: 1484079
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-08 15:52 EDT by Paulo Andrade
Modified: 2017-10-23 12:43 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-10-11 06:56:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
FontTest.java (776 bytes, text/plain)
2017-08-08 15:52 EDT, Paulo Andrade
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3145721 None None None 2017-08-09 09:28 EDT

  None (edit)
Description Paulo Andrade 2017-08-08 15:52:12 EDT
Created attachment 1310845 [details]
FontTest.java

Problem happens when only stix-fonts is available,
for example:

$ java FontTest
java.lang.ArrayIndexOutOfBoundsException: 0
	at sun.font.CompositeFont.getSlotFont(CompositeFont.java:351)
	at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
	at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
	at sun.font.CompositeFont.getMapper(CompositeFont.java:409)
	at sun.font.CompositeFont.canDisplay(CompositeFont.java:435)
	at java.awt.Font.canDisplayUpTo(Font.java:2063)
	at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
	at java.awt.font.TextLayout.<init>(TextLayout.java:531)
	at FontTest.main(FontTest.java:15)

But output should be usually:

$ java FontTest
result: 5

or:

result: 6


  Example steps to reproduce on Fedora:

dd if=/dev/zero of=f26.img bs=1G count=1
mkdir $PWD/f26.mount
mke2fs $PWD/f26.img
sudo mount $PWD/f26.img $PWD/f26.mount
sudo mock -r fedora-26-x86_64 --rootdir=$PWD/f26.mount --init
sudo mock -r fedora-26-x86_64 --rootdir=$PWD/f26.mount --install java-1.8.0-openjdk-devel stix-fonts
sudo cp FontTest.java $PWD/f26.mount
sudo mock -r fedora-26-x86_64 --rootdir=$PWD/f26.mount --shell

rpm -e aajohan-comfortaa-fonts-2.004-7.fc26.noarch  ## installed by default
javac FontTest.java
java FontTest
exit

sudo umount $PWD/f26.mount
sudo rmdir $PWD/f26.mount
sudo rm f26.img


  I am not 100% sure there is a problem with stix-fonts,
but this comment in sun/font/CompositeFont.java:CompositeFont()
may tell it should check bounds depending on what offset is
requested:

        /* We will limit the number of slots to 254.
         * We store the slot for a glyph id in a byte and we may use one slot
         * for an EUDC font, and we may also create a composite
         * using this composite as a backup for a physical font.
         * So we want to leave space for the two additional slots.
         */
         numSlots = (numSlots <= 254) ? numSlots : 254;
Comment 2 Andrew John Hughes 2017-08-24 14:34:11 EDT
Mario, one for you?
Comment 3 Mario Torre 2017-08-24 14:41:24 EDT
(In reply to Andrew John Hughes from comment #2)
> Mario, one for you?

Isn't that a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1484079 ?
Comment 4 Mario Torre 2017-08-31 07:30:13 EDT
I made that a dependency of https://bugzilla.redhat.com/show_bug.cgi?id=1484079 since I'm logging work on that bug, as far as I can tell it's the same issue.
Comment 5 Andrew John Hughes 2017-09-05 12:17:38 EDT
(In reply to Mario Torre from comment #3)
> (In reply to Andrew John Hughes from comment #2)
> > Mario, one for you?
> 
> Isn't that a duplicate of
> https://bugzilla.redhat.com/show_bug.cgi?id=1484079 ?

I asked the same in https://bugzilla.redhat.com/show_bug.cgi?id=1484079#c8 ;)
Comment 6 Mario Torre 2017-10-06 05:54:49 EDT
I'm working with upstream for this bug (and 1484079), for now I think we can ship our RPMs with this patch on the next update, since things will likely take longer.
Comment 7 Marc Richter 2017-10-06 13:14:24 EDT
Mario,

Can you clarify the expectations for when the fix may appear? z-stream? 7.5?

Thanks!

Marc
Comment 8 Mark Butt 2017-10-10 11:01:19 EDT
Hi Mario,

We too are wondering if the date for the anticipated fix has been determined.
We are deploying CSDC's Amanda product on JBOSS 6.4 (RHEL 7.4) and are encountering several locations in the application where functions are failing to execute.  CSDC has traced the problem to this Bug so we are eager to get a resolution.

Thanks!
-M
Comment 9 Mario Torre 2017-10-10 12:43:37 EDT
(In reply to Mark Butt from comment #8)
> Hi Mario,
> 
> We too are wondering if the date for the anticipated fix has been determined.
> We are deploying CSDC's Amanda product on JBOSS 6.4 (RHEL 7.4) and are
> encountering several locations in the application where functions are
> failing to execute.  CSDC has traced the problem to this Bug so we are eager
> to get a resolution.

The quickest way to resolve would be to install an additional font or replace STIX with a non CFF one, which will make things work already now. As for the patch actually going in the rpm there are few things to still consider but the patch is basically ready and we are working on shipping it, I can't say if this will hit the next update, the best to do is to keep observing this bug report for news.
Comment 11 Mario Torre 2017-10-11 06:56:28 EDT

*** This bug has been marked as a duplicate of bug 1484079 ***

Note You need to log in before you can comment on or make changes to this bug.