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

VS crash due to ArgumentOutOfRangeException thrown by incremental parser #659

Closed
tmat opened this issue Feb 18, 2015 · 4 comments
Closed

Comments

@tmat
Copy link
Member

tmat commented Feb 18, 2015

Stack trace:

   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.ChildThatContainsPosition(Int32 position)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindTokenInternal(Int32 position)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindToken(Int32 position, Boolean findInsideTrivia)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender.ExtendToAffectedRange(CSharpSyntaxNode oldTree, TextChangeRange changeRange)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender..ctor(Lexer lexer, CSharpSyntaxNode oldTree, IEnumerable`1 changes)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.SyntaxParser..ctor(Lexer lexer, LexerMode mode, CSharpSyntaxNode oldTree, IEnumerable`1 changes, Boolean allowModeReset, Boolean preLexIfNotIncremental, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser..ctor(Lexer lexer, CSharpSyntaxNode oldTree, IEnumerable`1 changes, LexerMode lexerMode, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChanges(SourceText newText, IReadOnlyList`1 changes)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChangedText(SourceText newText)
   at Microsoft.CodeAnalysis.DocumentState.<IncrementallyParseTreeAsync>d__9.MoveNext()

Crash dump stored on internal share tomat\bugs\659. It isn't that much useful though since the stack is gone. I have added exception filter to IncrementallyParseTreeAsync so we can get a better stack next time.

Repro:
Extract tomat\bugs\659\Roslyn.zip, open AbstractEditAndContinueAnalyzer.cs, go to line 1059

var lambdaBodyMatch = ComputeLambdaBodyMatch(oldBody1, newLambda, activeNodes, lazyActiveLambdas, trackingService, diagnostics);

And delete "trackingService" identifier.

@pharring
Copy link
Contributor

@tmat Can you remember what you were doing at the time?

@tmat
Copy link
Member Author

tmat commented Feb 19, 2015

Yes, updated the description above with 100% repro.

@gafter gafter added this to the 1.0-rc2 milestone Feb 22, 2015
@gafter
Copy link
Member

gafter commented Feb 22, 2015

This looks exactly like the issue that @mattwar is working on.

@mattwar
Copy link
Contributor

mattwar commented Feb 24, 2015

This is the same as #605 and fixed by #736

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

No branches or pull requests

4 participants