Bug 7178 - Collection modified exception in ControlFlowGraphBuilder
Summary: Collection modified exception in ControlFlowGraphBuilder
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-09-14 11:16 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-09-18 05:28 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2012-09-14 11:16:23 UTC
ERROR [2012-09-14 11:11:36Z]: CodeAnalysis: Got exception in inspector 'MonoDevelop.CSharp.Refactoring.CodeIssues.NRefactoryIssueProvider'
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowNode].VerifyState () [0x00047] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.10.10/_build/mono-2.10.10.git/mcs/class/corlib/System.Collections.Generic/List.cs:785 
  at System.Collections.Generic.List`1+Enumerator[ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowNode].MoveNext () [0x00000] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.10.10/_build/mono-2.10.10.git/mcs/class/corlib/System.Collections.Generic/List.cs:789 
  at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator29`2[ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowNode,ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowEdge].MoveNext () [0x000e4] in /Users/michael/Mono/bockbuild/profiles/monodevelop-mac-dev/build-root/mono-2.10.10/_build/mono-2.10.10.git/mcs/class/System.Core/System.Linq/Enumerable.cs:2261 
  at ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowGraphBuilder.AnnotateLeaveEdgesWithTryFinallyBlocks () [0x00133] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs:224 
  at ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowGraphBuilder.BuildControlFlowGraph (ICSharpCode.NRefactory.CSharp.Statement statement, System.Func`3 resolver, ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpTypeResolveContext typeResolveContext, CancellationToken cancellationToken) [0x000c5] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs:208 
  at ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowGraphBuilder.BuildControlFlowGraph (ICSharpCode.NRefactory.CSharp.Statement statement, ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, CancellationToken cancellationToken) [0x00022] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs:181 
  at ICSharpCode.NRefactory.CSharp.Analysis.ControlFlowGraphBuilder.BuildControlFlowGraph (ICSharpCode.NRefactory.CSharp.Statement statement, CancellationToken cancellationToken) [0x00021] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs:172 
  at ICSharpCode.NRefactory.CSharp.Refactoring.AccessToClosureIssue+GatherVisitor.CollectIssues (ICSharpCode.NRefactory.CSharp.Refactoring.Environment env, System.String variableName) [0x0000f] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs:155 
  at ICSharpCode.NRefactory.CSharp.Refactoring.AccessToClosureIssue+GatherVisitor.CheckVariable (IVariable variable, ICSharpCode.NRefactory.CSharp.Statement env) [0x00058] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs:146 
  at ICSharpCode.NRefactory.CSharp.Refactoring.AccessToClosureIssue+GatherVisitor.VisitParameterDeclaration (ICSharpCode.NRefactory.CSharp.ParameterDeclaration parameterDeclaration) [0x0009b] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs:123 
  at ICSharpCode.NRefactory.CSharp.ParameterDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs:99 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00013] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:43 
  at ICSharpCode.NRefactory.CSharp.GatherVisitorBase.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00019] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/GatherVisitorBase.cs:68 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitMethodDeclaration (ICSharpCode.NRefactory.CSharp.MethodDeclaration methodDeclaration) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:209 
  at ICSharpCode.NRefactory.CSharp.MethodDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs:80 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00013] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:43 
  at ICSharpCode.NRefactory.CSharp.GatherVisitorBase.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00019] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/GatherVisitorBase.cs:68 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:134 
  at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs:107 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00013] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:43 
  at ICSharpCode.NRefactory.CSharp.GatherVisitorBase.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00019] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/GatherVisitorBase.cs:68 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitNamespaceDeclaration (ICSharpCode.NRefactory.CSharp.NamespaceDeclaration namespaceDeclaration) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:129 
  at ICSharpCode.NRefactory.CSharp.NamespaceDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs:118 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00013] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:43 
  at ICSharpCode.NRefactory.CSharp.GatherVisitorBase.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) [0x00019] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/GatherVisitorBase.cs:68 
  at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs:49 
  at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor (IAstVisitor visitor) [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/SyntaxTree.cs:140 
  at ICSharpCode.NRefactory.CSharp.GatherVisitorBase.GetIssues () [0x00000] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/GatherVisitorBase.cs:60 
  at ICSharpCode.NRefactory.CSharp.Refactoring.AccessToClosureIssue.GetIssues (ICSharpCode.NRefactory.CSharp.Refactoring.BaseRefactoringContext context) [0x00018] in /Users/michael/Mono/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/AccessToClosureIssues/AccessToClosureIssue.cs:54 
  at MonoDevelop.CSharp.Refactoring.CodeIssues.NRefactoryIssueProvider+<GetIssues>c__Iterator16.MoveNext () [0x00080] in /Users/michael/Mono/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryIssueProvider.cs:67 
  at MonoDevelop.CodeIssues.CodeAnalysisRunner+<Check>c__AnonStorey25.<>m__3A (MonoDevelop.CodeIssues.CodeIssueProvider provider) [0x0009f] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeAnalysisRunner.cs:62
Comment 1 Mike Krüger 2012-09-18 05:22:26 UTC
Would be nice to have a use case.
Comment 2 Mike Krüger 2012-09-18 05:28:58 UTC
fixed that thing

Seems that this issue wasn't thread safe - it used a single static control flow graph builder instance.