[Mono-dev] Bug in MCS or Mono Runtime 1.2.6

Laurent Debacker debackerl at gmail.com
Thu Dec 27 18:24:58 EST 2007


Hi,

I'm developing a Gtk# application using MonoDevelop Beta 2 and Mono 1.2.6.
However Mono could not execute the compiled assembly. The error provided is
the following one:

Unhandled Exception: System.InvalidProgramException: Invalid IL code in
> Sample.MainWindow:.ctor (): IL_007e: nop
>
>
>   at Sample.MainClass.Main (System.String[] args) [0x0000f] in
> /home/gizmo/Sample/Main.cs:12
>

I have attached both the generated assembly, and the tarball generated by
MonoDevelop.

For your conveniance, I have copy-pasted the IL code as dissasembled by
Reflector of Sample.MainWindow:.ctor () is:


 .method public hidebysig specialname rtspecialname instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
*.ctor <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow/.ctor%28%29>*()
cil managed
{
    .maxstack 12
    .locals init (
        [0] class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated0
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated0>
*generated*,
        [1] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.VBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.VBox>
*box*,
        [2] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.Button
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button>
*button*,
        [3] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Menu
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Menu>
*menu*,
        [4] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.MenuItem
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.MenuItem>
*item*,
        [5] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.MenuItem
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.MenuItem>
*item2*,
        [6] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.Button
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button>
*button2*,
        [7] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.Button
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button>
*button3*,
        [8] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Menu
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Menu>
*menu2*,
        [9] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.MenuItem
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.MenuItem>
*item3*,
        [10] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.ToolPack
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.ToolPack>
*pack*,
        [11] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.ToolPack
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.ToolPack>
*pack2*,
        [12] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.ToolPack
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.ToolPack>
*pack3*,
        [13] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.ComboBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.ComboBox>
*box2*,
        [14] class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated1
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1>
*generated2*,
        [15] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.HBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.HBox>
*box3*,
        [16] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.HBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.HBox>
*box4*,
        [17] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.HBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.HBox>
*box5*,
        [18] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.RibbonGroup
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.RibbonGroup>
*group*,
        [19] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.HBox
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.HBox>
*box6*,
        [20] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Label
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Label>
*label*,
        [21] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Label
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Label>
*label2*,
        [22] class [Ribbons
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.Button
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button>
*button4*,
        [23] class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated4
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4>
*generated3*,
        [24] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.MenuItem
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.MenuItem>
*item4*,
        [25] class [gtk-sharp
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.TextView
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.TextView>
*view*)
    L_0000: nop
    L_0001: ldc.i4 1
    L_0006: pop
    L_0007: nop
    L_0008: newobj instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated0
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated0>::.ctor
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated0/.ctor%28%29>()
    L_000d: stloc.0
    L_000e: ldarg.0
    L_000f: ldc.i4.0
    L_0010: call instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[Ribbons <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.SyntheticWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.SyntheticWindow>::.ctor
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.SyntheticWindow/.ctor%28Gtk.WindowType%29>(valuetype
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.WindowType
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.WindowType>)
    L_0015: ldarg.0
    L_0016: ldc.i4 0x304
    L_001b: call instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Widget
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Widget>::AddEvents
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Widget/AddEvents%28Int32%29>(int32
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32>)
    L_0020: ldarg.0
    L_0021: ldstr "Hello World"
    L_0026: newobj instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[Ribbons <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons>]Ribbons.Button
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button>::.ctor
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Ribbons/Ribbons.Button/.ctor%28String%29>(string
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String>)
    L_002b: call instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Container
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Container>::Add
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Container/Add%28Gtk.Widget%29>(class
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Widget
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Widget>)
    L_0030: ldarg.0
    L_0031: ldc.i4 200
    L_0036: ldc.i4 200
    L_003b: call instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Window
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Window>::Resize
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Window/Resize%28Int32,Int32%29>(int32
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32>,
int32 <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32>)
    L_0040: ldarg.0
    L_0041: call instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
[gtk-sharp <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f>]Gtk.Widget
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Widget>::ShowAll
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://gtk-sharp:2.10.0.0:35e10195dab3c99f/Gtk.Widget/ShowAll%28%29>()
    L_0046: ret
    L_0047: nop
    L_0048: ldc.i4 2
    L_004d: pop
    L_004e: nop
    L_004f: newobj instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated1
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1>::.ctor
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1/.ctor%28%29>()
    L_0054: stloc.s generated2
    L_0056: ldloc.s generated2
    L_0058: ldloc.0
    L_0059: stfld class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated0
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated0>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated1
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1>::<2:scope1>
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1/%3C2:scope1%3E:Sample.MainWindow.%3C%3Ec__CompilerGenerated0>
    L_005e: nop
    L_005f: ldc.i4 3
    L_0064: pop
    L_0065: nop
    L_0066: newobj instance void
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated4
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4>::.ctor
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4/.ctor%28%29>()
    L_006b: stloc.s generated3
    L_006d: ldloc.s generated3
    L_006f: ldloc.s generated2
    L_0071: stfld class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated1
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated1>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated4
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4>::<3:scope2>
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4/%3C3:scope2%3E:Sample.MainWindow.%3C%3Ec__CompilerGenerated1>
    L_0076: ldloc.s generated3
    L_0078: ldloc.0
    L_0079: stfld class Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated0
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated0>
Sample.MainWindow
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow>/<>c__CompilerGenerated4
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4>::<3:scope1>
<http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://Sample:1.0.2917.43047/Sample.MainWindow.%3C%3Ec__CompilerGenerated4/%3C3:scope1%3E:Sample.MainWindow.%3C%3Ec__CompilerGenerated0>
}


Have nice holidays,
Laurent Debacker.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071228/39020fb1/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ribbons.tar.gz
Type: application/x-gzip
Size: 23166 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071228/39020fb1/attachment.gz 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Sample.exe.bz2
Type: application/x-bzip2
Size: 3727 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071228/39020fb1/attachment.bz2 


More information about the Mono-devel-list mailing list