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

Bicep out of stack with large set of unclosed {'s (CLI and langserver) #15465

Open
StephenWeatherford opened this issue Nov 1, 2024 · 1 comment

Comments

@StephenWeatherford
Copy link
Contributor

This file was (incorrectly) automatically generated, I'm not that twisted. :-)

File looks like this:
resource r1 'Microsoft.Network/virtualNetworks@2021-05-01' = {
name: 'r1'
resource r2 'Microsoft.Network/virtualNetworks@2021-05-01' = {
name: 'r2'
resource r3 'Microsoft.Network/virtualNetworks@2021-05-01' = {

and repeats about 800 times. Bicep crashes somewhere after 600.

Stack overflow.
at Bicep.Core.Parsing.Lexer.TryGetStringValue(Bicep.Core.Parsing.Token)
at Bicep.Core.Parsing.Lexer.TryGetRawStringSegments(System.Collections.Generic.IReadOnlyList1<Bicep.Core.Parsing.Token>) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass47_0.<InterpolableString>g__ProcessStringSegment|0(Boolean) at Bicep.Core.Parsing.BaseParser.InterpolableString() at Bicep.Core.Parsing.BaseParser.PrimaryExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.MemberExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.UnaryExpression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser.BinaryExpression(Bicep.Core.Parsing.ExpressionFlags, Int32) at Bicep.Core.Parsing.BaseParser.Expression(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass59_0.<ObjectProperty>b__3() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[])
at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass59_0.b__0()
at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.<Object>b__1() at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func1<Bicep.Core.Syntax.SyntaxBase>)
at Bicep.Core.Parsing.BaseParser.Object(Bicep.Core.Parsing.ExpressionFlags)
at Bicep.Core.Parsing.Parser.b__10_2()
at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.ResourceDeclaration(System.Collections.Generic.IEnumerable1<Bicep.Core.Syntax.SyntaxBase>)
at Bicep.Core.Parsing.Parser+<>c__DisplayClass2_0.b__0()
at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.Parser.Declaration(System.String[]) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass59_0.<ObjectProperty>b__0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[])
at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags)
at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.b__1()
at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.BaseParser.Object(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.Parser.<ResourceDeclaration>b__10_2() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[])
at Bicep.Core.Parsing.Parser.ResourceDeclaration(System.Collections.Generic.IEnumerable1<Bicep.Core.Syntax.SyntaxBase>) at Bicep.Core.Parsing.Parser+<>c__DisplayClass2_0.<Declaration>b__0() at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[])
at Bicep.Core.Parsing.Parser.Declaration(System.String[])
at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass59_0.b__0()
at Bicep.Core.Parsing.BaseParser.WithRecovery[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func1<System.__Canon>, Bicep.Core.Parsing.RecoveryFlags, Bicep.Core.Parsing.TokenType[]) at Bicep.Core.Parsing.BaseParser.ObjectProperty(Bicep.Core.Parsing.ExpressionFlags) at Bicep.Core.Parsing.BaseParser+<>c__DisplayClass58_0.<Object>b__1() at Bicep.Core.Parsing.BaseParser.HandleArrayOrObjectElements(Bicep.Core.Parsing.TokenType, System.Func1<Bicep.Core.Syntax.SyntaxBase>)
...

@StephenWeatherford
Copy link
Contributor Author

This also crashed VS's test runner mysteriously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants