Bug 28211 - Getting "error MT3001: Could not AOT the assembly" When Building for Device
Summary: Getting "error MT3001: Could not AOT the assembly" When Building for Device
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 3.12.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2015-03-19 15:21 UTC by Jimmy [MSFT]
Modified: 2015-04-03 09:55 UTC (History)
8 users (show)

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

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 GitHub or 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:

Comment 2 Sebastien Pouliot 2015-03-19 16:27:51 UTC
@Jimmy an MT3001 error is the AOT compiler crashing while compiling an assembly. From the logs:

		* Assertion at ../../../../../mono/mono/mini/method-to-ir.c:3321, condition `method->is_inflated && mono_method_get_context (method)->method_inst' not met

Minimally we'll need the /Users/Christopher/Documents/Projects/G360/Global 360/ProtocolApp/Main/Ecolab.G360.ProtocolApp.iOS/obj/iPhone/Debug/mtouch-cache/Build/Ecolab.G360.ProtocolApp.Reporting.dll file to reproduce this (and ideally the whole project as there can be dependencies)
Comment 3 Christopher House 2015-03-19 17:13:37 UTC
Sebastien - I provided a repro project to Jimmy that contains the problem assembly.  He was meant to attach it to this case as a private attachment.  If it's not showing as a private attachment feel free to email me directly and I can provide it to you there.  Unfortunately as the code is proprietary, I can't attach it publicly.
Comment 4 Sebastien Pouliot 2015-03-19 17:18:55 UTC
@Christopher thanks! I missed it and only saw the logs (but was there).

@Zoltan using the attachment the crash still occurs in cycle 5

		Mono Ahead of Time compiler - compiling assembly /Users/poupou/Downloads/Archive-2/ReportingProject.Sample/obj/iPhone/Debug/mtouch-cache/64/Build/Ecolab.G360.ProtocolApp.Reporting.dll
		* Assertion at ../../../../../mono/mono/mini/method-to-ir.c:3440, condition `method->is_inflated && mono_method_get_context (method)->method_inst' not met
Comment 7 Zoltan Varga 2015-03-20 18:58:15 UTC
This looks like a compiler problem then, would it be possible to extract a test case from the source code ? Its also possible that the problem is already fixed in 4.0.
Comment 8 Sebastien Pouliot 2015-03-30 10:38:09 UTC
@Paola can you update your system mono to 4.0 and see if this is still an issue ?

If it's still result in an MT3001 error then please try to create a smaller test case out of the original sample.
Comment 9 Paola Villarreal 2015-03-31 16:02:45 UTC
Confirming bug, this still happens on mono 4.0. 

Working on test case. 


Xamarin Studio
Version 5.8.2 (build 7)
Installation UUID: 226bee58-de6e-4832-9b4c-85cdb95c4472
	Mono 4.0.0 ((detached/21d849b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000121

Apple Developer Tools
Xcode 6.2 (6776)
Build 6C131e

Version: (Business Edition)
Hash: 981acb3
Build date: 2015-03-25 14:21:05-0400

Version: (Business Edition)
Android SDK: /Users/paw/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
No Java runtime present, requesting install.

Xamarin Android Player
Not Installed
Comment 10 Paola Villarreal 2015-04-01 00:15:42 UTC
@Jimmy: Quick workaround: Link all assemblies instead of only SDK assemblies.
Comment 11 Dylan Kelly 2015-04-01 13:05:38 UTC
I can also reproduce this issue on mono 4.0. As Paola said, one temporary workaround is linking all assemblies instead of SDK assemblies only.

=== Xamarin Studio ===

Version 5.9 (build 385)
Installation UUID: 476d6850-22f1-4443-980f-6137a73b4b1f
	Mono 4.0.0 ((detached/21d849b)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000121

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 3abf86b
Branch: master
Build date: 2015-04-01 09:55:38-0400

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/dylankelly/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.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 509000385
Git revision: 6fde6079a4d2d27b0eecb290698cafa9feda0338
Build date: 2015-03-31 11:09:26-04
Xamarin addins: 1cec366dee6d690e1ef5df30289b08d03c21c8cd

=== Operating System ===

Mac OS X 10.10.2
Comment 12 Sebastien Pouliot 2015-04-01 13:16:14 UTC
That just means the culprit/miscompiled code is not used and the linker can eliminate it, i.e. it's not a general workaround.
Comment 13 Sebastien Pouliot 2015-04-01 14:46:44 UTC
@Dylan did you fix the bug ? if so can you add more details (e.g. commit hash)
Comment 14 Dylan Kelly 2015-04-01 14:47:45 UTC

Sorry, too many tabs open, accidentally closed the wrong bug.
Comment 15 Marek Safar 2015-04-03 09:55:36 UTC
Fixed in master/Mono 4.0