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
[wasm] WebAssembly crashes if building with non-Release/Debug build config #101629
Comments
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
@RPGillespie6 Thank you for the report. It seems it is already fixed in .NET 9 previews, but the fix wasn't backported to .NET 8. Can you please try suggested workaround from #94939 (comment) ? |
Thanks, the suggested workaround from the linked comment appears to workaround the issue! We can close this issue. Is there an issue I can follow to track the progress of the backport to .NET 8 (or is backport not planned for .NET 8)? |
Let's leave this one open at the moment. I'll update it based on backport plan |
@maraf A few other related issues I've come across:
I get crashes on page load that look like this:
With emcc flag:
Without emcc flag:
If I remove the emcc flag from AOT builds, then I get a bunch of these at runtime: Since AOT is so much faster than JIT, I'm back to just using |
Description
Not actually sure if this is specifically a dotnet issue or a Skia issue, hoping to get some triage help.
Essentially the problem is that you cannot use custom build configurations if using SkiaSharp + WASM or it will mysteriously crash at runtime on SKPaint dispose (after a using block). But it usually doesn't crash right away, it takes around 79 dispose calls in the repro code before the crash:
Reproduction Steps
Repro repo: https://github.com/RPGillespie6/dotnet_skia_wasm_crash
Build with Release build configuration and observe that the code runs to completion. Build with Release_WASM build configuration and observe that the code crashes on SKPaint dispose after 79 iterations. Confirmed this repo reproduces the problem on 2 different PCs (one with Intel i9, one with AMD Ryzen 7).
We use custom build configurations to set different #if flags, so it's kind of annoying to work around. This is why I'm opening an issue with dotnet -- as far as I can tell, my custom config should have identical settings as
Release
since I used:But that doesn't seem to be the case. If I use my custom config, I get mysterious runtime crashes.
Expected behavior
Release
andRelease_WASM
build configs to produce identical runtime resultsActual behavior
Release_WASM
results in mysterious crash on after 79 Skia object disposalsRegression?
No response
Known Workarounds
Stick to only using
Release
orDebug
build configurationsConfiguration
Everything is in here: https://github.com/RPGillespie6/dotnet_skia_wasm_crash/blob/master/WasmOnly.csproj
Other information
No response
The text was updated successfully, but these errors were encountered: