Bugzilla – Bug 315599
mcs 1.0 crashes in metadata.c
Last modified: 2007-09-15 21:24:23 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"