Bug 316034 (MONO66025) - [Wishlist] .NET 2.0 zero-size function bug
Summary: [Wishlist] .NET 2.0 zero-size function bug
Status: RESOLVED FIXED
Alias: MONO66025
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-15 20:58 UTC by Gert Driesen
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

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


---- Reported by gert.driesen@pandora.be 2004-09-15 13:58:09 MST ----

When running .NET 2.0's peverify on an assembly built using mcs (for the 
code below), the following verify error is reported :

===[VERERR]  AREA='Global_type'    [offset 0x00000000]  [opcode nop]  
[MESSAGE:'zero-size function is not valid']

To reproduce this, compile the following code using mcs (I used mcs built 
from cvs head):

using System;
using System.Reflection;

namespace NAnt.Console {
  public class ConsoleStub {
    public static int Main(string[] args) {
      try {
        System.Console.WriteLine("A");
      } catch (Exception e) {
        System.Console.WriteLine("B");
      } finally {
        System.Console.WriteLine("C");
      }

      return 1;
    }

    private static readonly Type type = System.Reflection.MethodBase.
      GetCurrentMethod().DeclaringType;
  }
}

Next, use peverify from MS.NET 2.0 on the generated exe and you'll get 
the result mentioned above.

Apparently the assembly that is built by mcs cannot even be disassembled 
completely using the MS.NET 2.0 ildasm.

I'm not sure if this a regression in MS.NET 2.0, or a bug in Mono which 
is only detected in MS.NET 2.0.



---- Additional Comments From gert.driesen@pandora.be 2004-09-15 14:31:53 MST ----

Apparently the problem is more serious than I thought: when 
compiling that code using gmcs, and running it on .NET 2.0 you get 
the following exception :

Unhandled Exception: System.InvalidProgramException: Common Language 
Runtime detected an invalid program.
   at ConsoleStub.Main(String[] args)



---- Additional Comments From martin@ximian.com 2004-09-19 21:21:47 MST ----

I'm setting priority to Wishlist, but this may never get fixed.

I know about this bug and already spent two weeks trying to debug the
issue, using different test cases.  This is the maximum time I can
spend on this, so I will not look at it any further.  I'm also not
sure whether this is actually a bug in our compiler or a bug in .NET's
runtime/PEVerify.



---- Additional Comments From miguel@ximian.com 2004-09-20 01:46:56 MST ----

This is not a wish-list bug.

Am changing the assigned person of this bug to mono-bugs though.

Miguel.



---- Additional Comments From vargaz@gmail.com 2004-09-28 15:45:48 MST ----

Fixed in CVS & 1.0.


Unknown operating system unknown. Setting to default OS "Other".