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

Visual studio crashes with ArgumentException at CSharpSyntaxNode.ChildThatContainsPosition #737

Closed
balajikris opened this issue Feb 20, 2015 · 2 comments
Labels
Area-IDE Bug Resolution-Duplicate The described behavior is tracked in another issue Verified

Comments

@balajikris
Copy link
Member

The scenario was typing C# code. I may have changed the name of some local variable as it looks like RenameTracking set off this whole thing.
Saved a dump at %internalshare%\dumps\737
Roslyn bits: 50219

$exception:
-------------
Specified argument was out of the range of valid values.
Parameter name: position

   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.ChildThatContainsPosition(Int32 position) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxNode.cs:line 559
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindTokenInternal(Int32 position) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxNode.cs:line 629
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindToken(Int32 position, Boolean findInsideTrivia) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxNode.cs:line 725
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender.ExtendToAffectedRange(CSharpSyntaxNode oldTree, TextChangeRange changeRange) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Parser\Blender.cs:line 130
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender..ctor(Lexer lexer, CSharpSyntaxNode oldTree, IEnumerable`1 changes) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Parser\Blender.cs:line 60
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.SyntaxParser..ctor(Lexer lexer, LexerMode mode, CSharpSyntaxNode oldTree, IEnumerable`1 changes, Boolean allowModeReset, Boolean preLexIfNotIncremental, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Parser\SyntaxParser.cs:line 54
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser..ctor(Lexer lexer, CSharpSyntaxNode oldTree, IEnumerable`1 changes, LexerMode lexerMode, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Parser\LanguageParser.cs:line 51
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChanges(SourceText newText, IReadOnlyList`1 changes) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxTree.cs:line 453
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChangedText(SourceText newText) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Compilers\CSharp\Portable\Syntax\CSharpSyntaxTree.cs:line 427
   at Microsoft.CodeAnalysis.DocumentState.<IncrementallyParseTreeAsync>d__9.MoveNext() in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\src\Workspaces\Core\Portable\Workspace\Solution\DocumentState.cs:line 149

crashing worker thread's stack:
------------------------------------
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception exception, System.Action<System.Exception> handler) Line 155 C#
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.DocumentState.IncrementallyParseTreeAsync(Roslyn.Utilities.ValueSource<Microsoft.CodeAnalysis.TreeAndVersion> oldTreeSource, Roslyn.Utilities.ValueSource<Microsoft.CodeAnalysis.TextAndVersion> newTextSource, System.Threading.CancellationToken cancellationToken) Line 152 C#
    [Resuming Async Method] 
    [Native to Managed Transition]  
>   Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.ChildThatContainsPosition(int position) Line 559   C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindTokenInternal(int position) Line 629   C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.FindToken(int position, bool findInsideTrivia) Line 722    C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender.ExtendToAffectedRange(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode oldTree, Microsoft.CodeAnalysis.Text.TextChangeRange changeRange) Line 130   C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Blender.Blender(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Lexer lexer, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode oldTree, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Text.TextChangeRange> changes) Line 61 C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.SyntaxParser.SyntaxParser(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Lexer lexer, Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LexerMode mode, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode oldTree, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Text.TextChangeRange> changes, bool allowModeReset, bool preLexIfNotIncremental, System.Threading.CancellationToken cancellationToken) Line 54   C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.LanguageParser(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.Lexer lexer, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode oldTree, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Text.TextChangeRange> changes, Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LexerMode lexerMode, System.Threading.CancellationToken cancellationToken) Line 54    C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChanges(Microsoft.CodeAnalysis.Text.SourceText newText, System.Collections.Generic.IReadOnlyList<Microsoft.CodeAnalysis.Text.TextChangeRange> changes) Line 453    C#
    Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChangedText(Microsoft.CodeAnalysis.Text.SourceText newText) Line 427   C#
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.DocumentState.IncrementallyParseTreeAsync(Roslyn.Utilities.ValueSource<Microsoft.CodeAnalysis.TreeAndVersion> oldTreeSource, Roslyn.Utilities.ValueSource<Microsoft.CodeAnalysis.TextAndVersion> newTextSource, System.Threading.CancellationToken cancellationToken) Line 149 C#
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.DocumentState.CreateLazyIncrementallyParsedTree.AnonymousMethod__0(System.Threading.CancellationToken c) Line 129  C#
    Microsoft.CodeAnalysis.Workspaces.dll!Roslyn.Utilities.AsyncLazy<Microsoft.CodeAnalysis.TreeAndVersion>.StartAsynchronousComputation(Roslyn.Utilities.AsyncLazy<Microsoft.CodeAnalysis.TreeAndVersion>.AsynchronousComputationToStart computationToStart, Roslyn.Utilities.AsyncLazy<Microsoft.CodeAnalysis.TreeAndVersion>.Request requestToCompleteSynchronously) Line 380    C#
    Microsoft.CodeAnalysis.Workspaces.dll!Roslyn.Utilities.AsyncLazy<Microsoft.CodeAnalysis.TreeAndVersion>.GetValueAsync(System.Threading.CancellationToken cancellationToken) Line 333    C#
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.DocumentState.GetSyntaxTreeAsync(System.Threading.CancellationToken cancellationToken) Line 477    C#
    Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Document.GetSyntaxTreeAsync(System.Threading.CancellationToken cancellationToken) Line 193 C#
    Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.TrackingSession.DetermineIfRenamableIdentifierAsync(Microsoft.VisualStudio.Text.SnapshotSpan snapshotSpan, bool initialCheck) Line 136   C#
    Microsoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.TrackingSession..ctor.AnonymousMethod__0() Line 66   C#
    mscorlib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.TriggerIdentifierKind>>.InnerInvoke() Line 680    C#

@Pilchie
Copy link
Member

Pilchie commented Feb 20, 2015

This is a dupe of something @mattwar has a PR out for.

@balajikris
Copy link
Member Author

Ah, thanks dupe of #605

@balajikris balajikris added the Resolution-Duplicate The described behavior is tracked in another issue label Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Resolution-Duplicate The described behavior is tracked in another issue Verified
Projects
None yet
Development

No branches or pull requests

3 participants