Closed Sean4572435243 closed 6 months ago
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | Sean4572435243 |
---|---|
Assignees: | - |
Labels: | `arch-wasm`, `untriaged`, `needs-area-label` |
Milestone: | - |
Same error occurs in aspnetcore 8.0.1 dotnet.runtime.8.0.1.rswtxkdyko.js:3 Blazor with lazy loaded DLLs works in windows 11, not in windows 10
Chrome version Version 120.0.6099.217 (Official Build) (64-bit) in both windows 10 and windows 11 VMS
Not sure if it's the windows version or because the hyper-v host hardware is different. Also, the Windows 11 VM runs on a windows 11 host laptop, the failing windows 10 vm runs on a server 2012 R2 hyper-v host.
Latest upgrade of Visual Studio to 17.8.5 didn't help.
Adding OS/hardware info Server 2012 R2 Standard Intel Atom CPU C3850 @ 2.10GHz 64 GB ram
I can't reproduce it locally on a simple blazor app with lazy loading compiled with AOT on Win10. Could you please verify if the issue produces for you if you create a simple repro app? If not, is your app publicly accessible? Or could you extract a minimal repro? Also, does the error occur during startup or when the lazy assembly is loaded and used?
Hi Maraf, thanks for following up. I'm working on this exact thing. The problem is it's such a big interconnected app, that it's difficult to dissect and still have a working product. Please allow me some time to try to isolate the issue
No relief with 8.0.2
I was finally able to create a vanilla project that demonstrates this issue (attached).
SampleCode.zip
AOT_wwwroot.zip
SampleCode.zip contains the vanilla Hello World Blazor app
AOT_wwwroot.zip contains the AOT compiled and published files that sit under wwwroot. You should be able to drop those files in IIS and load it in chrome.
To reiterate, the contents of AOT_wwwroot.zip work fine under windows 11 VM (my development laptop). This suggests to me that the code itself isn't the problem, particularly since it's the default vanilla project. The problem appears to be some combination of these datapoints:
No relief with 8.0.3
I still can't reproduce it. I have tried the zip provided, on my Win 10 machine (12yo), also inside of another Win 10 in Hyper-V. I don't have access to Windows Server machine.
But if it is that specific, it seems more like a Chrome bug. Can you try Firefox in your environment?
Unfortunately FireFox isn't supported by my app (needs Chromium).
Same problem exhibited by Edge (as expected because it's also Chromium)
Now that you've confirmed it's not related to Hyper-V, do you know if you have TLS hardware support on the host machine where you tested the Windows 10? To me, that would be the smoking gun if you do have TLS.
Managed to wire up access to the web server via the host 2012 R2 machine so I could test on bare metal, and same problem, though the version of Chrome is much older because it won't update on 2012 R2 since it's essentially Windows 8. This makes me suspect that it's host OS limitations creeping into the VM, which is what I was trying to avoid by creating the Win10 VM.
In either case of TLS or 2012 R2 being the cause, it may amount to "not supported due to age" rather than a bug, which isn't unacceptable.
do you know if you have TLS hardware support on the host machine where you tested the Windows 10?
I have tested it on CPU Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
. Does it help?
Thanks for the info. I've been unfortunately referring to TLS, when I actually meant TPM, which is a motherboard feature. Apologies for the confusion.
Found some time to build out a bunch of VMs to test various scenarios, including testing Chrome on Ubuntu under varied hosts and also installed Server 2012 R2 as a VM on my laptop under a win11 host. The final conclusion is that since the upgrade of Blazor from 7.x to 8.0.x, Blazor will not work reliably on any windows 8 based OS (server 2012 R2 for example, whether host or VM), but more obscurely, nor will any VMs of 'any' OS support Blazor 8.0.x if the host is windows 8 based.
This isn't a an entirely unacceptable scenario, particularly since Google has made it clear that support for Chrome in windows 8 has been discontinued. It's not quite as much of an edge-case as it may appear since 2012 R2 I believe is still actively supported by Microsoft and thus that entire demographic has been eliminated from hosting Blazor, but I imagine this was unavoidable and probably makes more sense to let win8 fade into the sunset rather than handicap Blazor to make it work.
Took a lot of discovery to figure this out. If possible, it would be nice if Blazor could cleanly identify whether it's operating in a win8 environment, or infer the host is Win8, and give appropriate 'unsupported OS or host OS' feedback to the user/developer.
If Microsoft wants to consider continuing support for Blazor on server 2012 R2 bare metal or VM, I believe my prior demo app should demonstrate the issue to you.
Thanks for the info. I've been unfortunately referring to TLS, when I actually meant TPM, which is a motherboard feature. Apologies for the confusion.
Then the answer is no.
If possible, it would be nice if Blazor could cleanly identify whether it's operating in a win8 environment, or infer the host is Win8, and give appropriate 'unsupported OS or host OS' feedback to the user/developer.
Since WebAssembly is isolated in the browser, this seems like some kind of bug in Chrome, that it thinks something should work but it doesn't. What changed between .NET 7 and 8 is SIMD, but we check that browser supports it and provide a message when it doesn't. And Chrome 120 support SIMD, but maybe it doesn't work on Win 8? You can try to disable it by setting MSBuild properties WasmEnableSIMD
and WasmEnableExceptionHandling
to false
https://github.com/maraf/dotnet-wasm-nosimd/blob/main/src/NoSIMD/NoSIMD.csproj#L5-L6
@lewing Any ideas?
Those two property settings did the trick! But at what cost lol..
What particular Blazor features am I giving up by disabling SIMD? Is SIMD merely a GPU bridge? Or are there C# performance enhancements outside of media playback that benefit from SIMD?
I should add that I have zero multimedia elements in my Blazor app. Does Blazor always demand SIMD functionality (unless disabled like you suggested), or is this triggered by specific code? Because if it's possible to dynamically enable disable functionality based on SIMD compatibility, it makes more sense to do that than permanently deprecate SIMD to salvage the Win8 demographic.
If you need to support Win 8 only for development inner loop, you can set properties only for build (unset them for publish) or condition them for Debug
configuration.
What particular Blazor features am I giving up by disabling SIMD? Is SIMD merely a GPU bridge? Or are there C# performance enhancements outside of media playback that benefit from SIMD?
More info in https://github.com/dotnet/runtime/blob/main/src/mono/wasm/features.md#simd---single-instruction-multiple-data
Because if it's possible to dynamically enable disable functionality based on SIMD compatibility, it makes more sense to do that than permanently deprecate SIMD to salvage the Win8 demographic.
In .NET 8 we don't have a built-in way to dynamicly switch between SIMD and non-SIMD versions. There is a working customer based solution, which involves building twice and then dynamicaly check on runtime which version to download https://github.com/dotnet/runtime/issues/89302#issuecomment-1935806348. In .NET 9 we are looking at supporting it in the box.
I'm going to close the issue now. Feel free to reopen if you have more questions
I was actually hoping to include Win8 as a target demographic, not just for development purposes, but after reading your link about the performance increases on basic functionality, it's a no-brainer to retain SIMD functionality and possibly pursue your dual-build recommendation.
To help those that hit this issue in the future, your link could be updated to also mention lack of compatibility with older OS's such as win8 (server 2012 R2) and older, as bare metal or VM, and especially important to mention how 'any' type of OS VM under these older OS hosts will fail, which is really difficult to troubleshoot. And if possible more informative system errors to the console.
Thanks for all your patience and help through this challenging issue. Much appreciated.
As a sidenote, it would be a useful feature to allow both simd and non-simd code to be compiled together (at the cost of size), and blazor would just fail-over to non-simd code when appropriate.
Worth noting that setting MSBuild properties WasmEnableSIMD and WasmEnableExceptionHandling to false without AOT=true during publishing, breaks the app
I can't repro it on my sample. Does the compilation break or during runtime? Does it repro on app from template?
It breaks during runtime just as blazor.webassembly.js is firing up, but works flawlessly when instead AOT=true during publish.
Couldn't reproduce with a vanilla project either, which is unfortunate because there's little I can do to pare my monster app down to create a sample.
I'm publishing with these parameters -p:BlazorWebAssemblyRuntimeOptions="--no-jiterpreter-simd-enabled --no-jiterpreter-wasm-eh-enabled" -p:WasmEnableSIMD=false -p:WasmEnableExceptionHandling=false
This is the runtime error I get when using the above parameters and AOT=false
blazor.webassembly.js:1 Error: raw cwrap mono_wasm_copy_managed_pointer not found
at Xa (dotnet.runtime.8.0.3…kvxvq3vc.js:3:82777)
at Di (dotnet.runtime.8.0.3…vxvq3vc.js:3:116454)
at dotnet.runtime.8.0.3…vxvq3vc.js:3:158428
at dotnet.runtime.8.0.3…vxvq3vc.js:3:158551
at xl (dotnet.runtime.8.0.3…vxvq3vc.js:3:173405)
at dotnet.native.wasm:0x4e6d5
at dotnet.native.wasm:0x180fdc
at dotnet.native.wasm:0x178226
at dotnet.native.wasm:0xbb9ae
at dotnet.native.wasm:0x1da25
Removing the publish parameters allows the app to start successfully when AOT=false.
This issue isn't a showstopper for me because I only need to include these publish parameters when publishing with AOT=true, and that seems to work.
@Sean4572435243 Can you please validate that this issue isn't caused by stale http cache? (run the app on different port, anonymous browser window, ...)
@Sean4572435243 Can you please validate that this issue isn't caused by stale http cache? (run the app on different port, anonymous browser window, ...)
Yes sir, just confirmed in different browsers (latest edge and chrome), also flushing cache with chrome://settings/clearBrowserData with all advanced settings for all time, on win 11 laptop with SIMD capabilities
Should this issue be broken out from this thread perhaps?
Should this issue be broken out from this thread perhaps?
Yes, please
@Sean4572435243 What does dotnet --info
print for you? Does the issue persist if you update workload (dotnet workload update
or dotnet workload install wasm-tools
)?
Moved to here https://github.com/dotnet/runtime/issues/100234
Is there an existing issue for this?
Describe the bug
This is a corollary to this same issue that now has a workaround: https://github.com/dotnet/runtime/issues/95322. I'm breaking out a specific lingering problem with Windows 10 here.
In the mentioned issue 95322, AOT compilation breaks Blazor if it utilizes LazyLoaded references. This came about because in 8.0.0, now the WasmDedup setting in the csproj is set to true by default (historically was false). By inserting
<WasmDedup>false</WasmDedup>
into the csproj, the Blazor app loads and works as expected; but only on my Windows 11 VM on my development laptop.
I then tested the Blazor app on my Windows 10 sanity VM on my server, and it continues to exhibit breaking problems, which is quite strange given the following:
I hope this sufficiently isolates the issue to AOT:true and Windows 10. The specs for the Win 10 machine:
Expected Behavior
Expect Blazor to work ubiquitously or nowhere, given the same published code and Chrome version. To have OS or possibly hardware distinctions that break the app, seems difficult to mitigate or predict.
Steps To Reproduce
Unfortunately I do not have the time resources necessary to carve out this issue
Exceptions (if any)
.NET Version
8.0.100
Anything else?
Version details
Chrome version on both Win 10 and 11 Version 120.0.6099.71 (Official Build) (64-bit) ASP.NET 8.0.0 Microsoft Visual Studio Professional 2022 Version 17.8.3 VisualStudio.17.Release/17.8.3+34330.188 Microsoft .NET Framework Version 4.8.09037 Installed Version: Professional Visual C++ 2022 00483-00100-23601-AA172 Microsoft Visual C++ 2022 ASP.NET and Web Tools 17.8.358.6298 ASP.NET and Web Tools C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.8.17 (957fbed) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.8.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.8.3.2358002+8c7fb27bf8e8d4f9ff8080b624b35bca5e812e97 Provides languages services for ASP.NET Core Razor. .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.8d38d0cc Runtime Environment: OS Name: Windows OS Version: 10.0.22000 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100\ .NET workloads installed: Workload version: 8.0.100-manifests.8d38d0cc [wasm-tools-net7] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net7\8.0.0\WorkloadManifest.json Install Type: Msi [maccatalyst] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json Install Type: Msi [ios] Installation Source: VS 17.8.34330.188 Manifest Version: 17.0.8478/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json Install Type: Msi [android] Installation Source: VS 17.8.34330.188 Manifest Version: 34.0.43/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json Install Type: Msi [maui-windows] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.3/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json Install Type: Msi [wasm-tools] Installation Source: VS 17.8.34330.188 Manifest Version: 8.0.0/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.0\WorkloadManifest.json Install Type: Msi Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71 .NET SDKs installed: 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.101 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.526 [C:\Program Files\dotnet\sdk] 2.2.109 [C:\Program Files\dotnet\sdk] 6.0.320 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download