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

Stack overflow when gathering coverage using coverlet #1711

Open
lydia-samuel-applied-systems opened this issue Nov 20, 2024 · 0 comments
Open
Labels
bug Something isn't working tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly

Comments

@lydia-samuel-applied-systems

Hi there,

There seems to be an issue when I'm trying to gather coverage for my project on net471. It seems like I'm getting a stack overflow exception which causes it to fail.

The stack trace ends up looking something like the following:

Stack overflow.
 at Mono.Cecil.Metadata.RowEqualityComparer.GetHashCode(Mono.Cecil.Metadata.Row`2<System.String,System.String>)
 at System.Collections.Generic.Dictionary`2[[Mono.Cecil.Metadata.Row`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Mono.Cecil, Version=0.11.5.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e],[System.__Canon, System.Private.CoreLib, Version=8.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=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Mono.Cecil, Version=0.11.5.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e],[System.__Canon, System.Private.CoreLib, Version=8.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.Mixin.CheckedResolve(Mono.Cecil.TypeReference)
 at Mono.Cecil.MetadataBuilder.GetConstantType(Mono.Cecil.TypeReference, System.Object)
 at Mono.Cecil.MetadataBuilder.AddConstant(Mono.Cecil.IConstantProvider, Mono.Cecil.TypeReference)
 at Mono.Cecil.MetadataBuilder.AddParameter(UInt16, Mono.Cecil.ParameterDefinition, Mono.Cecil.ParamTable)
 at Mono.Cecil.MetadataBuilder.AddParameters(Mono.Cecil.MethodDefinition)
 at Mono.Cecil.MetadataBuilder.AddMethod(Mono.Cecil.MethodDefinition)
 at Mono.Cecil.MetadataBuilder.AddMethods(Mono.Cecil.TypeDefinition)
 at Mono.Cecil.MetadataBuilder.AddType(Mono.Cecil.TypeDefinition)
 at Mono.Cecil.MetadataBuilder.AddTypes()
 at Mono.Cecil.MetadataBuilder.BuildTypes()
 at Mono.Cecil.MetadataBuilder.BuildModule()
 at Mono.Cecil.MetadataBuilder.BuildMetadata()
 at Mono.Cecil.ModuleWriter+<>c.<BuildMetadata>b__2_0(Mono.Cecil.MetadataBuilder, Mono.Cecil.MetadataReader)
 at Mono.Cecil.ModuleDefinition.Read[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon, System.Func`3<System.__Canon,Mono.Cecil.MetadataReader,System.__Canon>)
 at Mono.Cecil.ModuleWriter.BuildMetadata(Mono.Cecil.ModuleDefinition, Mono.Cecil.MetadataBuilder)
 at Mono.Cecil.ModuleWriter.Write(Mono.Cecil.ModuleDefinition, Mono.Disposable`1<System.IO.Stream>, Mono.Cecil.WriterParameters)
 at Mono.Cecil.ModuleWriter.WriteModule(Mono.Cecil.ModuleDefinition, Mono.Disposable`1<System.IO.Stream>, Mono.Cecil.WriterParameters)
 at Mono.Cecil.ModuleDefinition.Write(System.IO.Stream, Mono.Cecil.WriterParameters)
 at Coverlet.Core.Instrumentation.Instrumenter.InstrumentModule()
 at Coverlet.Core.Instrumentation.Instrumenter.Instrument()
 at Coverlet.Core.Coverage.PrepareModules()
 at Coverlet.MSbuild.Tasks.InstrumentationTask.Execute()
 at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
 at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__25.MoveNext()
 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__25, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteInstantiatedTask>d__25 ByRef)
 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__25, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteInstantiatedTask>d__25 ByRef)
 at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(Microsoft.Build.BackEnd.ITaskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext, Microsoft.Build.BackEnd.TaskHost, Microsoft.Build.BackEnd.ItemBucket, Microsoft.Build.BackEnd.TaskExecutionMode)
 at Microsoft.Build.BackEnd.TaskBuilder+<InitializeAndExecuteTask>d__23.MoveNext()
 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TaskBuilder+<InitializeAndExecuteTask>d__23, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<InitializeAndExecuteTask>d__23 ByRef)
 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TaskBuilder+<InitializeAndExecuteTask>d__23, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<InitializeAndExecuteTask>d__23 ByRef)
 at Microsoft.Build.BackEnd.TaskBuilder.InitializeAndExecuteTask(Microsoft.Build.BackEnd.Logging.TaskLoggingContext, Microsoft.Build.BackEnd.ItemBucket, System.Collections.Generic.IDictionary`2<System.String,System.String>, Microsoft.Build.BackEnd.TaskHost, Microsoft.Build.BackEnd.TaskExecutionMode)

I believe that this issue might be related to this in cecil - jbevain/cecil#706

Given that there is a pull request there - jbevain/cecil#806 . If this is the actual issue and that pull request is merged, could an update be considered?

@github-actions github-actions bot added the untriaged To be investigated label Nov 20, 2024
@Bertk Bertk added bug Something isn't working tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly and removed untriaged To be investigated labels Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

2 participants