Bug 52475 - MTOUCH: error MT3001: Could not AOT the assembly
Summary: MTOUCH: error MT3001: Could not AOT the assembly
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: (C9)
Assignee: Zoltan Varga
Depends on:
Reported: 2017-02-13 14:54 UTC by Owen Stewart
Modified: 2017-02-16 06:22 UTC (History)
7 users (show)

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

Sample Project (29.22 KB, application/zip)
2017-02-13 14:54 UTC, Owen Stewart

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



Xamarin studio setup:

=== Xamarin Studio Enterprise ===

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

	Package version: 406020016

=== NuGet ===


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

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise Trial)

=== Xamarin.iOS ===

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

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