Bug 16840 - Unhandled exception when compiling, in Mono.CSharp.Invocation.FlowAnalysis
Summary: Unhandled exception when compiling, in Mono.CSharp.Invocation.FlowAnalysis
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-12-17 08:09 UTC by Øystein Krog
Modified: 2014-01-04 09:34 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Øystein Krog 2013-12-17 08:09:49 UTC
While testing master and the monotouch-7.0.6-branch branch I found an error in the compiler.

$ ./mono --version
Mono Runtime Engine version 3.2.7 (monotouch-7.0.6-branch/552554e Tue Dec 17 13:05:01 CET 2013)
Copyright (C) 2002-2013 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       altstack
        Notification:  kqueue
        Architecture:  x86
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen


Unhandled Exception:
Mono.CSharp.InternalErrorException: /Volumes/SC_Online_oystein/Mobile/SwingCatalyst/Apps/ScApp.iOS/PlatformServices/FileUploadServiceHttpClientIOS.cs(160,43): ScApp.iOS.PlatformServices.FileUploadServiceHttpClientIOS.ActionOfStreamContent.SerializeToStreamAsync(System.IO.Stream, System.Net.TransportContext) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AnonymousExpression.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AsyncInitializerStatement.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: /Volumes/SC_Online_oystein/Mobile/SwingCatalyst/Apps/ScApp.iOS/PlatformServices/FileUploadServiceHttpClientIOS.cs(160,43): ScApp.iOS.PlatformServices.FileUploadServiceHttpClientIOS.ActionOfStreamContent.SerializeToStreamAsync(System.IO.Stream, System.Net.TransportContext) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AnonymousExpression.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AsyncInitializerStatement.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 


I commented out the above class and got another one:

Unhandled Exception:
Mono.CSharp.InternalErrorException: /Volumes/SC_Online_oystein/Mobile/SwingCatalyst/Apps/ScApp.iOS/PlatformServices/FileUploadServiceHttpWebRequestIOS.cs(129,28): ScApp.iOS.PlatformServices.FileUploadServiceHttpWebRequestIOS.UploadFilePostAsync(System.Uri, InitialForce.FileSystem.IFile, System.Collections.Generic.Dictionary<string,string>, string, System.Collections.Generic.Dictionary<string,string>, System.IProgress<InitialForce.ScOnline.Client.IDataSendProgress>, System.Threading.CancellationToken) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Foreach.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Using.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Using.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AnonymousExpression.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AsyncInitializerStatement.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: /Volumes/SC_Online_oystein/Mobile/SwingCatalyst/Apps/ScApp.iOS/PlatformServices/FileUploadServiceHttpWebRequestIOS.cs(129,28): ScApp.iOS.PlatformServices.FileUploadServiceHttpWebRequestIOS.UploadFilePostAsync(System.Uri, InitialForce.FileSystem.IFile, System.Collections.Generic.Dictionary<string,string>, string, System.Collections.Generic.Dictionary<string,string>, System.IProgress<InitialForce.ScOnline.Client.IDataSendProgress>, System.Threading.CancellationToken) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Foreach.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Using.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Using.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AnonymousExpression.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AsyncInitializerStatement.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
Comment 1 Øystein Krog 2013-12-17 08:34:51 UTC
Quick and dirty repro for the first exception:

 public sealed class FileUploadServiceHttpClientIOS 
    {
        public FileUploadServiceHttpClientIOS()
        {
        }

        public async Task UploadFileAsync(Uri uploadUrl,
            object srcFile,
            Dictionary<string, string> customHeaders,
            string httpMethod,
            IProgress<IDataSendProgress> progress,
            CancellationToken cancellationToken = default (CancellationToken))
        {
            var content = new ActionOfStreamContent(stream => null, 0);
        }

        private class ActionOfStreamContent : HttpContent
        {
            private readonly Func<Stream, Task> _actionOfStream;
            private readonly long _length;

            public ActionOfStreamContent(Func<Stream, Task> actionOfStream, long length)
            {
                if (actionOfStream == null)
                {
                    throw new ArgumentNullException("actionOfStream");
                }

                _actionOfStream = actionOfStream;
                _length = length;
            }

            protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
            {
                await _actionOfStream(stream);
            }

            protected override bool TryComputeLength(out long length)
            {
                length = _length;
                return true;
            }
        }
    }
Comment 2 Øystein Krog 2013-12-17 08:40:16 UTC
I found a workaround.

Replace

            protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
            {
                await _actionOfStream(stream);
            }

with

            protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
            {
                return _actionOfStream(stream);
            }
Comment 3 João Vitor 2013-12-20 14:09:05 UTC
I have the same issue while compiling my code:

        async Task FireWeapon(AutoRegenContainer container, Func<CancellationToken, Task<bool>> fire, CancellationToken cancellation)
        {
            if (container.IsEmpty)
                return;

            container.Regenerate = false;

            while (!cancellation.IsCancellationRequested)
                if (!await fire(cancellation))
                    break;

            container.Regenerate = true;
        }

The code is available at
git clone --recursive https://github.com/DiogoMuller/monogame-aux-lib

It fails under Linux, with "Debug-Linux" configuration.


