pkg2appimage icon indicating copy to clipboard operation
pkg2appimage copied to clipboard

Blacklist libharfbuzz.so.*

Open probonopd opened this issue 8 years ago • 26 comments

Bundling HarfBuzz seems to cause symbol lookup error: /usr/lib64/libpangoft2-1.0.so.0: undefined symbol: hb_buffer_set_cluster_level.

rm usr/lib/libharfbuzz.* # Workaround for: csl: symbol lookup error: /usr/lib64/libpangoft2-1.0.so.0: undefined symbol: hb_buffer_set_cluster_level Example: https://github.com/probonopd/cubelister/blob/patch-1/.travis.yml

probonopd avatar Aug 14 '17 21:08 probonopd

Also in linuxdeployqt

probonopd avatar Aug 14 '17 21:08 probonopd

But then, whenever we (must?) bundle libgtk-3.so.0 then seemingly we also must bundle this, in order not to run into this...

probonopd avatar Aug 20 '17 09:08 probonopd

Ran into the same issue with undefined symbol hb_buffer_set_cluster_level when bundling an application using debian jessie libraries and running it on debian stretch. I think libharfbuzz is one of the basic libraries and should be taken from the system.

FreeSlave avatar Sep 20 '17 14:09 FreeSlave

I don't know a) where this error comes from and b) how to solve it best. Maybe ask the HarfBuzz team?

probonopd avatar Sep 21 '17 16:09 probonopd

I think the origin of error is pretty obvious. libharfbuzz on debian jessie does not have hb_buffer_set_cluster_level function and libpangoft2 does not reference it. While on debian stretch libpangoft2 has a reference to hb_buffer_set_cluster_level. So packing old libharfbuzz while not packing libpangoft2 leads to the situation when the newer libpangoft2 (the system one) is used with old libharfbuzz (the packed one), therefore symbol can't be found.

FreeSlave avatar Sep 21 '17 17:09 FreeSlave

So you're saying we should bundle libpangoft2-1.0-0 too?

probonopd avatar Sep 21 '17 18:09 probonopd

Either bundle both libharfbuzz and libpangoft2 (and probably other pango libraries) or neither of them.

FreeSlave avatar Sep 21 '17 19:09 FreeSlave

So what's the decision? Will you add harfbuzz to the excludelist?

FreeSlave avatar Nov 06 '17 15:11 FreeSlave

Which way do you think makes more sense, @FreeSlave?

TheAssassin avatar Nov 06 '17 15:11 TheAssassin

