Bug 37801 - C# 6: Compiler crashed with code: 1 - FATAL UNHANDLED EXCEPTION
Summary: C# 6: Compiler crashed with code: 1 - FATAL UNHANDLED EXCEPTION
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-01-19 17:15 UTC by Alexander Mezhov
Modified: 2016-01-28 12:13 UTC (History)
1 user (show)

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


Attachments
xbuild output (12.24 KB, text/plain)
2016-01-19 17:15 UTC, Alexander Mezhov
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 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:
Status:
RESOLVED FIXED

Description Alexander Mezhov 2016-01-19 17:15:54 UTC
Created attachment 14630 [details]
xbuild output

Hello!

I have simple code wich does not compile. I think the main problem is operator "?.". I try to compile the next code block but get error: '/usr/lib/mono/4.5/Microsoft.CSharp.targets: Error: Compiler crashed with code: 1'. I attached the compile output to this issue.

CODE:

> using System;
> using System.Collections.Generic;
> using System.Linq;
> 
> namespace BadDynamic
> {
>     class MainClass
>     {
>         public static void Main(string[] args)
>         {
>             Console.WriteLine("Hello World!");
>         }
> 
>         public dynamic DoSomething(IEnumerable<dynamic> collection)
>         {
>             return collection?.FirstOrDefault().SomePropety;
>         }
>     }
> }

MONO:

> $ mono --version
> Mono JIT compiler version 4.2.1 (Stable 4.2.1.102/6dd2d0d Thu Nov 12 09:52:44 UTC 2015)
> Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
> 	TLS:           __thread
> 	SIGSEGV:       altstack
> 	Notifications: epoll
> 	Architecture:  amd64
> 	Disabled:      none
> 	Misc:          softdebug 
> 	LLVM:          supported, not enabled.
> 	GC:            sgen

XBUILD:

> $ xbuild /version
> XBuild Engine Version 12.0
> Mono, Version 4.2.1.0
> Copyright (C) 2005-2013 Various Mono authors

OUTPUT:

> ...
> [ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: Program.cs(14,24):
> BadDynamic.MainClass.DoSomething(System.Collections.Generic.IEnumerable<dynamic>) ---> 
> Mono.CSharp.InternalErrorException: Program.cs(15,9): ---> 
> System.NullReferenceException: Object reference not set to an instance of an object
> at Mono.CSharp.InstanceEmitter.Emit (Mono.CSharp.EmitContext ec, Boolean conditionalAccess) <0x7fe5dee33ff0 + 0x003bf> in <filename unknown>:0
Comment 1 Marek Safar 2016-01-28 12:13:15 UTC
Fixed in master and Mono 4.3.2