[Mono-bugs] [Bug 61952][Maj] New - mcs 1.0 crashes in metadata.c

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 26 Jul 2004 11:24:16 -0400 (EDT)


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 tiborbiro@rogers.com.

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

--- shadow/61952	2004-07-26 11:24:16.000000000 -0400
+++ shadow/61952.tmp.3218	2004-07-26 11:24:16.000000000 -0400
@@ -0,0 +1,114 @@
+Bug#: 61952
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: Windows 2000 Server SP4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tiborbiro@rogers.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs 1.0 crashes in metadata.c
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+mcs crashes with the following message:
+*ERROR*: file metadata.c: line 872 (mono_metadata_decode_row): assertion
+failed: (res_size == count) 
+aborting...
+
+Seems to be related to bug 54813:
+http://bugzilla.ximian.com/show_bug.cgi?id=54813
+
+
+Steps to reproduce the problem:
+1. I have some code I can upload. Basically just reference another dll
+compiled previously with mcs. Here are the source files, I can also attach
+them.
+2. Library code, save as Core.cs in folder D:\Projects\Personal\MonoBug\Core:
+using System;
+
+namespace Core
+{
+	/// <summary>
+	/// Summary description for Class1.
+	/// </summary>
+	public class Utils
+	{
+		public static string myText = "Me, Core";
+
+		public string anotherText = "Also me";
+
+		public Utils()
+		{
+			//
+			// TODO: Add constructor logic here
+			//
+		}
+	}
+}
+3.  library user code, save as Using.cs in folder
+D:\Projects\Personal\MonoBug\UserTest:
+using System;
+using Core;
+
+namespace UserTest
+{
+	/// <summary>
+	/// Summary description for Class1.
+	/// </summary>
+	class Using
+	{
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main(string[] args)
+		{
+			Console.WriteLine("Me, Mono");
+			
+			// NOTE: both these lines cause the mono compiler to crash:
+			Console.WriteLine(Utils.myText);
+			//Console.WriteLine(new Utils().anotherText);
+		}
+	}
+}
+
+4. compiling batch file, save as monoCompile.cmd in folder
+D:\Projects\Personal\MonoBug:
+mkdir D:\Projects\Personal\MonoBug\mono
+del /Q D:\Projects\Personal\MonoBug\mono\*.*
+
+cd D:\Projects\Personal\MonoBug\Core
+call "C:\Program Files\Mono-1.0\bin\mcs.bat" -r:System -target:module
+-out:D:\Projects\Personal\MonoBug\Mono\Core.dll  -recurse:*.cs
+
+cd D:\Projects\Personal\MonoBug\UserTest
+call "C:\Program Files\Mono-1.0\bin\mcs.bat"
+-lib:D:\Projects\Personal\MonoBug\Mono -r:System,Core -target:exe
+-out:D:\Projects\Personal\MonoBug\Mono\UserTest.exe -recurse:*.cs
+
+cd D:\Projects\Personal\MonoBug
+5. Run monoCompile.cmd, the compiler will crash while compiling Using.cs
+
+Actual Results:
+mcs crashes.
+
+Expected Results:
+mcs should properly compile the code.
+
+How often does this happen? 
+always
+
+Additional Information:
+It only crashes when the data in the core.dll library is accessed, if I
+comment out the offending line it compiles properly.
+The code compiles well with Visual Studio.