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

ArgumentOutOfRangeException at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.ChildThatContainsPosition(Int32 position) #605

Closed
KevinH-MS opened this issue Feb 17, 2015 · 1 comment

Comments

@KevinH-MS
Copy link
Contributor

I keep running into this crash when attempting to delete an argument from a particular method invocation...

Crash dump is located on internal file share under ...\dumps\605

ArgumentOutOfRangeException:
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, IEnumerable1 changes) at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.SyntaxParser..ctor(Lexer lexer, LexerMode mode, CSharpSyntaxNode oldTree, IEnumerable1 changes, Boolean allowModeReset, Boolean preLexIfNotIncremental, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser..ctor(Lexer lexer, CSharpSyntaxNode oldTree, IEnumerable1 changes, LexerMode lexerMode, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChanges(SourceText newText, IReadOnlyList1 changes)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChangedText(SourceText newText)
at Microsoft.CodeAnalysis.DocumentState.d__9.MoveNext() in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Workspaces\Core\Portable\Workspace\Solution\DocumentState.cs:line 146

@mattwar mattwar added the Bug label Feb 20, 2015
@mattwar mattwar self-assigned this Feb 20, 2015
@mattwar
Copy link
Contributor

mattwar commented Feb 20, 2015

This is a bug in syntax trees that occurred recently due to a switch to using binary search for large lists. The binary search is finding a node by position that is zero-width, which is not a node that is said to contain the position.

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

2 participants