-
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][mt] Running any Thread for longer than 5000 ms crashes runtime (Blazor) #86903
Comments
Most likely this change is the cause of the issue: #86278 Edit: |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionSpawning any long-running Task or Thread from the main thread for longer than 5000 ms kills application and runtime when using Blazor. Reproduction Steps
Expected behaviorI should be able to start a task from anywhere on the main thread using Task.Run in a Blazor app and not have the runtime crash after 5000ms Actual behaviorRuntime crashes with error (screenshot above) Regression?This previously worked perfectly on the official release build of .NET 8 Preview 4. Known WorkaroundsNone ConfigurationNo response Other informationNo response
|
@IsaMorphic Can you say a bit more about what's in the body of the long-running task? Is it compute-intensive? doing a synchronous call to JS that takes longer than 5 seconds? calling some native wasm code (like C code)? In principle if the long-running task is just a compute loop in C# it should be trying to safepoint at backward branches in the loops... unless we're failing to emit the safepointing opcodes for some reason... |
@lambdageek Of course. It is definitely a compute intensive task in .NET land. No interop is happening inside of it. |
This is GC trying to suspend a thread. Probably UI thread is unbalanced on GC state. |
Related #96190 |
@lambdageek is there way how to test safepoint with unit test ? |
Start a GC |
Create tight for loop and make sure it runs longer than |
Well it's cooperative suspension, so we can add an icall that intentionally forgets to do a GC state transition and calls |
Any updates on this investigation / fix? I'm eagerly awaiting the moment that this bug is squashed, as I am building an app that heavily relies on this functionality! |
@IsaMorphic is it still possible to replicate with the latest build ? You can try it with nightly build https://aka.ms/dotnet/9.0.1xx/daily/dotnet-sdk-win-x64.zip |
This issue has been marked |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Description
Spawning any long-running Task or Thread from the main thread for longer than 5000 ms kills application and runtime when using Blazor.
Reproduction Steps
main
build of runtime in project fileExpected behavior
I should be able to start a task from anywhere on the main thread using Task.Run in a Blazor app and not have the runtime crash after 5000ms
Actual behavior
Runtime crashes with error (screenshot above)
Regression?
This previously worked perfectly on the official release build of .NET 8 Preview 4.
Known Workarounds
None
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: