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

[wasm] Blazor, or console template with AOT/relinking fails with: mono_wasm_load_runtime () failed Error: unreachable #90111

Closed
radical opened this issue Aug 7, 2023 · 2 comments · Fixed by #90145
Assignees
Labels
Milestone

Comments

@radical
Copy link
Member

radical commented Aug 7, 2023

log:
These were hit on #89754:

Wasm.Build.Tests.Blazor.MiscTests3.WithDllImportInMainAssembly(config: "Debug", build: False, publish: True) (log):

        Launching chrome ('/root/helix/work/correlation/chrome-linux/chrome') via playwright with args = --explicitly-allowed-ports=46619
        Waiting for page to load
        [error] MONO_WASM: mono_wasm_load_runtime () failed Error: unreachable
            at _mono_wasm_debugger_log (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:93622)
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[133]:0x5f9e
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5794]:0x18405c
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5768]:0x180cdb
            at Module._mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:110277)
            at ccall (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:101958)
            at Object.mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:102338)
            at Uu (http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:207818)
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197259
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197939
        [error] MONO_WASM: Error: unreachable
            at _mono_wasm_debugger_log (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:93622)
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[133]:0x5f9e
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5794]:0x18405c
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5768]:0x180cdb
            at Module._mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:110277)
            at ccall (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:101958)
            at Object.mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:102338)
            at Uu (http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:207818)
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197259
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197939
        [error] Error: Failed to start platform. Reason: Error: unreachable
            at Yt (http://127.0.0.1:46619/_framework/blazor.webassembly.js:1:55058)
            at async on (http://127.0.0.1:46619/_framework/blazor.webassembly.js:1:56628)

Similar failures in
WasmTemplateTests, and [Blazor.SimpleRunTests]https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-89754-merge-b12d1eaba86b4304bc/Workloads-NoWebcil-Wasm.Build.Tests.Blazor.SimpleRunTests/1/console.c3ec463d.log?helixlogtype=result).

cc @kg @pavelsavara

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 7, 2023
@ghost
Copy link

ghost commented Aug 7, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

log:
These were hit on #89754:

Wasm.Build.Tests.Blazor.MiscTests3.WithDllImportInMainAssembly(config: "Debug", build: False, publish: True) (log):

        Launching chrome ('/root/helix/work/correlation/chrome-linux/chrome') via playwright with args = --explicitly-allowed-ports=46619
        Waiting for page to load
        [error] MONO_WASM: mono_wasm_load_runtime () failed Error: unreachable
            at _mono_wasm_debugger_log (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:93622)
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[133]:0x5f9e
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5794]:0x18405c
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5768]:0x180cdb
            at Module._mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:110277)
            at ccall (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:101958)
            at Object.mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:102338)
            at Uu (http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:207818)
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197259
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197939
        [error] MONO_WASM: Error: unreachable
            at _mono_wasm_debugger_log (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:93622)
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[133]:0x5f9e
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5794]:0x18405c
            at http://127.0.0.1:46619/_framework/dotnet.native.wasm:wasm-function[5768]:0x180cdb
            at Module._mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:110277)
            at ccall (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:101958)
            at Object.mono_wasm_load_runtime (http://127.0.0.1:46619/_framework/dotnet.native.8.0.0-ci.lglyt991p3.js:8:102338)
            at Uu (http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:207818)
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197259
            at http://127.0.0.1:46619/_framework/dotnet.runtime.8.0.0-ci.zvz55o64uz.js:3:197939
        [error] Error: Failed to start platform. Reason: Error: unreachable
            at Yt (http://127.0.0.1:46619/_framework/blazor.webassembly.js:1:55058)
            at async on (http://127.0.0.1:46619/_framework/blazor.webassembly.js:1:56628)

Similar failures in
WasmTemplateTests, and [Blazor.SimpleRunTests]https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-89754-merge-b12d1eaba86b4304bc/Workloads-NoWebcil-Wasm.Build.Tests.Blazor.SimpleRunTests/1/console.c3ec463d.log?helixlogtype=result).

cc @kg @pavelsavara

Author: radical
Assignees: -
Labels:

arch-wasm, area-Build-mono, test-failure

Milestone: -

@radical radical added this to the 8.0.0 milestone Aug 7, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 7, 2023
@pavelsavara
Copy link
Member

This is not calling the imports too early (I suspected on the chat), because there is _mono_wasm_load_runtime on the stack.\

Probably emcc applyImportAndExportNameChanges during re-link
Then replace_linker_placeholders setting early enough, but with un-minified names, which the WASM side doesn't bind to.

I wonder if we could do it by index rather than by name.

@pavelsavara pavelsavara self-assigned this Aug 8, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 8, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 11, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants