-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Stack overflow on macOS for long pipelines #1453
Comments
Hello @lydell, thank you for this detailed report. |
Getting a stack overflow on just one OS sure is puzzling!
Interested, yes. But since last time I said that I still haven’t got around to doing anything. So it might take a while depending on how much time I have and how often I bump into this issue. Now we have an issue at least so we can see if other bump into this as well. |
What would the PR that fixes this do? Maybe there's some recursive algorithm that needs to be converted into a proper tailcall? |
So, I think the problem occurs in fantomas/src/Fantomas/AstTransformer.fs Lines 320 to 332 in a7dd05a
The code Simon has is a deeply nested version of fantomas/src/Fantomas/AstTransformer.fs Lines 17 to 22 in a7dd05a
, it will flatten the tree later in: fantomas/src/Fantomas/Trivia.fs Lines 541 to 544 in a7dd05a
So changing the code in ASTTransformer, to return a list of nodes instead of a parent/child tree might resolve the problem. |
@lydell does this still occur in the latest alpha? |
@nojaf I just tested 4.5.0-alpha-011. The problem is fixed! Thank you very much! 🎉 |
Thanks for confirming! |
Repro repo: https://github.com/lydell/fantomas-stack-overflow-demo
Issue created from fantomas-online
Code
Result
Online and in GitHub Actions (we run on
ubuntu-latest
):On macOS:
Problem description
Fantomas crashes with a stack overflow on macOS.
And yes, we do have two long enough pipelines at work to trigger this 😄 Our longest pipeline is currently over 50 pipes long. I had to break it into 3 pieces to get Fantomas to work 🙈
Workaround
Split the pipeline into two parts:
Extra information
Options
Fantomas Master at 02/12/2021 20:07:06 - e016b1c
Default Fantomas configuration
Using 4.4.0-beta-007 locally
The text was updated successfully, but these errors were encountered: