-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[browser] ENVIRONMENT_IS_WEB is false when dotnet started on worker, leads to exit(0) #91528
Comments
@pavelsavara please help |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionHi, Reproduction StepsA repository to reproduce the issue is can he found here dotnet-wasm-react. Inorder to reproduce this issue,
Expected behaviorThe .NET WASM AOT runtime does not abruptly exit. Actual behaviorThe .NET WASM AOT Run time exits with following weird stack trace which I suspect is due to a possible stack corruption.
Regression?The issue doesn't happen in .NET 7 WASM AOT builds Known WorkaroundsI haven't found a way to make this work ConfigurationVersion: .NET 8.0.100-preview.7.23376.3 Other informationNo response
|
We need to narrow the scope of the problem. I suggest that you start with
<PropertyGroup>
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols>
<WasmNativeStrip>false</WasmNativeStrip>
</PropertyGroup>
<PropertyGroup>
<EmccStackSize>50MB</EmccStackSize>
</PropertyGroup>
<PropertyGroup>
<BlazorWebAssemblyJiterpreter>false</BlazorWebAssemblyJiterpreter>
</PropertyGroup> Please let us know what have you found out. |
This issue has been marked |
@pavelsavara
|
@Tarun047 , thanks for the help. The issue is that whet dotnet is started on the worker, it thinks that it's not running on a browser and therefore will exit(0) after last promise is fulfilled. I will think about proper fix for this situation, but for now, the workaround is to set
As I worked with your sample app I noticed few things. These are just hints for you, not relevant to this dotnet issue. Feel free to ignore it, if this is just simple throw away sample app.
|
Just curious about this, Also one more observation is that when I do |
I think that it can process it synchronously or that GC is not scheduled (on worker's timer loop). The |
Description
Hi,
I am facing a weird crash when using .NET 8 Latest Preview for targeting WASM Browser (AOT build).
The bug is observed in the following conditions.
The bug came out while benchmarking the performance of JS and .NET AOT Wasm.
When running a React Application, that uses web workers.
The idea is to let user select a file and to compress it using .NET WASM code.
Because this is a heavy task, a web worker is used to delegate the task to .NET WASM compression layer.
The Web App works fine with small files < 5MB.
But If we chose to go with larger files, the compression still succeeds (ofc until we hit OOM) but the .NET runtime exits abruptly with the following weird stack trace if we use files >
10MB
Reproduction Steps
A repository to reproduce the issue is can he found here dotnet-wasm-react.
Inorder to reproduce this issue,
Have the .NET 8.0.100-preview.7.23376.3 SDK and also install the wasm-tools, wasm-experimental workloads.
Checkout the repository and perform the following actions:
Publish the
compress.csproj
by runningdotnet publish -c Release
Copy the outputs of
/bin/Release/net8.0/browser-wasm/AppBundle/
tocompressy-frontend/public/vendor
From the
compressy-frontend
folder,Install
npm
dependencies by runningnpm install
and start thewebpack
dev server by runningnpm run dev
Use a browser and navigate to
http://localhost:8080
and keep the browserconsole
window in browserdev tools
open select thechoose file
button next toWASM .NET Compress
and select any large file (>10MB
preferably) in file chooser.check the
console
output for failure stack trace.Expected behavior
The .NET WASM AOT runtime does not abruptly exit.
Actual behavior
The .NET WASM AOT Run time exits with following weird stack trace which I suspect is due to a possible stack corruption.
Regression?
The issue doesn't happen in .NET 7 WASM AOT builds
Known Workarounds
I haven't found a way to make this work
Configuration
Version: .NET 8.0.100-preview.7.23376.3
OS: Reproducible on Mac OS X, Windows.
Architecture: ARM64, X64
Browsers: Safari, Firefox, Chrome
Other information
No response
The text was updated successfully, but these errors were encountered: