dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.52k stars 4.53k forks source link

Disabling Blazor SIMD support breaks published app during runtime #103178

Open eduardocp opened 3 weeks ago

eduardocp commented 3 weeks ago

Description

I'm publishing with these parameters -p:WasmEnableSIMD=false

This is the runtime error I get when using the above parameters

blazor.webassembly.js:1  Error: raw cwrap mono_wasm_copy_managed_pointer not found
    at Za (dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:82931)
    at Bi (dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:116608)
    at dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:158681
    at dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:158804
    at Tl (dotnet.runtime.8.0.6.cfhqwq2l7j.js:3:173658)
    at dotnet.native.wasm:0x4ec1f
    at dotnet.native.wasm:0x1844a8
    at dotnet.native.wasm:0x17b71c
    at dotnet.native.wasm:0xbd8e4
    at dotnet.native.wasm:0x1daec
callEntryPoint @ blazor.webassembly.js:1
await in callEntryPoint (assíncrono)
mn @ blazor.webassembly.js:1
await in mn (assíncrono)
fn @ blazor.webassembly.js:1
An @ blazor.webassembly.js:1
(anônimo) @ blazor.webassembly.js:1
(anônimo) @ blazor.webassembly.js:1

I tried everything in https://github.com/dotnet/runtime/issues/100234 but without success.

Reproduction Steps

Was unable to make a vanilla project demonstrating this issue. My Blazor app is quite large and difficult to pare down to a working example.

Expected behavior

The app work normaly with WasmEnableSIMD=false

Actual behavior

The app crash

Regression?

These parameters are now required as a consequence of 8.0 incorporating SIMD, which isn't supported by all browsers/OSs/hardware, so there is no historical precedent

Known Workarounds

None known

Configuration

latest .net/win11/Chrome/Edge/asp on high-end recent intel Avell Storm Two laptop.

Other information

No response

maraf commented 2 weeks ago

The issue looks like this one https://github.com/dotnet/runtime/issues/94939. If that's the case, it was fixed and backported (https://github.com/dotnet/runtime/pull/102155) to .NET 8. Can you please try installing latest .NET 8 SDK (8.0.301) and verify the issue remains?

sgorozco commented 2 weeks ago

@eduardocp Hi! I experienced something very similar to what you describe. By any chance, do you have extra build configurations apart from Debugand Release? I had a custom build configuration named Release_Server. My publish profile was using that build configuration and the published application threw the same error as your description. However, if I switch to Release(even though I set it up exactly as I had my "Release_Server" configuration), the application runs fine, with SIMD correctly disabled and running on a Phenom II X6 processor.
image_2024_06_11T17_33_20_548Z

eduardocp commented 2 weeks ago

@sgorozco I used this combination to successfully publish:

dotnet publish -c Release --output my/output/path -p:WasmEnableSIMD=false -p:WasmNativeStrip=false

@maraf I didn't try to publish just with WasmEnableSIMD=false yet. I will do this soon.

dotnet-policy-service[bot] commented 1 day ago

This issue has been marked needs-author-action and may be missing some important information.