[Mono-bugs] [Bug 82498][Wis] New - gmcs generate invalid IL code to callvirt

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 20 12:37:59 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by chavezmarioalberto at msn.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82498

--- shadow/82498	2007-08-20 12:37:59.000000000 -0400
+++ shadow/82498.tmp.31031	2007-08-20 12:37:59.000000000 -0400
@@ -0,0 +1,143 @@
+Bug#: 82498
+Product: Mono: Compilers
+Version: 1.2
+OS: Mac OS X 10.3
+OS Details: osx 10.4.10
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: IL assembler
+AssignedTo: jankit at novell.com                            
+ReportedBy: chavezmarioalberto at msn.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs generate invalid IL code to callvirt
+
+Description of Problem:
+I'm trying this program (http://www.dotnetblogengine.net/) on mono 1.2.5 p3
+on OSX 10.4.10, the assemblies from this site does not work on mono because
+they are using \\ as path separator, after changing the code to use
+Path.DirectorySeparatorChar (on BlogEngine.Core.XmlBlogProvider) I did
+compile this program with gmcs, the assembly fails on OSX and Windows (.net
+sp2) with:
+
+Mono -
+System.InvalidProgramException: Invalid IL code in
+BlogEngine.Core.BusinessBase`2:Load (System.Guid): IL_000f: callvirt 
+0x0a0000b2
+
+
+  at <0x00000> <unknown method>
+  at BlogEngine.Core.Providers.XmlBlogProvider.FillPosts () [0x00000] 
+  at BlogEngine.Core.Providers.BlogService.FillPosts () [0x00000] 
+  at BlogEngine.Core.Post.get_Posts () [0x00000] 
+  at Controls.RecentPosts.BuildPostList () [0x00000] 
+  at Controls.RecentPosts..cctor () [0x00000] 
+
+.NET sp2 -
+[VerificationException: Operation could destabilize the runtime.]
+   BlogEngine.Core.BusinessBase`2.Load(KEY id) +0
+   BlogEngine.Core.Providers.XmlBlogProvider.FillPosts() +241
+   BlogEngine.Core.Post.get_Posts() +67
+   _default.Page_Load(Object sender, EventArgs e) +528
+   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
+Object t, EventArgs e) +15
+   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
+EventArgs e) +34
+   System.Web.UI.Control.OnLoad(EventArgs e) +99
+   BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad(EventArgs e) +11
+   System.Web.UI.Control.LoadRecursive() +47
+   System.Web.UI.Page.ProcessRequestMain(Boolean
+includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
+
+
+The IL for Load method on BlogEngine.Core.Business is:
+.method public hidebysig static !TYPE Load(!KEY id) cil managed
+{
+    .maxstack 9
+    .locals init (
+        [0] !TYPE local)
+    L_0000: call !!0 [mscorlib]System.Activator::CreateInstance<!TYPE>()
+    L_0005: stloc.0 
+    L_0006: ldloca.s local
+    L_0008: ldarg.0 
+    L_0009: constrained !TYPE
+    L_000f: callvirt instance !0 BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::DataSelect(!1)
+    L_0014: stloc.0 
+    L_0015: ldloca.s local
+    L_0017: ldarg.0 
+    L_0018: constrained !TYPE
+    L_001e: callvirt instance void BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::set_Id(!1)
+    L_0023: ldloc.0 
+    L_0024: box !TYPE
+    L_0029: brfalse L_003d
+    L_002e: ldloca.s local
+    L_0030: constrained !TYPE
+    L_0036: callvirt instance void BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::MarkOld()
+    L_003b: ldloc.0 
+    L_003c: ret 
+    L_003d: ldnull 
+    L_003e: ret 
+}
+
+Compiling the code on VSNET it works on Windows (.NET sp2) but still fail
+on mono with:
+System.InvalidProgramException: Invalid IL code in
+BlogEngine.Core.BusinessBase`2:Load (System.Guid): IL_000f: callvirt 
+0x0a00010d
+
+
+  at <0x00000> <unknown method>
+  at BlogEngine.Core.Providers.XmlBlogProvider.FillPosts () [0x00000] 
+  at BlogEngine.Core.Providers.BlogService.FillPosts () [0x00000] 
+  at BlogEngine.Core.Post.get_Posts () [0x00000] 
+  at Controls.RecentPosts.BuildPostList () [0x00000] 
+  at Controls.RecentPosts..cctor () [0x00000] 
+
+The IL for method load is:
+.method public hidebysig static !TYPE Load(!KEY id) cil managed
+{
+    .maxstack 2
+    .locals init (
+        [0] !TYPE instance,
+        [1] !TYPE CS$0$0000)
+    L_0000: call !!0 [mscorlib]System.Activator::CreateInstance<!TYPE>()
+    L_0005: stloc.0 
+    L_0006: ldloca.s instance
+    L_0008: ldarg.0 
+    L_0009: constrained !TYPE
+    L_000f: callvirt instance !0 BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::DataSelect(!1)
+    L_0014: stloc.0 
+    L_0015: ldloca.s instance
+    L_0017: ldarg.0 
+    L_0018: constrained !TYPE
+    L_001e: callvirt instance void BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::set_Id(!1)
+    L_0023: ldloc.0 
+    L_0024: box !TYPE
+    L_0029: ldnull 
+    L_002a: call bool BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::op_Inequality(class BlogEngine.Core.BusinessBase`2<!0, !1>, class
+BlogEngine.Core.BusinessBase`2<!0, !1>)
+    L_002f: brfalse.s L_0040
+    L_0031: ldloca.s instance
+    L_0033: constrained !TYPE
+    L_0039: callvirt instance void BlogEngine.Core.BusinessBase`2<!TYPE,
+!KEY>::MarkOld()
+    L_003e: ldloc.0 
+    L_003f: ret 
+    L_0040: ldloca.s CS$0$0000
+    L_0042: initobj !TYPE
+    L_0048: ldloc.1 
+    L_0049: ret 
+}
+
+Here I have the IL for the original DLL downloaded from BlogEngine site:
+http://pastebin.com/m6f17f9f6


More information about the mono-bugs mailing list