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

Notification

Icon
Error

System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
robinz
#1 Posted : Monday, September 27, 2021 11:38:19 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
After a relatively small update I started getting the error below. I've confirmed that I can update to the prior commit and the error goes away. The code builds and runs just fine at the commit that causes the NCrunch error. I'm running version 4.9.0.8.

[PID:31152 18:16:23.8724 LocalBuildTask-56] ERROR (Internal): System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
Parameter name: sourceIndex
at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory.(CilAddress , CilAddress , UInt32 , UInt32 )
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory..ctor(CilAddress rawPdbBase, CilLegacyPdbHeader header)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacySymbolsDataSource..ctor(Byte[] pdbFileContent, UInt32 entryPointToken)
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, GridAddress clientAddress, Boolean extractCoverageReportStructure)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.ProcessingQueue..()
1 user thanked robinz for this useful post.
fanblade on 5/8/2023(UTC)
Remco
#2 Posted : Tuesday, September 28, 2021 12:17:08 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
robinz;15664 wrote:
After a relatively small update I started getting the error below. I've confirmed that I can update to the prior commit and the error goes away. The code builds and runs just fine at the commit that causes the NCrunch error. I'm running version 4.9.0.8.


Thanks for sharing this issue. Can you confirm whether the update you're describing was to your own codebase, or was it to NCrunch itself?

Is the project involved of an unusual size?

Can you confirm if the build referenced in this thread solves the issue for you? https://forum.ncrunch.net/yaf_postst3145_Problem-with-new-instrumentation-since-4-9.aspx.
robinz
#3 Posted : Tuesday, September 28, 2021 2:56:47 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
The update was to our codebase.

We're working in VS 2019, in Debug x64 mode.

On the update that works we have this size:
dll: 11.0 MB (11,601,920 bytes)
pdb: 26.1 MB (27,383,296 bytes)

The commit that fails has this size:
dll: 11.0 MB (11,602,432 bytes)
pdb: 26.1 MB (27,385,344 bytes)

I updated to NCrunch 4.10.0.2 and am receiving a similar error:
[PID:25896 09:52:18.7988 LocalBuildTask-53] ERROR (Internal): System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
Parameter name: sourceIndex
at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory.(CilAddress , CilAddress , UInt32 , UInt32 )
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory..ctor(CilAddress rawPdbBase, CilLegacyPdbHeader header)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacySymbolsDataSource..ctor(Byte[] pdbFileContent, UInt32 entryPointToken)
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, GridAddress clientAddress, Boolean extractCoverageReportStructure)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTa
Remco
#4 Posted : Tuesday, September 28, 2021 10:52:29 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
Thanks for these extra details.

I haven't seen this issue before. Somehow there has been a change in the way the O/S is structuring the PDB.

Do you have the option to switch to using a portable PDB instead? This would give an effective workaround to the problem.
robinz
#5 Posted : Thursday, September 30, 2021 11:05:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I was able to rebase the branch on a newer version of our software that had some changes to how the project was configured and the problem went away.
Remco
#6 Posted : Thursday, September 30, 2021 11:09:35 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
robinz;15676 wrote:
I was able to rebase the branch on a newer version of our software that had some changes to how the project was configured and the problem went away.


Thanks for letting me know. If you find a way to reproduce this problem with a self-contained sample you can share with me, please send it through the contact form. NCrunch is supposed to be able to handle any PDB produced by the compiler. It makes me nervous knowing it's possible for something to exist that we can't handle.
fanblade
#8 Posted : Monday, May 8, 2023 4:36:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/8/2023(UTC)
Posts: 1
Location: United States of America

Thanks: 1 times
I got the same error today and found a workaround. Similarly, it was an innocuous change to the code that compiled fine in Visual Studio but created this error when nCrunch compiled it. I don't know what the root cause was, but restarting my PC worked around the issue.
robinz
#9 Posted : Wednesday, August 2, 2023 4:55:10 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Got this error again after a small code change using NCrunch 4.11. I updated to 4.18.0.3 and received a similar error:

4.11

[PID:37408 10:39:22.244 LocalBuildTask-66] ERROR (Internal): System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
Parameter name: sourceIndex
at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory.(CilAddress , CilAddress , UInt32 , UInt32 )
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory..ctor(CilAddress rawPdbBase, CilLegacyPdbHeader header)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacySymbolsDataSource..ctor(Byte[] pdbFileContent, UInt32 entryPointToken)
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, GridAddress clientAddress, Boolean extractCoverageReportStructure)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.ProcessingQueue..()

