Bug 34147 - Serious AOT bug
Summary: Serious AOT bug
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 9.0 (iOS9)
Hardware: Other Other
: Normal normal
Target Milestone: 9.2 (C6)
Assignee: Zoltan Varga
Depends on:
Reported: 2015-09-22 03:05 UTC by Herman Schoenfeld
Modified: 2015-10-12 05:01 UTC (History)
5 users (show)

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

Build log (361.80 KB, application/octet-stream)
2015-09-22 03:05 UTC, Herman Schoenfeld
Environment details (1.41 KB, text/plain)
2015-09-22 03:05 UTC, Herman Schoenfeld

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 or GitHub 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 Herman Schoenfeld 2015-09-22 03:05:09 UTC
We've encountered another AOT bug with Xamarin iOS.

Attached is
1. Build Log
2. Environment Details
3. mtouch-cache folder

This issue has been failing since April. Your advice then was to keep using April's version until it was resolved in August. Here we are in September and in iOS 9, and the issue is still occurring.

Since we have a production site currently down (due to iOS 9) we need to urgently rebuild the app, are you able to expedite this?

I am XI, XA & XM Professional subscriber and I am requesting priority support on this issue please.
Comment 1 Herman Schoenfeld 2015-09-22 03:05:37 UTC
Created attachment 13005 [details]
Build log
Comment 2 Herman Schoenfeld 2015-09-22 03:05:58 UTC
Created attachment 13006 [details]
Environment details
Comment 4 Sebastien Pouliot 2015-09-22 08:29:29 UTC
@Herman, I do not recall that specific error. There was a bug causing MT3001 errors (AOT compiler crash) a few months ago but it was resolved. Do you recall your bug number ?

Also did you try to build without LLVM ?

Your logs are from XI 9.2 (alpha), did you get the same error with 9.0 (stable) ?

note: priority support request are handled by support (see yellow banner on top of bugzilla pages).

		AOT Compilation exited with code 1, command:
		MONO_PATH=/Users/Developer/Documents/Development/5D/SH2/SH2.Mobile.iOS/obj/iPhone/Release/mtouch-cache/64/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/ --debug --llvm -O=gsharedvt -O=-float32  --aot=mtriple=arm64-ios,full,static,asmonly,direct-icalls,nodebug,dwarfdebug,llvm-path=/Library/Frameworks/Xamarin.iOS.framework/Versions/,outfile=/Users/Developer/Documents/Development/5D/SH2/SH2.Mobile.iOS/obj/iPhone/Release/mtouch-cache/FluentSync.iOS.dll.arm64.s,llvm-outfile=/Users/Developer/Documents/Development/5D/SH2/SH2.Mobile.iOS/obj/iPhone/Release/mtouch-cache/FluentSync.iOS.dll.arm64-llvm.o "/Users/Developer/Documents/Development/5D/SH2/SH2.Mobile.iOS/obj/iPhone/Release/mtouch-cache/64/Build/FluentSync.iOS.dll"
		PHINode should have one entry for each predecessor of its parent basic block!
		  %139 = phi %System.Guid* [ %10, %BB15 ], [ %7, %BB17 ]
		LLVM ERROR: Broken function found, compilation aborted!

@Zoltan, have you seen this one before ?
Comment 5 Zoltan Varga 2015-09-22 12:08:05 UTC
I can reproduce this.
Comment 6 Zoltan Varga 2015-09-22 12:08:31 UTC
-> reopen.
Comment 7 Zoltan Varga 2015-09-22 15:06:15 UTC
Should be fixed by mono master 6fb7ac2cb2df3d75f1fee054fbcd5413196121e9.

As a workaround, disable LLVM or disable the obfuscation on FluentSync.iOS.dll if possible.
Comment 8 Sebastien Pouliot 2015-09-24 21:49:05 UTC
Thanks Zoltan!

maccore/master caccada22b07d4b3b8af5603fda25c974831d7ad has the mono bump.
Backport to C6 is tracked in https://trello.com/c/Xrrz0w4T/155-xi-34147-aot-problem
Comment 9 Arpit Jha 2015-09-29 11:30:45 UTC
I am able to reproduce this issue mentioned in comment 4

Steps followed to reproduce this issue :
1.Create a Xamarin.iOS single view application.
2.Add refrence of FluentSync.iOS from 64/Build/FluentSync.iOS.dll from comment 3 attchment.
3.Add Namespace
Using FluentSync.Core in ViewController.cs
4.Implement following code in ViewController.cs
public override void ViewDidLoad ()
   base.ViewDidLoad ();
   DefaultPrimaryKeyResolver dpkr = new DefaultPrimaryKeyResolver ();
   var abc = dpkr.DefaultStrategy;

   // Perform any additional setup after loading the view, typically from a nib.
5.Attach device to mac machine
5.Set Supported architecture from Project ->Option->iOS Build->Supported Architecture to ARMv7 + ARMv7s +ARM64 
6.Linker Behaviour to Dont Link Project ->Option->iOS Build.
7.Checked Use the LLVM and Use thumb2 option
8.Build the application in Debug/iPhone configuration.

Screencast: http://www.screencast.com/t/Ny3WQ7zoYcvG
Build output:https://gist.github.com/Arpit360/673b6baa744fe61d4f8d

I have verified this issue with XI with above reproducible steps and also add System.Data to refrence of project.
Build Output: https://gist.github.com/Arpit360/ba9a660ba1b3bf0283f7
Environment Info: https://gist.github.com/Arpit360/510be7fe6a6ff98d741e
Comment 10 Arpit Jha 2015-09-30 05:14:40 UTC
An update to comment 9:
Build for Reproducing this issue: 
Mono : MonoFramework-MDK-
XS: XamarinStudio-
XI : monotouch-
Comment 11 Arpit Jha 2015-10-12 05:01:05 UTC
I have checked this issue with Cycle 6 latest  build and observed that this issue is working fine.

Screencast: http://www.screencast.com/t/FXJSJSA7wzqb

Environment: === Xamarin Studio ===

Version 5.10 (build 815)
Installation UUID: 3d25a767-a003-4a7d-9f5e-e57987cf6cf0
	Mono 4.2.1 (explicit/d8b68fd)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010069

=== Xamarin.Profiler ===

Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 3e5d608
Branch: master
Build date: 2015-10-09 16:01:44-0400

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/mac360_xamarin/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)

SDK Tools Version: 24.4
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: 0.6.1
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 510000815
Git revision: 1f1910169d5433415cac632094c57272080ef9df
Build date: 2015-10-08 14:39:26-04
Xamarin addins: a44901897f3e0c6a25c0f12b6a5fcd892faecdbc
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.10.5
Darwin mac360-xamarins-Mac-mini.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64