Bug 315599 (MONO61952) - mcs 1.0 crashes in metadata.c
Summary: mcs 1.0 crashes in metadata.c
Status: RESOLVED MOVED
Alias: MONO61952
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-26 18:24 UTC by Tibor Biro
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
The Visual Studio generated solution I used to reproduce the bug. (9.28 KB, application/octet-stream)
2004-07-26 18:45 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:48:07 UTC


---- Reported by tiborbiro@rogers.com 2004-07-26 11:24:16 MST ----

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 https://bugzilla.novell.com/show_bug.cgi?id=MONO54813:
https://bugzilla.novell.com/show_bug.cgi?id=MONO54813


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\Monohttps://bugzilla.novell.com/show_bug.cgi?id=MONO5. 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.



---- Additional Comments From tiborbiro@rogers.com 2004-07-26 11:45:51 MST ----

Created an attachment (id=166532)
The Visual Studio generated solution I used to reproduce the bug.




---- Additional Comments From tiborbiro@rogers.com 2004-07-26 11:47:32 MST ----

The attachment I just uploaded is a ZIP archive, looks like the file
type is lost when downloading.




---- Additional Comments From tiborbiro@rogers.com 2004-07-26 12:09:12 MST ----

Workaround.

The compiler is happy if all the files are compiled at the same time.
In my case this is OK for development. So if I replace the
monoCompile.cmd file with the following everthing compiles:

mkdir D:\Projects\Personal\MonoBug\mono
del /Q D:\Projects\Personal\MonoBug\mono\*.*

cd D:\Projects\Personal\MonoBug\UserTest
call "C:\Program Files\Mono-1.0\bin\mcs.bat" -r:System -target:exe
-out:D:\Projects\Personal\MonoBug\Mono\UserTest.exe Using.cs
..\Core\Core.cs

cd D:\Projects\Personal\MonoBug




---- Additional Comments From bmaurer@users.sf.net 2004-08-29 15:12:52 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO58244 ***

Imported an attachment (id=166532)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Windows 2000 Server SP4</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"