Bug 31009 - [XVS.iOS 3.11] AOT of Cirrious.MvvmCross.Binding.dll with "-v -v -v -v" verbose logging causes "System.ArgumentOutOfRangeException: startIndex > this.length"
Summary: [XVS.iOS 3.11] AOT of Cirrious.MvvmCross.Binding.dll with "-v -v -v -v" verbo...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.11 (C5)
Hardware: PC Windows
: --- minor
Target Milestone: 3.11.3 (C5SR3)
Assignee: Bugzilla
Depends on:
Blocks: 25344
  Show dependency tree
Reported: 2015-06-11 00:12 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-07-02 09:25 UTC (History)
6 users (show)

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

Test case (13.80 KB, application/zip)
2015-06-11 00:12 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Logs and version information (28.56 KB, application/zip)
2015-06-11 00:13 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 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:

Description Brendan Zagaeski (Xamarin Team, assistant) 2015-06-11 00:12:50 UTC
Created attachment 11563 [details]
Test case

[XVS.iOS 3.11] AOT of Cirrious.MvvmCross.Binding.dll with "-v -v -v -v" verbose logging causes "System.ArgumentOutOfRangeException: startIndex > this.length"

Related to Bug 30038 and Bug 29979.

## Regression status: Regression between 3.9 and 3.11

BAD:  XamarinVS 3.11.658.0 (5d30dad) + Xamarin.iOS  (03fdc45)
BAD:  XamarinVS 3.11.590.0 (5160db7) + Xamarin.iOS  (e6ebd18)
BAD:  XamarinVS 3.11.458.0 (7acdedd) + Xamarin.iOS (3c4e832)
GOOD: XamarinVS 3.9.547.0  (20fd2f0) + Xamarin.iOS    (f7736a4)

## Steps to reproduce

Build the attached test case in the "iPhone|Debug" configuration.

## About the test case

This is a "Visual C# -> iOS -> iPhone -> Single View App (iPhone)" project with 3 changes:

- The following line added in `RootViewController.cs`:
> var x = typeof(Cirrious.MvvmCross.Binding.Touch.Views.MvxBaseCollectionViewSource);

- The MvvmCross.CrossCore NuGet package added to the project.

- "-v -v -v -v" added under "Project Properties -> iOS Build -> Additional mtouch arguments"

## Results

The build fails and the build host gets disconnected.

### From `devenv*.log`

> [2015-06-10 23:11:29.1] [2015-06-11 03:11:28.9] Unhandled Exception:
> [2015-06-10 23:11:29.3] [2015-06-11 03:11:28.9] System.ArgumentOutOfRangeException: startIndex > this.length
> [2015-06-10 23:11:29.5] [2015-06-11 03:11:28.9] Parameter name: startIndex
> [2015-06-10 23:11:29.7] [2015-06-11 03:11:28.9]   at System.String.IndexOf (Char value, Int32 startIndex) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:30.0] [2015-06-11 03:11:28.9]   at Microsoft.Build.Utilities.MSBuildErrorParser.TryParseLine (System.String line) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:30.2] [2015-06-11 03:11:28.9]   at Microsoft.Build.Utilities.ToolTask.LogEventsFromTextOutput (System.String singleLine, MessageImportance messageImportance) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:30.5] [2015-06-11 03:11:28.9]   at Xamarin.iOS.Tasks.MTouchTaskBase.LogEventsFromTextOutput (System.String singleLine, MessageImportance messageImportance) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:30.7] [2015-06-11 03:11:28.9]   at Microsoft.Build.Utilities.ToolTask.ProcessLine (System.Text.StringBuilder outputBuilder, System.String line, MessageImportance importance) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:30.9] [2015-06-11 03:11:28.9]   at Microsoft.Build.Utilities.ToolTask+<ExecuteTool>c__AnonStorey0.<>m__0 (System.Object _, System.String msg) [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:31.2] [2015-06-11 03:11:29.0]   at Microsoft.Build.Utilities.ProcessWrapper.CaptureOutput () [0x00000] in <filename unknown>:0 
> [2015-06-10 23:11:31.4] [2015-06-11 03:11:29.0]   at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0 

### Based on time stamps, my guess is that the problem might be related to the following line from `UnifiedSingleViewIphone1_*.log`

> [10-Jun-2015 23:11:28] @implementation Cirrious_MvvmCross_Binding_Touch_Views_MvxBaseCollectionViewSource { } 

## Partial workaround

Remove "-v -v -v -v" from "Additional mtouch arguments".
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2015-06-11 00:13:20 UTC
Created attachment 11564 [details]
Logs and version information
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-06-11 00:57:02 UTC
## More precise partial workaround

Use no more than 1 verbosity flag "-v" under "Additional mtouch arguments".
Comment 5 Parmendra Kumar 2015-06-30 13:44:54 UTC
I have checked this issue and now its working fine at my end. 

Hence closing this issue.

Environment info:

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.11.719.0 (60a47e6)
Xamarin.iOS (2ff86031d2ac258df6cfd73c539fd06083c180ef)
Xamarin.ios build-host: