Bug 43724 - System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Summary: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negat...
Status: RESOLVED DUPLICATE of bug 43636
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-08-24 22:01 UTC by Tony Wang
Modified: 2016-08-26 08:41 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Build Log (427.12 KB, text/plain)
2016-08-24 22:01 UTC, Tony Wang
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 43636

Description Tony Wang 2016-08-24 22:01:41 UTC
Created attachment 17204 [details]
Build Log

Got this exception in build time complaining Mono.CSharp.InternalErrorException at GridViewModel.cs(699,9). Here is 

Code snapshot:
698        private async Task<int> GetItemCountInternal(IList<Sort> sortList, CancellationToken cancellationToken)
699        {
700            this.readIndexRequestCount++;
701            this.IsLoadingIndex = true;
702            TaskCanceledException taskCanceledException = null;
703            Stopwatch timer = Stopwatch.StartNew();
               ...

And log from Xamarin Studio attached.
Comment 1 Tony Wang 2016-08-25 17:03:36 UTC
Here is a copy of XS version:

Xamarin Studio Enterprise
Version 6.1 (build 5345)
Installation UUID: f0fcf788-feba-4081-96ff-c53268374374
Runtime:
	Mono 4.6.0 (mono-4.6.0-branch/d0fc1a6) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000150

NuGet
Version: 3.4.3.0

Xamarin.Profiler
Not Installed

Xamarin.Android
Not Installed

Xamarin Android Player
Not Installed

Apple Developer Tools
Xcode 7.2.1 (9548.1)
Build 7C1002

Xamarin.iOS
Not Installed

Xamarin.Mac
Version: 2.10.0.65 (Xamarin Enterprise)

Build Information
Release ID: 601005345
Git revision: fc3ab7c0cc891ef8c9867558d026257fc4654758
Build date: 2016-08-16 18:26:59-04
Xamarin addins: 695f42de8ea790cc717ccd388f2becfa35e704ae
Build lane: monodevelop-lion-cycle8

Operating System
Mac OS X 10.11.6
Darwin towang-macbook 15.6.0 Darwin Kernel Version 15.6.0
    Thu Jun 23 18:25:34 PDT 2016
    root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
Comment 2 Chris Hamons 2016-08-25 17:27:08 UTC
	Mono.CSharp.InternalErrorException: ../Grid/GridViewModel.cs(699,9): Microsoft.AdvertisingDesktop.ViewModels.GridViewModel<TBusinessObject,TDataObject,TEFDataObject,TEntityRowValue>.<GetItemCountInternal>c__async7.MoveNext() ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
		Parameter name: index
		  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00011] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at System.Collections.Generic.List`1[T].set_Item (System.Int32 index, T value) [0x0000c] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at IKVM.Reflection.Emit.ILGenerator.MarkLabel (IKVM.Reflection.Emit.Label loc) [0x00018] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.EmitContext.MarkLabel (IKVM.Reflection.Emit.Label label) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AwaitStatement.EmitPrologue (Mono.CSharp.EmitContext ec) [0x0018c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Await.EmitToField (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.FieldExpr.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean isCompound) [0x0005d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.HoistedVariable.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean isCompound) [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.VariableReference.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean prepare_for_load) [0x0000e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Assign.Emit (Mono.CSharp.EmitContext ec, System.Boolean is_statement) [0x0000c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Assign.EmitStatement (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.BlockVariable.DoEmit (Mono.CSharp.EmitContext ec) [0x00028] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryCatch.DoEmit (Mono.CSharp.EmitContext ec) [0x00012] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryFinally.EmitTryBody (Mono.CSharp.EmitContext ec) [0x00092] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryFinallyBlock.DoEmit (Mono.CSharp.EmitContext ec) [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ParametersBlock.EmitEmbedded (Mono.CSharp.EmitContext ec) [0x00036] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer.EmitMoveNext (Mono.CSharp.EmitContext ec) [0x001b4] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer+MoveNextBodyStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer+MoveNextBodyStatement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00036] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00045] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		   --- End of inner exception stack trace ---
		  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x000df] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00092] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.MethodOrOperator.Emit () [0x001d0] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Method.Emit () [0x0012c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		   --- End of inner exception stack trace ---
		  at Mono.CSharp.Method.Emit () [0x00141] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.Emit () [0x0026e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.Emit () [0x0026e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Class.Emit () [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.EmitContainer () [0x0000f] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ModuleContainer.EmitContainer () [0x0009c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AssemblyDefinition.Emit () [0x00098] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00126] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Driver.Compile () [0x002f3] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: ../Grid/GridViewModel.cs(699,9): Microsoft.AdvertisingDesktop.ViewModels.GridViewModel<TBusinessObject,TDataObject,TEFDataObject,TEntityRowValue>.<GetItemCountInternal>c__async7.MoveNext() ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
		Parameter name: index
		  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00011] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at System.Collections.Generic.List`1[T].set_Item (System.Int32 index, T value) [0x0000c] in <7e6320e1bf324edabcc223f7941682a8>:0 
		  at IKVM.Reflection.Emit.ILGenerator.MarkLabel (IKVM.Reflection.Emit.Label loc) [0x00018] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.EmitContext.MarkLabel (IKVM.Reflection.Emit.Label label) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AwaitStatement.EmitPrologue (Mono.CSharp.EmitContext ec) [0x0018c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Await.EmitToField (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.FieldExpr.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean isCompound) [0x0005d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.HoistedVariable.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean isCompound) [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.VariableReference.EmitAssign (Mono.CSharp.EmitContext ec, Mono.CSharp.Expression source, System.Boolean leave_copy, System.Boolean prepare_for_load) [0x0000e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Assign.Emit (Mono.CSharp.EmitContext ec, System.Boolean is_statement) [0x0000c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Assign.EmitStatement (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.BlockVariable.DoEmit (Mono.CSharp.EmitContext ec) [0x00028] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryCatch.DoEmit (Mono.CSharp.EmitContext ec) [0x00012] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryFinally.EmitTryBody (Mono.CSharp.EmitContext ec) [0x00092] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TryFinallyBlock.DoEmit (Mono.CSharp.EmitContext ec) [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x0000d] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ParametersBlock.EmitEmbedded (Mono.CSharp.EmitContext ec) [0x00036] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer.EmitMoveNext (Mono.CSharp.EmitContext ec) [0x001b4] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer+MoveNextBodyStatement.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.StateMachineInitializer+MoveNextBodyStatement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00013] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00050] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00036] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00045] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		   --- End of inner exception stack trace ---
		  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x000df] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00092] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.MethodOrOperator.Emit () [0x001d0] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Method.Emit () [0x0012c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		   --- End of inner exception stack trace ---
		  at Mono.CSharp.Method.Emit () [0x00141] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.Emit () [0x0026e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.Emit () [0x0026e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ClassOrStruct.Emit () [0x00025] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Class.Emit () [0x00000] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeDefinition.EmitContainer () [0x0000f] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00007] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x0001e] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.ModuleContainer.EmitContainer () [0x0009c] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AssemblyDefinition.Emit () [0x00098] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00126] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Driver.Compile () [0x002f3] in <c9dbde476a9e440c8effd15ae3886f7b>:0 
		  at Mono.CSharp.Driver.Main (System.String[] args) [0x00052] in <c9dbde476a9e440c8effd15ae3886f7b>:0
Comment 3 Chris Hamons 2016-08-25 17:27:21 UTC
Confirmed in latest beta.
Comment 4 Marek Safar 2016-08-26 08:41:19 UTC

*** This bug has been marked as a duplicate of bug 43636 ***