Bug 19541 - Remote build "hangs" for ~7 minutes if it hits error MT5211 "... please check that it has the [Protocol] attribute ..."
Summary: Remote build "hangs" for ~7 minutes if it hits error MT5211 "... please check...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.10.x
Hardware: PC Mac OS
: High major
Target Milestone: 2.0
Assignee: Vinicius Jarina
Depends on:
Reported: 2014-05-05 17:42 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-05-13 12:33 UTC (History)
7 users (show)

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

Build host build log (25.10 KB, application/octet-stream)
2014-05-05 17:44 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Sample output which causes issue (2.97 KB, text/plain)
2014-05-09 08:47 UTC, dean.ellis

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) 2014-05-05 17:42:33 UTC
The remote build phase "hangs" for ~7 minutes if it hits error MT5211 "... please check that it has the [Protocol] attribute ...".

## Steps to reproduce

Attempt to build the attached test case for device, for example by deploying to device in the Debug configuration, or by building an Ad-Hoc IPA.

This is simply the sample project from the ZipArchive component (version 1.0) [1].
> [1] http://components.xamarin.com/view/ZipArchive

## Result

### 1. The build log [2] on the build server _correctly_ shows a few errors due to the new static registrar:

[05-May-2014 17:13:12] stdout: Xamarin.iOS 7.2.3 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk


error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_ZipArchiveDelegate. If '_OBJC_CLASS_$_ZipArchiveDelegate' is a protocol from a third-party binding, please check that it has the [Protocol] attribute in its api definition file, otherwise verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

> [2] ~/Library/Logs/Xamarin/MonoTouchVS/TestApp_7a5a90f8-ff24-4a8e-9fb9-3267e1898d6a.log

### 2. BUT, the build then _continues_ through a few more `clang` compilation steps, and "stops" after the last one for about 7 minutes. During this time the "Xamarin.iOS Build Host" app consumes 100% CPU, and Visual Studio is unresponsive on the Windows side.

### 3. After about 7 minutes, the build finally fails [3], and VS becomes responsive again.
> [3] [05-May-2014 17:20:36] Error: Tool MonoTouch.Tools.Tools.Mtouch failed to run

## Workaround (for this particular project)

Add `--registrar:legacy` under "iOS Build -> Additional mtouch arguments". This reverts to the old registrar so that the MT5211 doesn't happen.

### Killing Xamarin.iOS Build Host

If you quit Xamarin.iOS Build Host during the 6 minute delay, Visual Studio becomes responsive again fairly quickly.

## Version information

### Build host

### Windows
Xamarin.Android (3e2a60637a8139091e095fec2046762fd3522d1b)
Xamarin.iOS (08dad7856e903748a89f6ecc37e83da9ea904f76)

Microsoft Visual Studio Professional 2013
Version 12.0.30110.00 Update 1
Microsoft .NET Framework
Version 4.5.51641

Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2014-05-05 17:44:55 UTC
Created attachment 6736 [details]
Build host build log
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2014-05-06 15:06:17 UTC
Update: additional version testing suggests that this is a symptom of the interaction of Xamarin.iOS 7.2.1 or higher with any recent version of the Visual Studio extension. If there's an easy way to trigger the MT5211 error in Xamarin.iOS 7.2.0 or lower, that might show the problem too.

## Additional version information

### Build host

### Windows
Xamarin.iOS   1.10.47 (3d6a125d)

One little difference in 1.10.47 is that Visual Studio remains responsive during the remote build phase.
Comment 5 dean.ellis 2014-05-09 08:12:00 UTC
ok I have replicated the issue, will try to debug now
Comment 6 dean.ellis 2014-05-09 08:47:36 UTC
Created attachment 6766 [details]
Sample output which causes issue
Comment 11 Tajinder Singh 2014-05-13 04:18:39 UTC
I have checked this issue by running the attached project(i.e test case)in both Debug and Ad-Hoc mode.Now on building it gives an error MT5211 but VS doesn't hangs.Below is the screencast for the same:


Environment Details:
VS 2012
XVS 2.0.97

Hence verifying this issue.
Comment 12 Brendan Zagaeski (Xamarin Team, assistant) 2014-05-13 12:33:24 UTC
Awesome stuff! Thanks for the fix!