-
Notifications
You must be signed in to change notification settings - Fork 790
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
FCS ParseAndCheckProject
crash with stackoverflow on Mac OS
#6636
Comments
/cc @sjanahan @Krzysztof-Cieslak @baronfel @alfonsogarciacaro @auduchinok happen in latest Rider too, but not yet minimized private codebase, do you have seen something similar? @dustinmoris maybe is similar to your issue, can you repro with that project? |
SO exceptions are a party with FCS on mac since the first netcore versions. There's obviously a problem with tail calls in netcore runtime on macos. That's what should be fixed instead of pinpointing all the issues as they appear :/ |
@alfonsogarciacaro i got the same error on Rider who afaik use mono, so it not just on .NET Core, maybe there is more visibile (stack deep smaller?) Maybe that code shouldnt use recursion+tail at all? to fix the root issue F# side. Meanwhile i'll open an issue in https://github.com/dotnet/coreclr to ask for guidance about that, if it's expected or can be mitigated somehow or is a bug who need to be fixed. |
@enricosada in Rider we currently use Mono on Mac and Linux and .NET Framework on Windows.
We've seen it on a particular bigger file with a similar stacktrace, issues are: mono/mono#11933 and JetBrains/resharper-fsharp#23, but this particular exception seems to be fixed. |
added https://github.com/dotnet/coreclr/issues/24249 in coreclr to ask about tail calls. Closed as duplicated of https://github.com/dotnet/coreclr/issues/2556 but https://github.com/dotnet/coreclr/issues/24249#issuecomment-486722733 contains useful info |
Another thing worth considering is that the processing of very large literals has been a source of stack overflows and has recently been fixed: #6258 The actual fix isn't released in anything other than a VS preview right now, but eventually FCS can update and it's worth seeing if the problem still persists. Just want to rule out anything we know here before we dive into CoreCLR issues. |
@enricosada my steps (macos):
|
Yes. Everything from March 28th and back is in FCS 28. |
@baronfel good workaround, but it depends on stacktrace deep anyway. As a note, this https://github.com/sjanahan/rider-crash-reproducer/ is a repro with Rider on mono, we cannot apply same workaround of .net core, and will crash anyway on fsac .net |
@enricosada I've opened a ticket with JetBrains about the crash in Rider Please let me know how if there's anything else I can do to help get this resolved. Thanks! |
I will try this repo a little bit later as I'm on a train right now, but I just want to add that the StackOverflowException which I am getting on macOS with .NET Core in Ionide is/must be a regression, because it only started happening after upgrading to Ionide 3.34.0 and above. When I revert Ionide back to 3.33.0 then everything works. So it might be worth checking what has changed in the dependencies which Ionide relies on between those two versions. |
@dsyme @KevinRansom usually how these kind of issues are fixed? Dunno if feasible, but adding a new warning if recursion doesnt satify @jkotas rules on the comment https://github.com/dotnet/coreclr/issues/2556#issuecomment-169755535 may make FCS/fsc safer
|
This no longer reproduces with the 3.1.00 SDK, VS, or Ionide. This has likely been fixed by the numerous fixes in the compiler that we've made leading up to .NET Core 3.1. |
FSharp.Compiler.Service
ParseAndCheckProject
crash with stackoverflow exception during typecheck on Mac OSThe minimized the repro point to
"""
usageNOTE FCS v28.0.0 was integrated from visualfsharp master to Integrate visualfsharp master up to 8dfc02feb , but may happen in previous versions too, need to check, there where issues from users also in v27
Repro steps
An example is https://github.com/sjanahan/ionide-crash who crash on latest FSAC (FCS v28.0.0) in vscode+ionide on mac.
The issue is the usage of a big triple quoted
"""
string like this oneA repro using latest
FSharp.Compiler.Service
package v28.0.0 as library is in https://github.com/enricosada/fcs-crash/ , who just invokeParseAndCheckProject
on that projectThe crash is shown on travis build matrix ( https://travis-ci.org/enricosada/fcs-crash/builds/524417824 ) where succeed on unix and fails on osx
NOTES
dotnet build
is okref ionide/FsAutoComplete#356
ref ionide/ionide-vscode-fsharp#1039
Expected behavior
No crash
Actual behavior
Stackoverflow, with a stacktrace like backend-err.log
That stacktrace is from a .NET Version on Rider, who happen in a private codebase. The .NET Core version doesnt show the stacktrace for the SO
The minimal repro doesnt trigger in Rider but does in FSAC (FCS v28.0.0)
The method seems ok to tail call
Known workarounds
None
Related information
Happen in mac osx only, in this repro does happen in .NET Core Runtime, but seen the same in .NET Framework Runtime too with private codebase
in the repro is using .NET Core v2.1.401 but newer version fails too.
The text was updated successfully, but these errors were encountered: