[BUG] linux-riscv64/libSkiaSharp.so: undefined symbol: FT_Get_BDF_Property
Description
A RISC-V 64 .NET 9.0 application can't run with this error: /home/gamma/Downloads/WattToolkit/Steam++: symbol lookup error: /home/gamma/Downloads/WattToolkit/native/linux-riscv64/libSkiaSharp.so: undefined symbol: FT_Get_BDF_Property SkiaSharp version:3.119.0-preview.1.2
Code
https://github.com/4Darmygeometry/SteamTools
Expected Behavior
No response
Actual Behavior
No response
Version of SkiaSharp
Other (Please indicate in the description)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Linux
Platform / Operating System Version
AOSC OS 12.1
Devices
QEMU virtual RISC-V 64 machine
Relevant Screenshots
No response
Relevant Log Output
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
@mattleibow
@kasperk81
https://github.com/conan-io/conan-center-index/issues/17142#issuecomment-1520044126 (and this is for arch=x86_64)
Apologies you are experiencing this - the QtWebEngine is not built by default by our CI service (it's unlikely it's required by most users and it does take considerable time and resources to build), so this configuration is less tested than the defaults.
same applies here
and it's not specific to riscv64. you will find the same issue with x86_64 etc. with same (new) version of fontconfig.
https://github.com/mono/SkiaSharp/pull/3221
This issue also happens on linux-arm64
It's working fine on linux-x64 for me though, maybe there's a variation in my setup that makes it work.
Looking further into this, the dependency is about libfreetype2 which requires 2.15 or later. My system is a RPi Debian bookwork which installs 2.14 at most and explains the error, specifically.
Edit: This is for risc, not the other targets, which require 2.13, which does not explain my error, after all.
https://github.com/search?q=FT_Get_BDF_Property+undefined&type=issues something tells me it's not the first time this error is seen, and not for a specific arch (reported against x64 and arm64). see @vejmartin comment https://github.com/microsoft/vcpkg/issues/11985#issuecomment-646473111. so it depends on multiple factors, versions, how lib was built and system configurations of where it is being used.
I'm getting the same on a Raspberry Pi 3 using Bookworm (Raspbian) running arm64. The latest available libfontconfig1 version (via bookworm apt sources) is 2.14.1-4 (if the issue is actually related to that package/library).
I'm having the same issue in a Rpi CM4 device, but with a different symbol.
https://github.com/unoplatform/uno/issues/20429
Having the same issue on pi5 Debian Arm64 /home/pi5-dos/dotnet/dotnet: symbol lookup error: .../bin/Debug/net9.0-desktop/runtimes/linux-arm64/native/libSkiaSharp.so: undefined symbol: FT_Get_BDF_Property :(
Having the same isse on pi5 Debian Arm64, while running jellyfin.
Same as you @anshulpatel25 but on pi5 plus and linuxserver/jellyfin image. I created this issue: https://github.com/linuxserver/docker-jellyfin/issues/298
Have same problem, work well on Linux-x64, but crash on Linux-arm64
Carsh Log: libSkiaSharp.so: undefined symbol: uuid_parse
how to deal with this?
Carsh Log: libSkiaSharp.so: undefined symbol: uuid_parsehow to deal with this?
install libuuid
I ran into both of these errors:
/usr/share/dotnet/dotnet: symbol lookup error: /my-app/runtimes/linux-arm64/native/libSkiaSharp.so:
undefined symbol: uuid_generate_random
/usr/share/dotnet/dotnet: symbol lookup error: /my-app/runtimes/linux-arm64/native/libSkiaSharp.so:
undefined symbol: FT_Get_BDF_Property
Using libs:
- SkiaSharp 3.119.0
- SkiaSharp.HarfBuzz 3.119.0
- SkiaSharp.NativeAssets.Linux 3.119.0
What fixed it for me on a Raspberry Pi CM4 running Debian 11 with .NET 8 (tested separately with both the SDK and the ASP.NET Core Runtime):
sudo apt-get update
sudo apt-get install -y libuuid1 libfreetype6 libharfbuzz0b libfontconfig1
Then I edited my systemd service and added:
[Service]
Environment=LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libfreetype.so.6:/lib/aarch64-linux-gnu/libuuid.so.1
Environment=LD_LIBRARY_PATH=/my-app/runtimes/linux-arm64/native
Finally, restart service:
sudo systemctl daemon-reload
sudo systemctl restart my-app.service
Triage Summary
Labels will be applied to indicate the affected platform (Linux), the reliability concerns due to a crash, and the specific area (libSkiaSharp.native) related to the issue.
This issue does not appear to be a regression; however, it highlights reliability concerns in the native bindings on RISC-V 64 architecture.
Additional remarks:
- The issue discusses a symbol lookup error related to the SkiaSharp library but does not mention any specific backend technologies such as Metal, OpenGL, PDF, Raster, or Vulkan.
Detailed Summary and Actions
Summary of the triage:
- The problem is expressly linked to the Linux platform as mentioned in the issue description.
- The reliability concerns arise from a crash caused by an undefined symbol error, which signifies unexpected behavior.
- The specific area of concern pertains to the native bindings of the SkiaSharp library, particularly on the RISC-V 64 architecture.
Summary of the actions that will be performed:
| Action | Item | Description |
|---|---|---|
| Apply Label | os/Linux | The issue explicitly mentions the platform as Linux in the description, making it relevant. |
| Apply Label | tenet/reliability | The issue describes a crash due to an undefined symbol error when trying to run an application. |
| Apply Label | area/libSkiaSharp.native | The issue pertains to a symbol lookup error related to the native SkiaSharp library. |
This entire triage process was automated by AI and mistakes may have been made. Please let us know so we can continue to improve.
regarding undefined symbol: FT_Get_BDF_Property error:
- The error is caused by a mismatch between the version of libfreetype installed on your system and the one expected by libSkiaSharp.so.
The correct version of libfreetype needed to be loaded.
Step 1: Find the Correct libfreetype
- Check which libfreetype you have:
Look for something like libfreetype.so.6. And take path from thereldconfig -p | grep freetype
Step 2: Set LD_PRELOAD
You can force your application to use the correct version of libfreetype by setting the LD_PRELOAD environment variable.
Example:
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libfreetype.so.6
dotnet run --framework=net9.0-desktop