runtime: Blazor WASM applications on net8.0 freeze on startup on iOS 18 RC (22A3354) when built with AOT
Description
The Blazor WASM example project, when built against net8.0 with RunAOTCompilation, freezes on startup on iOS 18 Beta 2/3/4 (22A5297f/22A5307f/22A5316j). The same issue does not occur when building against net9.0 (-preview6), or when using iOS 18.0 beta 1 (22A5282m), iOS 17.5 or 16.4. It also doesn’t affect Safari Technology Preview for macOS. I’ve not been able to test it on macOS Beta, as I don’t have access to a Mac running the beta.
Reproduction Steps
dotnet new blazorwasm- Run
dotnet publish -p:RunAOTCompilation=true - Run
python3 -m http.server 9000 -b 0.0.0.0 -d bin/Release/net8.0/publish/wwwroot - Open <ip>:9000 on an iOS 18 Beta 4 device (real hardware or xCode Simulator)
Expected behavior
The application starts normally
Actual behavior
The application freezes on startup, with the loading indicator stuck at 100%.
The following logs are printed to console:
[Warning] MONO_WASM: Exception marshalling result of JS promise to CS: (dotnet.runtime.8.0.7.e9r13h23hd.js, line 3)
RuntimeError: Out of bounds memory access (evaluating 'St.mono_wasm_write_managed_pointer_unsafe(t,e)')
<?>.wasm-function[35357]
set — dotnet.runtime.8.0.7.e9r13h23hd.js:3:7696
release — dotnet.runtime.8.0.7.e9r13h23hd.js:3:8465
kr — dotnet.runtime.8.0.7.e9r13h23hd.js:3:35559
(anonymous function) — dotnet.runtime.8.0.7.e9r13h23hd.js:3:209727
(anonymous function) — dotnet.runtime.8.0.7.e9r13h23hd.js:3:42386
[Error] [object WebAssembly.Exception]
<?>.wasm-function[35231]
<?>.wasm-function[28152]
<?>.wasm-function[27916]
<?>.wasm-function[30579]
<?>.wasm-function[29954]
<?>.wasm-function[29960]
<?>.wasm-function[29984]
<?>.wasm-function[35328]
kr (dotnet.runtime.8.0.7.e9r13h23hd.js:3:35395)
(anonymous function) (dotnet.runtime.8.0.7.e9r13h23hd.js:3:209274)
Mr (dotnet.runtime.8.0.7.e9r13h23hd.js:3:37421)
Pr (dotnet.runtime.8.0.7.e9r13h23hd.js:3:37561)
Regression?
No response
Known Workarounds
No response
Configuration
Tested on the following configuration (net8.0), but the issue also occurs when building on Arch Linux, using SDK 8.0.107 with runtime 8.0.7. Appears to work fine when built against net9.0 using the same configuration.
.NET SDK:
Version: 9.0.100-preview.6.24328.19
Commit: ef4c241666
Workload version: 9.0.100-manifests.21d7f649
MSBuild version: 17.11.0-preview-24318-05+4a45d5633
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.5
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.100-preview.6.24328.19/
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[wasm-tools]
Installation Source: SDK 9.0.100-preview.6
Manifest Version: 9.0.0-preview.6.24327.7/9.0.100-preview.6
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100-preview.6/microsoft.net.workload.mono.toolchain.current/9.0.0-preview.6.24327.7/WorkloadManifest.json
Install Type: FileBased
[wasm-tools-net8]
Installation Source: SDK 9.0.100-preview.6
Manifest Version: 9.0.0-preview.6.24327.7/9.0.100-preview.6
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100-preview.6/microsoft.net.workload.mono.toolchain.net8/9.0.0-preview.6.24327.7/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 9.0.0-preview.6.24327.7
Architecture: arm64
Commit: static
.NET SDKs installed:
8.0.303 [/usr/local/share/dotnet/sdk]
9.0.100-preview.6.24328.19 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-preview.6.24328.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.6.24327.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Other information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 29
@radekdoulik Is there any potential work arounds for this? I’m a bit concerned by the .NET 10 milestone for something quite so production critical.
Since this may be an iOS bug, I filed a radar with Apple (FB14644808) containing a link to this issue.
That makes sense, all browsers on iOS use the same WebKit engine internally.
We have been seeing same thing with our application and only affects iOS18>, but it breaks in all browser types and not only Safari. It also breaks on latest MacOS in safari, but works in other browsers.
I’m getting the same on our Blazor web app, .NET 8.0.10 SDK and nuget packages, phone on IOS 18.0.1
We have the same problem. iOS 18 crashes with MONO_WASM: Exception marshalling result of JS promise to CS: (dotnet.runtime.8.0.7.e9r13h23hd.js, line 3) RuntimeError: Out of bounds memory access (evaluating ‘St.mono_wasm_write_managed_pointer_unsafe(t,e)’)
The https://github.com/dotnet/maui/issues/23390#issuecomment-2286943437 fix does not work with our Blazor WASM application.
Many of our iOs users are reporting the problem to us. Would be nice if this problem could be fixed asap.
Interestingly, I can reproduce that crash on Safari TP Release 203 (Safari 18.0, WebKit 19620.1.6)