Mono Runtime Engine version 3.2.7 (master/69d8290 Qui Dez 19 13:04:02 BRST 2013)
Copyright (C) 2002-2013 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


Build Output:

	Target CoreCompile:
		Tool /opt/mono/bin/dmcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/x86/Debug-Linux/DefendUranus.exe Activities/GameActivity.cs Activities/HowToPlay.cs Activities/StartScreen.cs Components/PlayerGUI.cs Entities/Asteroid.cs Entities/AutoRegenContainer.cs Entities/Container.cs Entities/Explosion.cs Entities/GamePlayEntity.cs Entities/Laser.cs Entities/ShipDescription.cs Entities/SpecialAttack.cs Entities/PhysicsEntity.cs Entities/SpecialAttacks/MeteoroidAlienform.cs Entities/SpecialAttacks/FleeingFake.cs Entities/SpecialAttacks/PursuiterMissile.cs Entities/SpecialAttacks/WandererProbe.cs Entities/SteeringEntity.cs Events/EntityCollisionEvent.cs Events/EntityEvent.cs Events/GamePlayEvent.cs Helpers/AsyncOperation.cs Helpers/CommonExtensions.cs Helpers/Easing.cs Helpers/GameInput.cs Helpers/MonoGameExtensions.cs Helpers/PlayerInput.cs Helpers/WorldHelper.cs Entities/Ship.cs MainGame.cs Particles/Particle.cs Particles/ParticleEmiter.cs Particles/ParticleState.cs Program.cs Properties/AssemblyInfo.cs Activities/GamePlaySetup.cs Activities/GamePlay.cs Activities/ShowResults.cs SteeringBehaviors/Flee.cs SteeringBehaviors/Pursuit.cs SteeringBehaviors/Seek.cs SteeringBehaviors/SteeringBehavior.cs SteeringBehaviors/Wander.cs Entities/Behaviors/ShipInputBehavior.cs obj/x86/Debug-Linux/.NETFramework,Version=v4.0.AssemblyAttribute.cs /target:winexe /define:"DEBUG;TRACE;LINUX" /platform:x86 /reference:../../submodule/monogame-aux-lib/references/Linux/MonoGame/3.2/Lidgren.Network.dll /reference:../../submodule/monogame-aux-lib/references/Linux/MonoGame/3.2/MonoGame.Framework.dll /reference:../../submodule/monogame-aux-lib/references/Linux/MonoGame/3.2/OpenTK.dll /reference:../../submodule/monogame-aux-lib/references/Linux/MonoGame/3.2/Tao.Sdl.dll /reference:/opt/mono/lib/mono/4.0/System.Xml.Linq.dll /reference:/opt/mono/lib/mono/4.0/System.dll /reference:/opt/mono/lib/mono/4.0/System.Xml.dll /reference:../references/XNATweener.dll /reference:/opt/mono/lib/mono/4.0/System.Core.dll /reference:/home/joao/Projects/jvlppm/defend-uranus/submodule/monogame-aux-lib/src/MonoGameLib.Activities/bin/Debug//MonoGameLib.Activities.dll /reference:/home/joao/Projects/jvlppm/defend-uranus/submodule/monogame-aux-lib/src/MonoGameLib.Core/bin/Debug//MonoGameLib.Core.dll /reference:/home/joao/Projects/jvlppm/defend-uranus/submodule/monogame-aux-lib/src/MonoGameLib.GUI/bin/Debug//MonoGameLib.GUI.dll /reference:/home/joao/Projects/jvlppm/defend-uranus/submodule/monogame-aux-lib/src/MonoGameLib.Tiled/bin/Debug//MonoGameLib.Tiled.dll /warn:4
		
		Unhandled Exception:
		Mono.CSharp.InternalErrorException: Entities/Ship.cs(268,20): DefendUranus.Entities.Ship.FireWeapon(DefendUranus.Entities.AutoRegenContainer, System.Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>>, System.Threading.CancellationToken) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
		  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Unary.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.If.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.While.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.AnonymousExpression.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.StatementExpression.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.AsyncInitializerStatement.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.ParametersBlock.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
		  --- End of inner exception stack trace ---
		  at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.BlockContext bc, IMethodData md) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.MethodData.Emit (Mono.CSharp.TypeDefinition parent) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
		  --- End of inner exception stack trace ---
		  at Mono.CSharp.Method.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.TypeDefinition.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.ClassOrStruct.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Class.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.TypeDefinition.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.NamespaceContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.TypeContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.ModuleContainer.EmitContainer () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.AssemblyDefinitionStatic.Emit () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
		[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: Entities/Ship.cs(268,20): DefendUranus.Entities.Ship.FireWeapon(DefendUranus.Entities.AutoRegenContainer, System.Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>>, System.Threading.CancellationToken) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NullReferenceException: Object reference not set to an instance of an object
		  at Mono.CSharp.Invocation.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Await.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Unary.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.If.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.While.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Statement.FlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc, Int32 startIndex) [0x00000] in <filename unknown>:0 
		  at Mono.CSharp.Block.DoFlowAnalysis (Mono.CSharp.FlowAnalysisContext fc) [0x00000] in <filename unknown>:0
Comment 4 Marek Safar 2014-01-04 09:34:28 UTC
Fixed in master