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

Notification

Icon
Error

NCrunch has encountered an internal error: System.IndexOutOfRangeException: Index was outside the bo
Dorus
#1 Posted : Thursday, August 8, 2024 4:01:13 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/25/2022(UTC)
Posts: 9
Location: Netherlands

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I'm running into the following error:


Quote:
NCrunch has encountered an internal error: 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.CilSession.LoadAssembly(FilePath assemblyFilePath, Boolean isInstrumentationTarget)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly..ctor(FilePath builtAssemblyFilePath, IList`1 adjustedAssemblyReferences, Boolean instrumentForPerformanceMeasurement, ComponentInstrumentationParameters instrumentationParameters, FilePath expectedForegroundBuildOutputPath)
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
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, GridClientDescription clientDescription, Boolean extractCoverageReportStructure)


The problem pops up when i add a method to an admittedly already quite large class (it has 55 methods, now 56).
Remco
#2 Posted : Thursday, August 8, 2024 10:51:54 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1303 time(s) in 1208 post(s)
Thanks for sharing this issue.

This one has been around for a while. I really want to fix it. I'm fairly certain it's related to the structure of the assembly, perhaps something size related. To date, due to IP constraints, no one has been able to share an assembly with me that can reproduce this problem.

Is there any chance you're able to share this assembly with me?
Dorus
#3 Posted : Friday, August 9, 2024 3:30:51 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/25/2022(UTC)
Posts: 9
Location: Netherlands

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Aah that's indeed going to be hard for me too, and it seems to be difficult to reproduce in a fresh project. It's indeed related to more than just the offending class, even removing a few random lines of code make it go away.
Remco
#4 Posted : Friday, August 9, 2024 6:09:21 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1303 time(s) in 1208 post(s)
Dorus;17535 wrote:
Aah that's indeed going to be hard for me too, and it seems to be difficult to reproduce in a fresh project. It's indeed related to more than just the offending class, even removing a few random lines of code make it go away.


Understood. You can probably work around it just by making unrelated changes in the project, such as adding a dummy class with a few unused methods in it.

I'm hopeful there will one day be an open source project that surfaces this, so I can pin it down and resolve it once and for all.
davetorutek
#5 Posted : Tuesday, January 28, 2025 2:40:00 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/31/2018(UTC)
Posts: 14
Location: New Zealand

Thanks: 4 times
Was thanked: 6 time(s) in 4 post(s)
We've ran in to this on one of our projects. What can we do to help debug?
Happy to run a debug build of ncrunch or something. Sharing the project might be a stretch (it uses an internal nuget feed), but if we really need to we might be able to provide it.
Remco
#6 Posted : Tuesday, January 28, 2025 3:35:43 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1303 time(s) in 1208 post(s)
davetorutek;17865 wrote:
We've ran in to this on one of our projects. What can we do to help debug?
Happy to run a debug build of ncrunch or something. Sharing the project might be a stretch (it uses an internal nuget feed), but if we really need to we might be able to provide it.


To have a chance of solving this issue, I really need to have the actual project itself to be able to solve it.

I might be able to figure it out with just the DLL and PDB, in the form that they exist in the NCrunch workspace. This is assuming your exception is identical to the one at the top of this thread (where it was thrown from the assembly being instrumented, not one of its dependencies). The exception is happening when NCrunch tries to load the DLL, which means that I might be able to set up a test that can surface the issue from the same DLL. It's a hope though (not a promise). There's a lot going on here.
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.047 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download