RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1212268 - JVM crash in CloseTTFontFileFunc
Summary: JVM crash in CloseTTFontFileFunc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: java-1.7.0-openjdk
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andrew John Hughes
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-16 03:53 UTC by James Livingston
Modified: 2019-08-15 04:28 UTC (History)
5 users (show)

Fixed In Version: java-1.7.0-openjdk-1.7.0.80-2.6.0.0.el6_6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 19:41:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Icedtea Bugzilla 2333 0 None None None 2019-06-25 07:52:23 UTC
Red Hat Product Errata RHBA-2016:0752 0 normal SHIPPED_LIVE java-1.7.0-openjdk bug fix and enhancement update 2016-05-10 22:32:01 UTC
openjdk bug system JDK-8079190 0 None None None Never

Description James Livingston 2015-04-16 03:53:11 UTC
With the fix from bug 1176718, there is a second similar bug that can cause a crash in the font handling code.


#5  <signal handler called>
#6  resolve_non_null (env=0x7f5b11efc9d8, obj=0x0, fieldID=0xc2) at /usr/src/debug/java-1.7.0-openjdk/openjdk/hotspot/src/share/vm/runtime/jniHandles.hpp:202
#7  jni_GetObjectField (env=0x7f5b11efc9d8, obj=0x0, fieldID=0xc2) at /usr/src/debug/java-1.7.0-openjdk/openjdk/hotspot/src/share/vm/prims/jni.cpp:2640
#8  0x00007f5af6671e31 in CloseTTFontFileFunc (stream=<value optimized out>) at ../../../src/share/native/sun/font/freetypeScaler.c:161
#9  0x000000364b010f17 in FT_Stream_Free (stream=0x7f5a84007bc0, external=1) at /usr/src/debug/freetype-2.3.11/src/base/ftobjs.c:196
#10 0x000000364b0119d4 in destroy_face (memory=0x7f5a84001580, face=0x7f5a84007c20, driver=0x7f5a84001370) at /usr/src/debug/freetype-2.3.11/src/base/ftobjs.c:874
#11 0x000000364b011a92 in FT_Done_Face (face=0x7f5a84007c20) at /usr/src/debug/freetype-2.3.11/src/base/ftobjs.c:2260
#12 0x00007f5af6673072 in freeNativeResources (env=0x7f5b11efc9d8, scaler=<value optimized out>, font2D=<value optimized out>, pScaler=140026738382000)
    at ../../../src/share/native/sun/font/freetypeScaler.c:124
#13 Java_sun_font_FreetypeFontScaler_disposeNativeScaler (env=0x7f5b11efc9d8, scaler=<value optimized out>, font2D=<value optimized out>, pScaler=140026738382000)
    at ../../../src/share/native/sun/font/freetypeScaler.c:1052
#14 0x00007f5b071817f8 in ?? ()

  jfieldID platNameField =
       (*env)->GetFieldID(env, tmpClass, "platName", "Ljava/lang/String;");
  jstring platName = (*env)->GetObjectField(env,
                                            scalerInfo->font2D,
                                            platNameField);
  const char *name = JNU_GetStringPlatformChars(env, platName, NULL);



Previously font2D was the wrong kind of object, but now it is
occasionally null. All the places in FreetypeFontScaler which pass in
the font, other than initialisation, get it by calling
WeakReference.get().

It would seem to me that any code using the result of that should expect
that it may be null, but the native code assumes it is not.


There are comments in FontScaler which say:
   - scalers are disposed when associated Font2D object (e.g. TruetypeFont)
     is garbage collected. That's why this object implements DisposerRecord
     interface directly (as it is not used as indicator when it is safe
     to release native state) and that's why we have to use WeakReference
     to Font internally.

However it isn't particular clear that the (Freetype)FontScaler is
guaranteed to have dispose() called before it's WeakReference to the
Font2D is cleared. If there is not that guarantee, then it should
probably be guarded by a null check.


Rather than add a null check, CloseTTFontFileFunc could probably do nothing or be removed, since OpenJDK's 2d-dev list did not report a reason for it doing anything.

Comment 2 James Livingston 2015-04-16 03:54:18 UTC
Issue raised on 2d-dev@ list, http://mail.openjdk.java.net/pipermail/2d-dev/2015-April/005257.html

Comment 4 James Livingston 2015-05-05 05:11:02 UTC
This has been backported to OpenJDK 8 via https://bugs.openjdk.java.net/browse/JDK-8079190.

Comment 6 jiri vanek 2015-06-16 07:32:42 UTC
The fix is known for 8, so it should be ok to backporte to 7, and be released together with 1176718. hhm?

Comment 7 Deepak Bhole 2015-06-16 13:59:23 UTC
This is already fixed in 2.6pre and we expect to move to 2.6 for the July CPU. Adding dev_ack.

Comment 13 Andrew John Hughes 2015-11-10 01:00:32 UTC
Moving back to MODIFIED for inclusion in erratum.

Comment 18 errata-xmlrpc 2016-05-10 19:41:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0752.html


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