Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem with new instrumentation since 4.9
cbeauchemin
#1 Posted : Thursday, August 19, 2021 2:09:29 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/19/2021(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi,
i was having index out of bound problem with the new instrumentation type. I was using the legacy one and it worked completely. Since 4.9, access to the legacy instrumentation is not possible anymore and i have the same problem in vs 2022 as in vs 2019.

Here is the stack trace:
Quote:

[PID:2952 09:43:30.7497 LocalBuildTask-43] ERROR: nCrunch.Compiler.StaticManipulation.CilTypeHashException: Unable to hash type ********.****GoogleAdsConfig' due to exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at nCrunch.Compiler.Cil.Types.CilNestedClassTable..ctor(CilModule module, CilTableInfo tableInfo)
at nCrunch.Compiler.Cil.CilModule..ctor(CilAssembly assembly, CilMetadataRoot metadataRoot, CilPeHeaders peHeaders, CilContext context, DirectoryPath workingDirectory, UInt32 entryPointToken)
at nCrunch.Compiler.Cil.CilAssembly..ctor(Byte[] , CilContext , DirectoryPath )
at nCrunch.Compiler.Cil.CilAssembly.Load(FilePath assemblyFile, CilContext context)
at nCrunch.Compiler.Cil.CachedCilAssembly..ctor(FilePath assemblyFilePath, CilContext context, Boolean isInstrumentationTarget)
at nCrunch.Compiler.Cil.CilContext.LoadAssembly(FilePath assemblyFilePath)
at nCrunch.Compiler.Cil.CilSession.LoadAssembly(FilePath assemblyFilePath, Boolean isInstrumentationTarget)
at nCrunch.Compiler.Cil.CilSession.(String , String , UInt16 , UInt16 , UInt16 , UInt16 , String , String  )
at nCrunch.Compiler.Cil.CilSession.LoadAssembly(CilAssemblyReference assemblyReference)
at nCrunch.Compiler.Cil.CilSession.GetReferencedModule(CilModule referencingModule, UInt32 assemblyRefTableRowIndex)
at nCrunch.Compiler.Cil.AssemblyIdentity.CilAssemblyRefTable.GetAssemblyModuleByRowIndex(UInt32 tableIndex)
at nCrunch.Compiler.Cil.Types.CilTypeReference.(CilModule )
at nCrunch.Compiler.Cil.Types.CilTypeDefinition.ResolveBaseType()
at nCrunch.Compiler.StaticManipulation.CilMethodHashGenerator.HashType(FNV64& hash, CilTypeDefinition type)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.StaticManipulation.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.()
Remco
#2 Posted : Friday, August 20, 2021 5:59:08 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this problem.

This looks to be caused by a hole in our CIL handling. The type mentioned in the error descends from a type declared in another assembly that doesn't seem to fit the CIL structure expected by NCrunch. I'm wondering if it might have been manipulated/obfuscated somehow or built with a niche compiler. Is this base type declared in a package that is available online? If I can reproduce this issue I hope it should be straightforward to fix it.
cbeauchemin
#3 Posted : Friday, August 20, 2021 12:41:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/19/2021(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi, Thanks for the quick answer. Nothing have been obfuscated on our side. The problematic class is a derivation from the base class in a Google library named GoogleAdsConfig.cs

This class is included in the package https://www.nuget.org/pa...gle.Ads.GoogleAds/6.0.0

The source of it can be found here: is https://github.com/googleads/google-ads-dotnet

Thanks
Remco
#4 Posted : Friday, August 20, 2021 1:53:14 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for these details.

I can confirm that I can now reproduce this problem at will using the specified library.

I will let you know as soon as we have a fix available.
1 user thanked Remco for this useful post.
cbeauchemin on 8/20/2021(UTC)
Remco
#5 Posted : Saturday, August 21, 2021 1:22:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
cbeauchemin
#6 Posted : Monday, August 23, 2021 9:21:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/19/2021(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Ok, I can confirm you that its working for vs 2022, i will be soon able to test it with vs 2019. From my point of view, it seem to be fixed!

Thanks
1 user thanked cbeauchemin for this useful post.
Remco on 8/24/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.108 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download