Open djsell opened 3 years ago
I had more info in the readme for my test project. I'll add it here.
The problem with using ASSERTIONS
is that Blazor does not use Module.onRuntimeInitialized
to run initialization at the correct time.
https://emscripten.org/docs/porting/Debugging.html#debugging-assertions
An example of how Mono uses it: https://github.com/dotnet/runtime/blob/v6.0.0-preview.7.21377.19/src/mono/sample/wasm/browser/runtime.js#L13
@djsell thanks for contacting us.
If you want to attempt a fix for this, the relevant code is here.
Note that we are "late" in the current release and we will very conservative about taking any fix here for 6.0 unless we absolutely have to. I'll let @pranavkm and @SteveSandersonMS chime in too with their thoughts
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
@pranavkm this is an aspnetcore issue, your platform code calls into emscripten functions before it is supposed to.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I'm having the same issue happening with .NET 6 (released version), when using RunAOTCompilation
true in a publish+release build.
It does not happen if either:
build
instead of publish
Debug
config instead of Release
RunAOTCompilation
to false.I also experimented with moving the preRun
code to within onRuntimeInitialized
, this gets past the malloc
assertions but fails with a different assertion failure:
* Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:3096, condition `' not met
| 13466314 | @ | dotnet.6.0.0.epfcsc29vy.js:1424
| _emscripten_asm_const_int | @ | dotnet.6.0.0.epfcsc29vy.js:5422
| $func165895 | @ | 2763a776:0x90b38a7
| $func154179 | @ | 2763a776:0x8f46bc8
| $func165098 | @ | 2763a776:0x9092f6e
| $func165096 | @ | 2763a776:0x9092f0c
| $func165101 | @ | 2763a776:0x9092ff3
| $func165103 | @ | 2763a776:0x9093040
| $func165102 | @ | 2763a776:0x909300e
| $func150678 | @ | 2763a776:0x8ede5f5
| $func150540 | @ | 2763a776:0x8ed8f6a
| $func150546 | @ | 2763a776:0x8ed96e5
| $func163918 | @ | 2763a776:0x9069e9c
| $func164124 | @ | 2763a776:0x907115e
| $mono_wasm_load_runtime | @ | 2763a776:0x90b318a
| Module._mono_wasm_load_runtime | @ | dotnet.6.0.0.epfcsc29vy.js:9967
| ccall | @ | dotnet.6.0.0.epfcsc29vy.js:615
| (anonymous) | @ | dotnet.6.0.0.epfcsc29vy.js:635
| (anonymous) | @ | 5284268d-876b-4916-91c3-0f4ef0c798a5:476
| callRuntimeCallbacks | @ | dotnet.6.0.0.epfcsc29vy.js:1436
| postRun | @ | dotnet.6.0.0.epfcsc29vy.js:1143
| doRun | @ | dotnet.6.0.0.epfcsc29vy.js:11619
| run | @ | dotnet.6.0.0.epfcsc29vy.js:11632
| runCaller | @ | dotnet.6.0.0.epfcsc29vy.js:11587
| removeRunDependency | @ | dotnet.6.0.0.epfcsc29vy.js:1216
| receiveInstance | @ | dotnet.6.0.0.epfcsc29vy.js:1351
| (anonymous) | @ | 5284268d-876b-4916-91c3-0f4ef0c798a5:286
| async function (async) | |
| (anonymous) | @ | 5284268d-876b-4916-91c3-0f4ef0c798a5:277
| module.instantiateWasm
This is blocking my usage of AOT compilation in Blazor, which is an important feature for me.
I'm having the same issue happening with .NET 6 (released version), when using
RunAOTCompilation
true in a publish+release build.It does not happen if either:
- I use
build
instead ofpublish
- I use
Debug
config instead ofRelease
- I set
RunAOTCompilation
to false.I also experimented with moving the
preRun
code to withinonRuntimeInitialized
, this gets past themalloc
assertions but fails with a different assertion failure:This is blocking my usage of AOT compilation in Blazor, which is an important feature for me.
Exactly the same here!
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Describe the bug
Blazor with WebAssembly does not work when attempting to debug applications using emcc compiler options such as ASSERTIONS, STACK_OVERFLOW_CHECK, and SAFE_HEAP.
To Reproduce
https://github.com/djsell/BlazorWasm
Then load in the browser and check console log.
This project is just the Blazor template project +
EmccCompileOptimizationFlag
property added to the project file.Exceptions (if any)
Further technical details
ASP.NET Core 6.0.0-preview.7.21378.6 dotnet:
VS Code: