SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

[BUG] linux-riscv64/libSkiaSharp.so: undefined symbol: FT_Get_BDF_Property

Open 4Darmygeometry opened this issue 8 months ago • 19 comments

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

4Darmygeometry avatar Apr 09 '25 11:04 4Darmygeometry

Image

4Darmygeometry avatar Apr 09 '25 11:04 4Darmygeometry

@mattleibow

4Darmygeometry avatar Apr 09 '25 12:04 4Darmygeometry

@kasperk81

4Darmygeometry avatar Apr 09 '25 12:04 4Darmygeometry

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.

kasperk81 avatar Apr 09 '25 12:04 kasperk81

https://github.com/mono/SkiaSharp/pull/3221

4Darmygeometry avatar Apr 11 '25 12:04 4Darmygeometry

This issue also happens on linux-arm64

jeromelaban avatar Apr 14 '25 14:04 jeromelaban

It's working fine on linux-x64 for me though, maybe there's a variation in my setup that makes it work.

jeromelaban avatar Apr 14 '25 15:04 jeromelaban

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.

jeromelaban avatar Apr 15 '25 19:04 jeromelaban

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.

kasperk81 avatar Apr 15 '25 20:04 kasperk81

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).

HakanL avatar May 09 '25 05:05 HakanL

I'm having the same issue in a Rpi CM4 device, but with a different symbol.

https://github.com/unoplatform/uno/issues/20429

mcNets avatar May 26 '25 15:05 mcNets

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 :(

YuriiYa avatar May 28 '25 21:05 YuriiYa

Having the same isse on pi5 Debian Arm64, while running jellyfin.

anshulpatel25 avatar May 31 '25 16:05 anshulpatel25

Same as you @anshulpatel25 but on pi5 plus and linuxserver/jellyfin image. I created this issue: https://github.com/linuxserver/docker-jellyfin/issues/298

SpiZeak avatar Jun 12 '25 07:06 SpiZeak

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?

Riton2013 avatar Aug 08 '25 06:08 Riton2013

Carsh Log: libSkiaSharp.so: undefined symbol: uuid_parse

how to deal with this?

install libuuid

kasperk81 avatar Aug 08 '25 09:08 kasperk81

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

marioleed avatar Aug 28 '25 12:08 marioleed

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.

github-actions[bot] avatar Sep 08 '25 17:09 github-actions[bot]

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

  1. Check which libfreetype you have:
    ldconfig -p | grep freetype
    
    Look for something like libfreetype.so.6. And take path from there

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

YuriiYa avatar Sep 11 '25 07:09 YuriiYa