FFMPEG, undefined symbol hb_glib_script_to_script

I have several commercial applications that rely on FFMPEG or a subdependency,libpango, and potentially others. One of those packages breaks on my system since either FFMPEG's or libpango's version and compile options are now different than the stock Ubuntu version. I'm not sure which programs rely on FFMPEG or libpango as a dependency, or how to find out which versions are used.

The original error:

ffmpeg: symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_glib_script_to_script

If I check to see if libpango has the symbol I can see it doesn't:

> readelf -a /lib/x86_64-linux-gnu/libpango-1.0.so.0 | grep hb_glib_script_to_script
    85: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND hb_glib_script_to_script

I've checked the other locations like /usr/local and ~/.snap/* and those instances of libpango also list that symbol as undefined.

I was wondering if a package may have a conflicting version of the library that may be overriding. I don't see any signs of that though.

> apt-cache rdepends --installed ffmpeg
ffmpeg
Reverse Depends:
  bitwig-studio
    ffmpeg:i386
  imagemagick-6.q16
    ffmpeg:i386
  imagemagick-6.q16
    ffmpeg:i386

Checking for the symbol error, I ran into this: https://unix.stackexchange.com/questions/599152/debian-libpangoft2-1-0-so-0-undefined-symbol-hb-glib-script-from-script

It suggested reinstalling libharfbuzz0b which is the underlying library that should supply the symbol. I reinstalled it:

> sudo apt update && sudo apt reinstall libharfbuzz

I still get this error.

I then checked if there are multiple instances of FFMPEG, which there isn't. There ARE multiple copies of libpango, however the duplicates are in ~/.snap and shouldn't resolve before the system version.


Solution 1:

The underlying library libharfbuzz0b was included in the Bitwig specific folder: /opt/bitwig-studio/lib, however their build didn't export the symbol. For some reason the programs scoped .so files override the system shared objects, causing this issue.

I tracked down the dependencies of the library by running:

ldd /lib/x86_64-linux-gnu/libpango-1.0.so.0

This showed that there were the appropriate files in expected locations. Running:

> readelf -s /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 | grep hb_glib_script_to_script
   439: 00000000000cdff0     9 FUNC    GLOBAL DEFAULT   14 hb_glib_script_to_script

shows that it should be there. I tracked down the issue by running locate to find any instances of libharfbuzz

> locate libharfbuzz | grep .so
/usr/lib/x86_64-linux-gnu/libharfbuzz.so.0
/usr/lib/x86_64-linux-gnu/libharfbuzz.so.0.20600.4
/opt/bitwig-studio/lib/bitwig-studio/libharfbuzz.so.0
/opt/bitwig-studio/lib/jre/lib/libharfbuzz.so

shows that the file is actually included directly in Bitwig. Running readelf -s /opt/bitwig-studio/lib/bitwig-studio/libharfbuzz.so.0 the symbol isn't defined.