4.18.0.3
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
NCrunch has encountered an internal error: System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
Parameter name: sourceIndex
at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory.(CilAddress , CilAddress , UInt32 , UInt32 )
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory..ctor(CilAddress rawPdbBase, CilLegacyPdbHeader header)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacySymbolsDataSource..ctor(Byte[] pdbFileContent, UInt32 entryPointToken)
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)

I was able to get around this by removing some obsolete files in the offending project.
Remco
#11 Posted : Wednesday, August 2, 2023 11:40:54 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
Hi, thanks for sharing this issue.

I believe this to be a compatibility problem in NCrunch's assembly parsing system. Somehow, the size/structure of the assembly PDB it's trying to load is different to what it can handle.

I've yet to manage to produce such a situation with a test assembly in order to fix the problem. You might be able to work around this by using the new portable PDB format for this project instead of the old legacy one. The legacy PDBs are slowing being phased out now anyway.
robinz
#12 Posted : Wednesday, March 4, 2026 7:29:47 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Remco,

Wanted to let you know that it has been a while since I've seen this error, but it just popped up again in 5.20.0.2:
NCrunch has encountered an internal error: System.ArgumentOutOfRangeException: Arrays larger than 2GB are not supported.
Parameter name: sourceIndex
at System.Array.Copy(Array sourceArray, Int64 sourceIndex, Array destinationArray, Int64 destinationIndex, Int64 length)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory.readStream(CilAddress rawPdbBase, CilAddress streamPagesArrayAddress, UInt32 totalStreamLengthInBytes, UInt32 pageCount)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacyPdbStreamDirectory..ctor(CilAddress rawPdbBase, CilLegacyPdbHeader header)
at nCrunch.Compiler.Cil.Symbols.Legacy.CilLegacySymbolsDataSource..ctor(Byte[] pdbFileContent, UInt32 entryPointToken)
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.<>c__DisplayClass27_0.<processBuiltAssembly>b__0()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.processBuiltAssembly(ComponentInstrumentationParameters instrumentationParameters, BuildOutput output, IBackgroundTaskProcessor backgroundTaskProcessor)
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)
Remco
#13 Posted : Wednesday, March 4, 2026 10:37:38 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
Thanks for letting me know. I have also had another recent report that suggests this is still happening in niche scenarios. I have yet to pin it down in a way that allows me to fix it.

You might find you're able to work around the problem by adding a dummy class/method in project, as this shuffles the element counts involved.
robinz
#14 Posted : Wednesday, March 4, 2026 11:03:28 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
FYI, I switched to another working directory, and it worked just fine on the same code.
Remco
#15 Posted : Wednesday, March 4, 2026 11:19:45 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
robinz;18708 wrote:
FYI, I switched to another working directory, and it worked just fine on the same code.


That's actually quite alarming. It suggests the problem is intermittent or not specific to the structure of the assembly. When you switched directory, what actually changed? Is there anything that might have affected the compiled state of the assembly?
robinz
#16 Posted : Thursday, March 5, 2026 1:40:12 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I figured you would love that ;)

Nothing changed that I'm aware of. My working directories "should" be identical, but they obviously aren't.

When I get this error, I can ask NCrunch to Reload and Rebuild as many times as I want, but it always fails. The only fix is to add or remove enough code (and I have no idea what "enough" is) to get it past the error. I believe I've tried the trick of moving to another working directory in the past and had that continue to fail, but it has been long enough that I might be remembering incorrectly.
Remco
#17 Posted : Thursday, March 5, 2026 2:38:59 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
For the project that's failing like this, what do you currently have your debug/PDB set to? Is it embedded? Does changing it to portable resolve the issue?
robinz
#18 Posted : Thursday, March 5, 2026 4:26:18 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/25/2019(UTC)
Posts: 13
Location: United States of America

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I'm currently set to full. I moved on to another project in that workspace, and I can't reproduce the error now. I'll change that setting the next time this shows up.
Remco
#19 Posted : Thursday, March 5, 2026 10:34:15 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
robinz;18714 wrote:
I'm currently set to full. I moved on to another project in that workspace, and I can't reproduce the error now. I'll change that setting the next time this shows up.


Thanks, I'm glad you're up and running again. Right now my suspicion is that something is wrong or unusual with the legacy PDB. If anyone else encounters this issue, I expect that setting the DebugType to Portable will solve it. If your application needs legacy PDBs for its normal runtime environment, you can set them to portable for NCrunch only by using the 'Custom Build Properties' setting.
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.093 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download