@TheAssassin the post above referenced another issue with gtk3 in mypaint. I did not go into details of the situation with mypaint though. libharfbuzz depends on libfreetype, so removing libfreetype from bundle may fix the issue in that particular case (if it was bundled. Again, I don't know the whole thing just from one issue) to avoid the situation when the system libharfbuzz requires some functions from libfreetype which are missing from the bundled version (which happens to be too old). Is it ok to remove libfreetype from bundle? Because if we don't bundle libharfbuzz then we should not bundle libfreetype either (at least the old versions). What I know for sure is what I already told. Bundling libharfbuzz cause issues when libpangoft2 is not bundled. The issue with libpangoft2 referenced in excludelist is Not Found page, so I can't say more.

FreeSlave avatar Nov 06 '17 16:11 FreeSlave

basically the libharfbuzz for libpangoft2 is the same as libfreetype for libharfbuzz. One from the system may require symbols that may be missing in the bundled version. So we either bundle them all or none of them. If we consider all these libraries to always present on the target system, then we may remove them from bundle. If we do remove them from bundle there might be reverse situation though. Some lib (e.g. libgtk3) which we bundle may require some functions from the libs mentioned above which may be missing on the target system (i.e. old distro, which contain old libraries which don't have needed symbols). So it all rests against the issue with pangoft2. But https://github.com/probonopd/AppImages/issues/240 pointed in excludlist is a dead link. I need to know details of that case.

FreeSlave avatar Nov 06 '17 16:11 FreeSlave

The problem is, both seem suboptimal. I tend to the "remove all conflicting libraries" option.

@probonopd I'd remove libharfbuzz, libpangoft2 and libfreetype, add a notice about them to the excludelist, and hope for the best. If there should be problems, I'm sure people will step up to us.

TheAssassin avatar Nov 06 '17 18:11 TheAssassin

But https://github.com/probonopd/AppImages/issues/240 pointed in excludlist is a dead link. I need to know details of that case.

https://github.com/AppImage/AppImages/issues/240

Also check the comments in https://github.com/AppImage/AppImages/blob/master/excludelist

probonopd avatar Nov 06 '17 18:11 probonopd

Seems like rpcs3 no longer uses pango at all and I'm really lazy about building the AppImage of fallible version myself.

FreeSlave avatar Nov 06 '17 20:11 FreeSlave

This TrenchBroom AppImage (built on Ubuntu 14.04, see build script) outputs an error when run on Fedora 27:

./TrenchBroom-x86_64.AppImage: symbol lookup error: /lib64/libharfbuzz.so.0: undefined symbol: FT_Get_Var_Blend_Coordinates

Calinou avatar Feb 18 '18 13:02 Calinou

FT_Get_Var_Blend_Coordinates

FT is a hint it's related to pangoft2.

Feel free to send a PR blacklisting both pangoft2 and harfbuzz in the AppImages repository. We really should push a fix now.

TheAssassin avatar Feb 18 '18 13:02 TheAssassin

Do we have a clear course of action (known good solution) for this?

probonopd avatar Feb 18 '18 13:02 probonopd

https://github.com/AppImage/AppImageKit/issues/454#issuecomment-342213583 and https://github.com/AppImage/AppImageKit/issues/454#issuecomment-342235269.

TheAssassin avatar Feb 18 '18 13:02 TheAssassin

@Calinou please remove libharfbuzz, libpangoft2 and libfreetype from your AppImage and retry. Does the issue go away, and does the AppImage still work?

probonopd avatar Feb 18 '18 15:02 probonopd

Once I remove libharfbuzz and libfreetype (there's no libpangoft2 in my AppImage), it runs but it looks ugly (the system theme isn't used, which isn't the case with a dynamically-linked build from an Ubuntu 16.04 container). I can see those warnings in the console:

(AppRun:5826): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS32

(AppRun:5826): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS32

(AppRun:5826): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS32

(AppRun:5826): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS32

(AppRun:5826): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libpixmap.so: wrong ELF class: ELFCLASS32

(AppRun:5826): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

Calinou avatar Feb 18 '18 16:02 Calinou

@Calinou can you try to bundle libpangoft2 then, please? Just cp it in your build recipe.

TheAssassin avatar Feb 18 '18 16:02 TheAssassin

I just tried that, but I still get the same error (AppImage with libpangoft2 bundled).

Calinou avatar Feb 18 '18 22:02 Calinou

Is this still an issue?

probonopd avatar Nov 19 '18 18:11 probonopd

Well, was it blacklisted?

You should transfer this issue into AppImages.

TheAssassin avatar Nov 20 '18 00:11 TheAssassin

Expect to see trouble ahead with HarfBuzz again. This time they removed hb_subset_input_set_retain_gids in libharfbuzz 3.0.0 without increasing the so version, which still comes as libharfbuzz.so.0.

All Electron apps may lo longer be working if the AppImage does not bundle libharfbuzz privately and the libharfbuzz version in the system is updated to 3.0.0 or higher.

Reference: https://github.com/harfbuzz/harfbuzz/issues/3216

Update: According to https://github.com/harfbuzz/harfbuzz/issues/3216#issuecomment-947139532

The breakage you are experiencing is in the separate libharfbuzz-subset.so

So it looks like we can leave libharfbuzz.so on the excludelist as long as libharfbuzz-subset.so gets privately bundled.

probonopd avatar Oct 19 '21 16:10 probonopd

Well, was it blacklisted?

Yes:

https://github.com/AppImage/pkg2appimage/blob/477590ddb3751436e24f479bfbc8b44659936b04/excludelist#L115

But if hb_subset_input_set_retain_gids turns out to become the problem I expect it to, then we may be forced to remove it from the blacklist and privately bundle it again (because apparently it is a moving target with missing symbols within the same major version).

probonopd avatar Oct 19 '21 16:10 probonopd