Bug 34147

Summary: Serious AOT bug
Product: iOS Reporter: Herman Schoenfeld <herman>
Component: Mono runtime / AOT compilerAssignee: Zoltan Varga <vargaz>
Status: VERIFIED FIXED    
Severity: normal CC: arpitj, kumpera, mono-bugs+monotouch, pj.beaman, sebastien
Priority: Normal    
Version: XI 9.0 (iOS9)   
Target Milestone: 9.2 (C6)   
Hardware: Other   
OS: Other   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Build log
Environment details

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/9.2.0.53/bin/arm64-darwin-mono-sgen --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/9.2.0.53/LLVM/bin/,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 9.3.0.100 with above reproducible steps and also add System.Data to refrence of project.
Screencast:http://www.screencast.com/t/nHcknzaeBoQ
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-4.2.1.59.macos10.xamarin.x86_328e048e15fc27500b549e6b5fbfb3b4bc06e72d
XS: XamarinStudio-5.10.0.804_5279c3ca6e01c79ce4d8e9918853245efe632140
XI : monotouch-9.2.0.79_6121d434710754ffb137fa5c6dcabcb34f876f2f
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
Runtime:
	Mono 4.2.1 (explicit/d8b68fd)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010069

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

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

=== Xamarin.Android ===

Version: 6.0.0.9 (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: 2.4.0.79 (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