Open samritchie opened 2 years ago
This may have been fixed in https://github.com/dotnet/fsharp/pull/12420 I will test it in latest dev17.3, everything from 17.2 should be there. Although, I'm not sure whether we've released FCS since the fix, @KevinRansom?
CC @dsyme FYI
I'm not sure how to tell which PRs are in which release, but the performance appears to have regressed between 41.0.1 (released 6 months ago) and 41.0.3 (released 2 months ago)
I'm not sure how to tell which PRs are in which release, but the performance appears to have regressed between 41.0.1 (released 6 months ago) and 41.0.3 (released 2 months ago)
It would be good to have separate issues for the stackoverflow and any perf regression, thanks. Is the perf regression specifically with the kind of large-input code above?
Sorry, 'performance' was the wrong word - I meant the previous version (41.0.1) was okay with this code, the stack overflow was introduced some time after then.
I've been describing it a regression as I'm pretty sure it is the same issue I had with this same code a couple of years ago - it prevented me switching from mono FSAC to netcore FSAC for a good year or so.
@samritchie Could you set the environment variable FSHARP_TcStackGuardDepth=50
in your command prompt prior to building and see if you continue to repro this? Thanks
It might be we just have to reduce this stack guard, either on all or on MacOS:
#if DEBUG
let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 40
#else
let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 80
#endif
@dsyme FSHARP_TcStackGuardDepth=50
prevents the crash, at least on Ionide 6.0/FSAC 0.54. Sorry, it’s been difficult to confirm, there appears to be a fresh issue in Ionide 7.0/FSAC 0.56 where typecheck looks like it is looping endlessly. I'll see if I can block out some time next week to do a repro.
Thanks for confirming.
I'll see if I can block out some time next week to do a repro.
Please do, if there's been a regression we'd like to know about it ASAP, thanks
I've upgraded to Ionide 7.1.0/FSAC 0.56.2 and intellisense is not instant but is at least usable - possibly it was related to this: https://github.com/fsharp/FsAutoComplete/pull/977. This version still crashes with an SO opening the repro file without the FSHARP_TcStackGuardDepth
workaround.
Upgrading from FSAC v0.51.0 to v0.52.0 (Ionide 6.0.0) triggers a stack overflow in
FSharp.Compiler.CheckComputationExpressions
on macOS when attempting to typecheck a file containing large CEs.I saw similar issues a couple of years ago with early versions of the netcore FSAC. Tracing through the versions, it looks like there may have been a performance regression between FCS 41.0.1 and 41.0.3?
Repro steps
Open the following file on macOS
Expected behavior
File typechecks successfully
Actual behavior
Language server crashes and reports a stack overflow starting with:
Known workarounds
Setting the environment variable
COMPlus_DefaultStackSize=180000
allows typecheck to complete successfullyRelated information
do!
expressions