Bug 31092 - compiler crashed with code: 1
Summary: compiler crashed with code: 1
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2015-06-14 10:03 UTC by Benoit Jadinon
Modified: 2015-06-17 11:37 UTC (History)
1 user (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:

Description Benoit Jadinon 2015-06-14 10:03:44 UTC
After I changed some Android code, I received the dreaded "compiler crashed with code: 1" compiler error.
I was able to narrow it down to the faulty line, it may help you.
granted, it's not the cleanest line of code I have written, it's actually pretty ugly/stupid and should totally be refactored, but still, the compiler should not display such an unfriendly error message, it was hard to track down.

The lines :
var evt = new Event();
string str = (evt.Name != null ? " " + evt?.Name : "").Trim();

The problem :
it's due to the presence of both evt?.Name AND .Trim(), 
remove the ? or .Trim() and compilation will work just fine.

My info:

Xamarin Studio
Version 5.9.3 (build 1)
Installation UUID: 61e0abeb-0865-4725-a8ee-c543f38e3ccf
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

Apple Developer Tools
Xcode 6.3.2 (7718)
Build 6D2105

Version: (Business Edition)
Hash: e6ebd18
Branch: master
Build date: 2015-05-21 21:55:09-0400

Version: (Business Edition)
Android SDK: /Users/bja/SDKs/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.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

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

Not Installed

Build Information
Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

Operating System
Mac OS X 10.10.3
Darwin emamac0098 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Marek Safar 2015-06-17 11:37:56 UTC
Fixed in master/4.2 branch