Bug 22279 - Compiler crashed with code : 1
Summary: Compiler crashed with code : 1
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.16.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-08-22 04:55 UTC by klaasel
Modified: 2016-01-15 11:45 UTC (History)
5 users (show)

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


Attachments
MSBuild output for bug "Compiler crashed with code: 1" (225.82 KB, text/plain)
2014-08-23 11:21 UTC, klaasel
Details
Successfull build (2.20 MB, text/plain)
2014-08-23 11:35 UTC, klaasel
Details


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:
Status:
RESOLVED NOT_REPRODUCIBLE

Description klaasel 2014-08-22 04:55:04 UTC
Android project didn't compile with "compiler crashed with code:1", a very unfriendly error.

I fixed it after putting the target framework of my project down for Android (the datamodel) down to 4.0, although all other projects are still on "use latest installed platform.
Comment 1 Jonathan Pryor 2014-08-22 13:12:58 UTC
This is usually indicative of an actual compiler bug (the compiler crashed) or an xbuild bug in parsing the compiler error messages, e.g. Bug #14767.

To know which is happening, we would either need the project or Diagnostic Build Output:

http://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Diagnostic_MSBuild_Output

It may also be necessary to re-execute the `mcs` command shown in the diagnostic build output to see if mcs is crashing or not.
Comment 2 klaasel 2014-08-23 11:21:28 UTC
Created attachment 7782 [details]
MSBuild output for bug "Compiler crashed with code: 1"

added the MSBuild output
Comment 3 klaasel 2014-08-23 11:35:10 UTC
Created attachment 7783 [details]
Successfull build
Comment 4 Jonathan Pryor 2014-08-25 14:55:32 UTC
Attachment #7782 [details] is in fact a compiler crash, so the error is appropriate:

> Unhandled Exception:
> IKVM.Reflection.MissingMemberException: Member 'System.AttributeTargets' is a missing member and does not support the requested operation.
> ...

Xamarin.Android uses the "system mono" to compile C# code. Are Attachment #7782 [details] and Attachment #7783 [details] from different machines? Do they have the same mono version? (They both appear to be Mono 3.6.0, but confirmation would be helpful.)
Comment 5 klaasel 2014-08-26 02:44:56 UTC
yes, they are from the same machine. There isn't a specific action from my side which seem to cause the compiler crash as far I can notice.

The way I now circumvent this is restart Xamarin and even reboot my MacBook. Then it works again for a short or more extended time.
Comment 6 Marek Safar 2014-08-26 07:27:34 UTC
This is xbuild issue, when you look carefully at the output of successful build you can see

		Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/Olijslager.CatalogusApp.Android.Model.dll /resource:obj/Debug/Olijslager.CatalogusApp.Android.Model.obj.Debug.__AndroidLibraryProjects__.zip,__AndroidLibraryProjects__.zip ../Olijslager.CatalogusApp.Shared.Model/BaseClasses/IItemProperty.cs ../Olijslager.CatalogusApp.Shared.Model/BaseUnit.cs ../Olijslager.CatalogusApp.Shared.Model/CustomerData.cs ../Olijslager.CatalogusApp.Shared.Model/Item.cs ../Olijslager.CatalogusApp.Shared.Model/ItemSurfaceType.cs ../Olijslager.CatalogusApp.Shared.Model/Location.cs ../Olijslager.CatalogusApp.Shared.Model/Manufacturer.cs ../Olijslager.CatalogusApp.Shared.Model/Order.cs ../Olijslager.CatalogusApp.Shared.Model/OrderEntry.cs ../Olijslager.CatalogusApp.Shared.Model/Package.cs ../Olijslager.CatalogusApp.Shared.Model/Paint.cs ../Olijslager.CatalogusApp.Shared.Model/PdfFile.cs ../Olijslager.CatalogusApp.Shared.Model/SearchFilter.cs ../Olijslager.CatalogusApp.Shared.Model/Setting.cs ../Olijslager.CatalogusApp.Shared.Model/Supplier.cs ../Olijslager.CatalogusApp.Shared.Model/SurfaceType.cs ../Olijslager.CatalogusApp.Shared.Model/User.cs Resources/Resource.Designer.cs Properties/AssemblyInfo.cs ../Olijslager.CatalogusApp.Shared.Model/Branch.cs obj/Debug/MonoAndroid,Version=v4.0.3.AssemblyAttribute.cs /target:library /define:"DEBUG;TRACE;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__" /nostdlib /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.0.3/Mono.Android.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/mscorlib.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Xml.Linq.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Xml.dll /reference:../../packages/Newtonsoft.Json.6.0.4/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.6/Mono.Android.Support.v4.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Core.dll /reference:/Users/klaasvanslageren/Documents/Projects/Intrisio/Olijslager.CatalogusApp/trunk/Shared/Olijslager.CatalogusApp.Android.Utility/bin/Debug//Olijslager.CatalogusApp.Android.Utility.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Collections.Concurrent.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Collections.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ComponentModel.Annotations.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ComponentModel.EventBasedAsync.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ComponentModel.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Diagnostics.Contracts.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Diagnostics.Debug.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Diagnostics.Tools.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Dynamic.Runtime.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Globalization.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.IO.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Linq.Expressions.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Linq.Parallel.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Linq.Queryable.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Linq.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Net.NetworkInformation.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Net.Primitives.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Net.Requests.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ObjectModel.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.Emit.ILGeneration.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.Emit.Lightweight.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.Emit.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.Extensions.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.Primitives.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Reflection.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Resources.ResourceManager.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.Extensions.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.InteropServices.WindowsRuntime.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.InteropServices.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.Numerics.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.Serialization.Json.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.Serialization.Primitives.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.Serialization.Xml.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Security.Principal.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ServiceModel.Http.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.ServiceModel.Primitives.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Text.Encoding.Extensions.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Text.Encoding.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Text.RegularExpressions.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Threading.Tasks.Parallel.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Threading.Tasks.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Threading.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Xml.ReaderWriter.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Xml.XDocument.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Xml.XmlSerializer.dll /warn:4
		Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution finished.


whereas the failed build has only

				Tool /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/smcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/Olijslager.CatalogusApp.Android.Model.dll /resource:obj/Debug/Olijslager.CatalogusApp.Android.Model.obj.Debug.__AndroidLibraryProjects__.zip,__AndroidLibraryProjects__.zip ../Olijslager.CatalogusApp.Shared.Model/BaseClasses/IItemProperty.cs ../Olijslager.CatalogusApp.Shared.Model/BaseUnit.cs ../Olijslager.CatalogusApp.Shared.Model/CustomerData.cs ../Olijslager.CatalogusApp.Shared.Model/Item.cs ../Olijslager.CatalogusApp.Shared.Model/ItemSurfaceType.cs ../Olijslager.CatalogusApp.Shared.Model/Location.cs ../Olijslager.CatalogusApp.Shared.Model/Manufacturer.cs ../Olijslager.CatalogusApp.Shared.Model/Order.cs ../Olijslager.CatalogusApp.Shared.Model/OrderEntry.cs ../Olijslager.CatalogusApp.Shared.Model/Package.cs ../Olijslager.CatalogusApp.Shared.Model/Paint.cs ../Olijslager.CatalogusApp.Shared.Model/PdfFile.cs ../Olijslager.CatalogusApp.Shared.Model/SearchFilter.cs ../Olijslager.CatalogusApp.Shared.Model/Setting.cs ../Olijslager.CatalogusApp.Shared.Model/Supplier.cs ../Olijslager.CatalogusApp.Shared.Model/SurfaceType.cs ../Olijslager.CatalogusApp.Shared.Model/User.cs Resources/Resource.Designer.cs Properties/AssemblyInfo.cs ../Olijslager.CatalogusApp.Shared.Model/Branch.cs /target:library /define:"DEBUG;TRACE;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__" /nostdlib /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.0.3/Mono.Android.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/mscorlib.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Xml.Linq.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Xml.dll /reference:../../packages/Newtonsoft.Json.6.0.4/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.6/Mono.Android.Support.v4.dll /reference:/Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/System.Core.dll /reference:/Users/klaasvanslageren/Documents/Projects/Intrisio/Olijslager.CatalogusApp/trunk/Shared/Olijslager.CatalogusApp.Android.Utility/bin/Debug//Olijslager.CatalogusApp.Android.Utility.dll /warn:4

I'll add better compiler handling but the real issue is somewhere in xbuild because list of referenced is incomplete in the case where there is build failure.
Comment 7 klaasel 2014-08-26 07:34:38 UTC
My guess is the xbuild issue because I added NuGet packages, Newtonsoft.Json amongst others and the References > From Package could be the cause. I'll try to add them manually.
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-10 02:16:37 UTC
I stumbled across a closely related (maybe even identical) behavior today and filed a bug for it here:
https://bugzilla.xamarin.com/show_bug.cgi?id=22805

In my case, changing the references on an open project causes the problem, and closing and re-opening the project solves the problem.
Comment 9 Sadik Ali 2016-01-15 11:37:46 UTC
I have tried this issue at my end but not able to reproduce it. Could you please provide  the Sample details, Build Output, Environment Info to reproduce the issue.


Build Output: Errors-Build Output

Environment Info:

=== Xamarin Studio ===

Version 5.10.2 (build 51)
Installation UUID: 5aee9e7c-04d2-4896-b80a-a918340ae634
Runtime:
	Mono 4.2.2 (explicit/9236711)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402020025

=== Xamarin.Profiler ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.1.5 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/setup/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)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

=== Xamarin Android Player ===

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

=== Apple Developer Tools ===

Xcode 7.3 (10130.10)
Build 7D111g

=== Xamarin.iOS ===

Version: 9.4.1.15 (Business Edition)
Hash: 28b1990
Branch: master
Build date: 2016-01-04 17:34:31-0500

=== Xamarin.Mac ===

Version: 2.5.0.3130 (Business Edition)

=== Build Information ===

Release ID: 510020051
Git revision: 36453d5e06a1ad2cc8d261ad32e29abe0ed57c1f
Build date: 2016-01-12 17:33:10-05
Xamarin addins: ab25321e8918350655a7d46c86cfbaac3222fd3c
Build lane: monodevelop-lion-cycle6-c6sr1

=== Operating System ===

Mac OS X 10.11.2
Darwin 360-MACMINIs-Mac-mini-2.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 10 klaasel 2016-01-15 11:45:44 UTC
I can't reproduce this issue anymore as well. I'll adjust the status.