jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.76k stars 627 forks source link

Stack overflow when running tests #905

Open sungam3r opened 1 year ago

sungam3r commented 1 year ago

See https://github.com/graphql-dotnet/graphql-client/pull/557

The active test run was aborted. Reason: Test host process crashed : Stack overflow.
   at System.Collections.Generic.Dictionary`2[[Mono.Cecil.Metadata.Row`2[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Mono.Cecil, Version=0.11.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FindValue(Mono.Cecil.Metadata.Row`2<System.__Canon,System.__Canon>)
   at System.Collections.Generic.Dictionary`2[[Mono.Cecil.Metadata.Row`2[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Mono.Cecil, Version=0.11.4.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryGetValue(Mono.Cecil.Metadata.Row`2<System.__Canon,System.__Canon>, System.__Canon ByRef)
   at Mono.Cecil.TypeDefinitionCollection.GetType(System.String, System.String)
   at Mono.Cecil.ModuleDefinition.GetType(System.String, System.String)
   at Mono.Cecil.MetadataResolver.GetTypeDefinition(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ExportedType.Resolve()
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ExportedType.Resolve()
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ExportedType.Resolve()
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ExportedType.Resolve()
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ExportedType.Resolve()
   at Mono.Cecil.MetadataResolver.GetType(Mono.Cecil.ModuleDefinition, Mono.Cecil.TypeReference)
   at Mono.Cecil.MetadataResolver.Resolve(Mono.Cecil.TypeReference)
   at Mono.Cecil.ModuleDefinition.Resolve(Mono.Cecil.TypeReference)
............................................

The problem line is here - Resolve() hangs.

KirillOsenkov commented 2 weeks ago

Can you see if https://github.com/jbevain/cecil/pull/806 fixes it?