Skip to content
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

System.InsufficientExecutionStackException thrown in LocalBinderFactory compiling ErrorFacts.IsBuildOnlyDiagnostic() on MacOS #73439

Closed
cston opened this issue May 12, 2024 · 1 comment · Fixed by #75212
Assignees
Milestone

Comments

@cston
Copy link
Member

cston commented May 12, 2024

Version Used:

Steps to Reproduce:

  1. Build dotnet/roslyn Compilers.sln on MacOS.

Expected Behavior:

Compilation succeeds.

Actual Behavior:

System.InsufficientExecutionStackException thrown compiling ErrorFacts.IsBuildOnlyDiagnostic()

$HOME/.nuget/packages/microsoft.net.compilers.toolset/4.10.0-1.24061.4/tasks/netcore/Microsoft.CSharp.Core.targets(84,5): error : Process terminated. System.InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space. [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack() [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.LocalBinderFactory.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitBinaryPattern(BinaryPatternSyntax node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.Syntax.BinaryPatternSyntax.Accept(CSharpSyntaxVisitor visitor) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.LocalBinderFactory.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitBinaryPattern(BinaryPatternSyntax node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.Syntax.BinaryPatternSyntax.Accept(CSharpSyntaxVisitor visitor) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.Visit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxWalker.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.LocalBinderFactory.DefaultVisit(SyntaxNode node) [/dotnet/roslyn/src/Compilers/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.csproj::TargetFramework=net7.0]
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitBinaryPattern(BinaryPatternSyntax node)
...

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 12, 2024
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels May 13, 2024
@jaredpar jaredpar added this to the 17.11 milestone May 13, 2024
@jaredpar jaredpar modified the milestones: 17.11, Backlog Jul 23, 2024
@mhutch
Copy link
Member

mhutch commented Aug 19, 2024

This still happens with Microsoft.Net.Compilers.Toolset/4.12.0-1.final. I'm not able to successfully build Roslyn on macOS.

@jaredpar jaredpar assigned AlekseyTs and unassigned cston Sep 20, 2024
@jaredpar jaredpar modified the milestones: Backlog, 17.12 Sep 20, 2024
@333fred 333fred assigned 333fred and unassigned AlekseyTs Sep 23, 2024
333fred added a commit to 333fred/roslyn that referenced this issue Sep 23, 2024
Much like binary operators, we can have deeply-nested binary patterns. An example of this is our own IsBuildOnlyDiagnostic, which has ~2500 binary patterns in a single arm, and growing every release. To avoid stack depth issues, I took the same approach we do for binary operators; rewrite recursion to use a manual stack for these cases. Fixes dotnet#73439.
@333fred 333fred closed this as completed in 244b7e5 Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants