Bug 2004078

Summary: java-17-openjdk / rhel-8.5: libfontmanager.so has missing dependency on harfbuzz library
Product: Red Hat Enterprise Linux 8 Reporter: zzambers
Component: java-17-openjdkAssignee: Andrew John Hughes <ahughes>
Status: CLOSED ERRATA QA Contact: OpenJDK QA <java-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: bernhard.schuhmann, jandrlik, sgehwolf
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-17-openjdk-17.0.0.0.35-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2012821 (view as bug list) Environment:
Last Closed: 2022-05-10 13:32:30 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:

Description zzambers 2021-09-14 13:28:27 UTC
Openjdk's (java-17-openjdk) libfontmanager.so has missing dependency on harfbuzz library on rhel-8.5. As a result several of our tests throw UnsatisfiedLinkError:

java.lang.UnsatisfiedLinkError: /mnt/ramdisk/java-17-openjdk-17.0.0.0.33-0.5.ea.el8.x86_64/jdk/lib/libfontmanager.so: /mnt/ramdisk/java-17-openjdk-17.0.0.0.33-0.5.ea.el8.x86_64/jdk/lib/libfontmanager.so: undefined symbol: hb_font_funcs_set_glyph_h_advance_func
...


ldd /usr/lib/jvm/java-17-openjdk-17.0.0.0.33-0.5.ea.el8.x86_64/lib/libfontmanager.so | grep harfbuzz

(prints nothing)


Interestingly, rhel-9 is not affected by this issue:
ldd /usr/lib/jvm/java-17-openjdk-17.0.0.0.33-0.5.ea.el9.x86_64/lib/libfontmanager.so  | grep harfbuzz
	libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007effdc18d000)


openjdk nvr:
java-17-openjdk-17.0.0.0.33-0.5.ea.el8

Comment 2 zzambers 2021-09-14 13:36:34 UTC
Just as experiment I tried to patch libfontmanager.so by adding dependency on libharfbuzz.so.0, using patchELF (see [1]) in rhel-8 VM. It fixed this issue.

[1] https://stackoverflow.com/questions/4221876/can-i-add-a-library-refence-to-existing-shared-object/32757594#32757594

Comment 3 Andrew John Hughes 2021-09-18 02:56:23 UTC
This was JDK-8272332; a typo in JDK-8272332 meant the HarfBuzz linker flags were never added and the practice of allowing undefined symbols meant this didn't show up during the build.

Comment 8 bernhard.schuhmann 2021-10-07 13:46:37 UTC
Rhel-7 is also affected, in my case it's /usr/lib/jvm/java-17-openjdk-17.0.0.0.35-1.rolling.el7.x86_64/lib/libfontmanager.so, and undefined symbol: hb_font_funcs_set_glyph_v_kerning_func.

Thanks, @zzambers for the workaround!

Comment 9 zzambers 2021-10-11 11:27:35 UTC
Hmm, it indeed also affects EPEL7. I have made clone of this bug for java-latest-openjdk/epel7:
https://bugzilla.redhat.com/show_bug.cgi?id=2012821

Comment 13 errata-xmlrpc 2022-05-10 13:32:30 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 (java-17-openjdk bug fix and enhancement update), 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://access.redhat.com/errata/RHEA-2022:1768