Build/Test Issues

Project fails to build under optimized mode engine due to index out of range exception

Started by Mark on 1,977 views

When first loading NCrunch on this project with the new optimized mode, it gave an exception in the build of the project. (Which was visible in the NCrunch Processing Queue). Reverting back to legacy mode allowed the project to build fine.

We do use Fody for IL weaving,
.Net Framework 4.5.2 on this particular project.
NCrunch Version v4.0.02
VS 2019 16.3.7

[07:46:55.4595-LocalBuildTask-51] ERROR: nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'AJG.BSD.Framework.Services.Logging.ApiCallProxyLoggerAsync' due to exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetRowByMethodDefIndex(UInt32 methodDefTableRowIndex)
at nCrunch.Compiler.Cil.Methods.CilMethodDefinition.TryResolveASyncTarget()
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.CilProcessingTasks.CilMethodHashingTask..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
[07:46:55.4665-LocalBuildTask-51] ERROR (Internal): nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'AJG.BSD.Framework.Services.Logging.ApiCallProxyLoggerAsync' due to exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetRowByMethodDefIndex(UInt32 methodDefTableRowIndex)
at nCrunch.Compiler.Cil.Methods.CilMethodDefinition.TryResolveASyncTarget()
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.ProcessTasks(Int32 backgroundThreadsAllowed)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentInstrumentationParameters , BuildOutput , IBackgroundTaskProcessor )
at nCrunch.Compiler.RemoteBuildRunner.PerformPostProcessingOfBuiltAssembly(ComponentInstrumentationParameters instrumentationParameters, BuildOutput output, IBackgroundTaskProcessor backgroundTaskProcessor)
at nCrunch.Core.BuildManagement.BuildEnvironment..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.ProcessingQueue..()

Thanks,
Mark Smith

Edited

Hi Mark,

Thanks for posting! Sorry you're experiencing this issue.

We released a new version of NCrunch that has some fixes for the new optimized instrumentation mode. Would you mind giving that a try?

https://www.ncrunch.net/download

Michael
I updated to the trial of of 4.2.0.7 and it builds fine. Looks like you guys fixed this one. Looks like I got 30 days to figure out updating my license.

Thanks,
Mark Smith

Post a reply

Log in to reply.