-
Notifications
You must be signed in to change notification settings - Fork 846
Closed
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression
Description
Repro steps
Provide the steps required to reproduce the problem:
open System
open System.Threading.Tasks
[<EntryPoint>]
let main _ =
let rec loop (x: int) = async {
do! Task.CompletedTask |> Async.AwaitTask
Console.WriteLine x
return! loop(x+1)
}
Async.RunSynchronously (loop 0)
0with
<PackageReference Update="FSharp.Core" Version="5.0.2"/>dotnet run -c Release (both Release and Debug are affected)
Expected behavior
It should work
Actual behavior
Stack Overflow!
Known workarounds
- You could downgrade to 5.0.0 (Implicit in net5 SDK) or to 5.0.1 to make it work again:
<PackageReference Update="FSharp.Core" Version="5.0.0"/>- OR Change Completed task to fake async with real continuation
do! Task.CompletedTask |> Async.AwaitTaskto
do! Task.Delay 1 |> Async.AwaitTaskRelated information
Call stack shows that all COMPLETED tasks continuations started its trampoline on a stack of previous trampoline which causes SO.
It actually crashed production system which was working on Pulsar.Client.Dotnet (it currently using 5.0.2)
I also tried to find related changes with GitHub help:
https://github.com/dotnet/fsharp/compare/5.0.0..5.0.2
But I couldn't find any related to FSharp.Core tags.
- macOs
- .NET5
UPDATED: 5.0.1 also works ok. So regression was introduced between 5.0.1 and 5.0.2
UPDATED2: suspect PR
#11142
Nojpg, Liminiens, atsapura, Lanayx, Ilchert and 1 more
Metadata
Metadata
Assignees
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression