Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1582404

Summary: Java font tmp files are deleted from /tmp, leading to JVM crash
Product: Red Hat Enterprise Linux 7 Reporter: István Tóth <stoty>
Component: java-1.8.0-openjdkAssignee: Mario Torre <neugens>
Status: CLOSED NOTABUG QA Contact: OpenJDK QA <java-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: 1300314679, ahughes, dbhole, jvanek, neugens
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-12 16:22:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
JVM crash log
none
proposed tmpfiles.d config file
none
reproducer for the bug none

Description István Tóth 2018-05-25 06:46:26 UTC
Created attachment 1441429 [details]
JVM crash log

Description of problem:

The font tmp files created by java are deleted after 10 days, causing the JVM to crash in some cases.

See https://bugs.openjdk.java.net/browse/JDK-8051956 for details.


Version-Release number of selected component (if applicable):

java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64
(This is actually CentOS, but I do not think that there is anything CentOS specific in this bug)

How reproducible:

It is difficult reproduce, as it requires loading a font in java, then waiting for 10 days, then trying to use it again.

Steps to Reproduce:
1. Generate a report using a truetype font with Jasper Reports
2. wait ten days (you may have to make sure not use that font again from that JVM)
3. Try to generate a report using the same font again

Actual results:

JVM Crash in libtk.so

Expected results:

No crash

Additional info:

I think that the openjdk package should add a config file in /usr/lib/tmpfiles.d that excludes the font tmp files from deleting.

Comment 2 István Tóth 2018-05-25 06:52:16 UTC
Created attachment 1441443 [details]
proposed tmpfiles.d config file

Comment 3 Mario Torre 2018-06-11 15:54:06 UTC
This seems like outside the control of the JDK, or perhaps as suggested we can add exclude of some kind, but seems to me a configuration issue rather than a bug (we could perhaps regenerate the font map, but I expect this to be quite a lot of refactoring, not sure how feasible it is to be honest).

I'll track the upstream bug and see if there's something we can do to fix in code, but I would suggest to work around by not deleting the files in the first place.

Comment 4 Mario Torre 2018-06-11 16:02:49 UTC
(In reply to Mario Torre from comment #3)
> This seems like outside the control of the JDK, or perhaps as suggested we
> can add exclude of some kind, but seems to me a configuration issue rather
> than a bug (we could perhaps regenerate the font map, but I expect this to
> be quite a lot of refactoring, not sure how feasible it is to be honest).
> 
> I'll track the upstream bug and see if there's something we can do to fix in
> code, but I would suggest to work around by not deleting the files in the
> first place.

Or perhaps we should move those files somewhere under /var/run/

Comment 5 Andrew John Hughes 2018-06-11 16:44:18 UTC
I see there's some refactoring in this area in 9:

changeset:   14040:5ddf42bdf7ca
user:        prr
date:        Tue Mar 22 14:46:48 2016 -0700
summary:     8055463: Need public API allowing full access to font collections in Font.createFont()

which might explain why they don't see it on that version in the OpenJDK bug.

/var/cache might be a better location for these files. I see it already has some font data on my local machine.

Comment 6 Mario Torre 2018-06-11 17:01:43 UTC
I can get a simple application to create the tmp font files, but I can't crash it. I would appreciate if you have a simple reproducer (possibly one that doesn't involve setting up jasper report and wait for 10 days!)

Comment 7 István Tóth 2018-06-14 20:22:40 UTC
I have realized that the referred OpenJDK bug, and my case are NOT identical.

While the symptoms and the trigger are the same, the actual crash occurs in a different native library.

The JDK-8051956 bug refers to the libt2k library, which is included in the Oracle JVM, while my crash occurs in the libfreetype.so library, which is used by OpenJDK.

That said, I am attaching attaching a reproducer that works on my Fedora system.

You can tweak the font root dir, and the number of times each font is loaded.

It seems that you need to load more than 20-30 fonts, AND you have to load them multiple times to trigger the bug.

Comment 8 István Tóth 2018-06-14 20:23:54 UTC
Created attachment 1451592 [details]
reproducer for the bug

Comment 9 István Tóth 2018-06-14 20:27:50 UTC
The reproducer works on my Centos 7.5 test system, as well.

Comment 12 zongyu 2024-11-01 07:00:00 UTC
How did you finally solve this problem? Have you made any modifications to the JDK code?
Can I only solve it by not deleting the .tmp file and is it possible to upgrade the JDK? Now I am using version 1.8.0_192.

Comment 13 Red Hat Bugzilla 2025-03-02 04:25:02 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days