Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Blazor App Crashes in AOT mode with SkiaSharp.HarfBuzz in .NET 8 #3049

Open
1 task done
elepner opened this issue Oct 31, 2024 · 3 comments
Open
1 task done

Comments

@elepner
Copy link

elepner commented Oct 31, 2024

Description

The library SkiaSharp.HarfBuzz does not work at all in AOT mode with .NET 8 and 9, however everything works fine in .NET 7.
image

Code

The github repo with minimal project to reproduce:
https://github.com/elepner/harfbuzzsharp-wasm-aot-bug/tree/report_bug

Publish the project
dotnet publish -c Release -o wasm-output
navigate to the output folder wasm-output/wwwroot and start any http-server.

Expected Behavior

The app should not crash.

Actual Behavior

No response

Version of SkiaSharp

2.88.8 (Current)

Last Known Good Version of SkiaSharp

2.88.7 (Previous)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

Other (Please indicate in the description)

Platform / Operating System Version

Blazor

Devices

Google chrome

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mattleibow
Copy link
Contributor

Does it work with SkiaSharp 3.0?

@elepner
Copy link
Author

elepner commented Nov 4, 2024

If I update SkiaSharp.HarfBuzz to the version 3.0.0-preview.5.4 along with SkiaSharp.NativeAssets.WebAssembly I get the error

Unhandled exception rendering component: The type initializer for 'SkiaSharp.SKObject' threw an exception.
System.TypeInitializationException: The type initializer for 'SkiaSharp.SKObject' threw an exception.
 ---> System.InvalidOperationException: The version of the native libSkiaSharp library (116.0) is incompatible with this version of SkiaSharp. Supported versions of the native libSkiaSharp library are in the range [88.1, 89.0).

@elepner
Copy link
Author

elepner commented Nov 15, 2024

I have given a try to run this in .net9 with no success. There's another error which appears even in Debug mode.

logging.ts:43 MONO_WASM: instantiate_wasm_module() failed CompileError: WebAssembly.compileStreaming(): Compiling function #28714:"CompressionNative_Crc32" failed: expected 1 elements on the stack for fallthru, found 3 @+8898931

The code: https://github.com/elepner/harfbuzzsharp-wasm-aot-bug/tree/net9_bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants