Bug 52475

Summary: MTOUCH: error MT3001: Could not AOT the assembly
Product: iOS Reporter: Owen Stewart <owen.stewart>
Component: Mono runtime / AOT compilerAssignee: Zoltan Varga <vargaz>
Status: VERIFIED FIXED    
Severity: normal CC: kumpera, mono-bugs+monotouch, mono-bugs+mono, owen.stewart, sachins, sebastien, timothy.risi
Priority: Normal    
Version: unspecified   
Target Milestone: (C9)   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Sample Project

Description Owen Stewart 2017-02-13 14:54:20 UTC
Created attachment 19800 [details]
Sample Project

When I compile our iOS app for Release|iPhone I keep getting MT3001 errors. I tracked the change that caused this down and have attached a simple sample project to demonstrate the issue.

We use PaintCode to generate C# for vectors used within the app. This is what generated the code that seems to be causing the AOT compiler issues.

If I disable the LLVM optimising compiler option in the iOS build screen the project will compile without error.

Hopefully you can figure out whats happening.

Thanks,

Owen


Xamarin studio setup:

=== Xamarin Studio Enterprise ===

Version 6.1.5 (build 0)
Installation UUID: 7ee048db-6273-472d-a332-6b78c7e2b631
Runtime:
	Mono 4.6.2 (mono-4.6.0-branch/ac9e222) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406020016

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 8.2 (11766)
Build 8C38

=== Xamarin.Android ===

Version: 7.0.2.42 (Visual Studio Enterprise Trial)
Android SDK: /Users/206492439/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 23.0.2

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)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.10.0.120 (Visual Studio Enterprise Trial)

=== Xamarin.iOS ===

Version: 10.3.1.8 (Visual Studio Enterprise Trial)
Hash: 7beaef4
Branch: cycle8-xi
Build date: 2016-12-20 02:58:14-0500

=== Build Information ===

Release ID: 601050000
Git revision: 7494718e127af9eaec45a3bd6282d3da927488bd
Build date: 2017-01-17 10:31:01-05
Xamarin addins: c92d0626d347aaa02839689eaac2961d24c9f446
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.3
Darwin UKCSGOSX-90G8WN 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
Comment 1 Timothy Risi 2017-02-13 19:37:36 UTC
I can confirm I'm seeing the same results: I get the build error trying to build with LLVM, but builds successfully without LLVM.
Comment 2 Zoltan Varga 2017-02-13 19:55:16 UTC
The problem is indeed caused by the huge MemberAppStyleKit:DrawInTheRough () method which overflows some table in the jit. A workaround would be to disable llvm, or to break this method into smaller ones.

This has been fixed by mono master/7bfb9bcb78255b5314e3c9f5489a76e74154435b, it will take some time until the fix shows up in a xamarin.ios version.
Comment 3 Zoltan Varga 2017-02-13 20:16:58 UTC
Note that the fix is low risk so it could in theory make C9.
Comment 4 Sebastien Pouliot 2017-02-15 14:54:36 UTC
@Zoltan, if you're fine in back porting this to mono-4.8.0-branch then we'll do the bumps and mark it solved (so QA can verify).
Comment 5 Zoltan Varga 2017-02-15 17:06:51 UTC
Done, ed0fb9dea072737e74a5c2302d14dd3ccd5cb23a.
Comment 6 Sebastien Pouliot 2017-02-15 18:58:13 UTC
Thanks!

cycle9 PR https://github.com/xamarin/xamarin-macios/pull/1696