Bug 6023 - Compiler crashed (Monodevelop 3.0.3.2, Mono 2.10.8)
Summary: Compiler crashed (Monodevelop 3.0.3.2, Mono 2.10.8)
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: 2012-07-06 19:43 UTC by pinggi
Modified: 2012-07-07 04:45 UTC (History)
1 user (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 pinggi 2012-07-06 19:43:59 UTC
Compiler crashed on the method:

[DllImport(libcairo)]
private static extern IntPtr cairo_image_surface_create_from_png_stream(cairo_read_func_t read_func, IntPtr closure);



Build output:

Internal compiler error at CairoHelper.cs(17,38):: exception caught while emitting MethodBuilder [CairoHelper::cairo_image_surface_create_from_png_stream]


Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.



  at Mono.CSharp.Attribute.Emit (System.Collections.Generic.Dictionary`2 allEmitted) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Attributes.Emit () [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 

[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Cannot cast from source type to destination type.



  at Mono.CSharp.Attribute.Emit (System.Collections.Generic.Dictionary`2 allEmitted) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Attributes.Emit () [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
Comment 1 pinggi 2012-07-06 19:52:43 UTC
It seems that the following line causes it:

private static string libcairo = "libcairo-2.dll";

works with: 

private const string libcairo = "libcairo-2.dll";
Comment 2 Marek Safar 2012-07-07 04:45:49 UTC
Already fixed in Mono 2.11