Bug 4147 - PEVerify complains on valid assembly
Summary: PEVerify complains on valid assembly
Alias: None
Product: Runtime
Classification: Mono
Component: Verifier ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-03-29 07:34 UTC by NN
Modified: 2012-04-24 04:41 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Dll and IL with problem (2.25 MB, application/octet-stream)
2012-04-16 04:20 UTC, NN
Nemerle.Compiler.dll compiled using MS .Net (1.64 MB, application/octet-stream)
2012-04-24 04:40 UTC, NN

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description NN 2012-03-29 07:34:34 UTC
According to http://jilc.sourceforge.net/ecma_p2_cil.shtml#_Toc524940439 
Partition II, 3.5

It is allowed to write quotes in names.

Therefore custom attribute constructor can be writen in both forms:

 .custom instance void [A]A.B.XAttribute::.ctor(string) = ...
 .custom instance void [A]A.B.XAttribute::'.ctor'(string) = ...

PEVerify from .Net doesn't complain but PEVerify from Mono complains about second definition with quotes.

Mono PEVerify must accept quotes.
Comment 1 NN 2012-04-16 04:20:31 UTC
Created attachment 1679 [details]
Dll and IL with problem

In this assembly Mono PEVerify complains:
Missing method .ctor in assembly Nemerle.Compiler.dll, type Nemerle.Internal.ExtensionAttribute

But .Net PEVerify doesn't complain on it and complains on another issue:
[MD]: Error (Structural): Table=0x0000000a, Col=0x00000000, Row=0x00000009, has
coded token type out of range....
Comment 2 Rodrigo Kumpera 2012-04-22 20:46:32 UTC
Mono's verifier requires all used types to available.

The type Nemerle.Internal.ExtensionAttribute is not available and this is why verification fails.
Comment 3 NN 2012-04-24 04:40:13 UTC
Created attachment 1734 [details]
Nemerle.Compiler.dll compiled using MS .Net

PEVerify from .Net doesn't complain but PEVerify from Mono does.

Missing method .ctor in assembly Nemerle.Compiler.dll, type Nemerle.Internal.ExtensionAttribute
Error: Invalid CustomAttribute content row 16 Value field 0x0000e48a
Error: CustomAttribute: Invalid constructor
Error count: 2
Comment 4 NN 2012-04-24 04:41:23 UTC
I attached another file where PEVerify from Mono gives different result.
Are you sure Mono's verification is correct here ?
If so, then MS PEVerify has bug :)