[Mono-dev] Re: Abort with Non-Typical Exception Handler Layout on Mono 1.1.13.6

Zoltan Varga vargaz at gmail.com
Mon Jun 12 10:17:42 EDT 2006


Hi,

 This is now fixed in SVN.

       Zoltan

On 6/12/06, Almann T. Goo <almann.goo at gmail.com> wrote:
> On 6/12/06, Robert Jordan <robertj at gmx.net> wrote:
> > Maybe the code doesn't pass verification. Test the assembly with pedump
> > or MS.NET's PEVerify.
> >
>
> I ran this with PEVerify and got a couple of errors (I had changed the name
> of the assembly so I wouldn't get confused with my other example cases):
>
> Microsoft (R) .NET Framework PE Verifier  Version 1.1.4322.573
>  Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
>
>  [IL]: Error: [d:\tmp\cs\middle.exe : Middle::Main] [exception #0x00000000]
> Lexic al nesting.
> [IL]: Error: [d:\tmp\cs\middle.exe : Middle::Main] [offset 0x00000000]
> fallthru the end of an exception block
>  2 Errors Verifying middle.exe
>
> On closer inspection of ECMA-335, the reason for the first error was that my
> previous code violates 12.4.2.7 of Partition I.  Specifically, the paragraph
> regarding lexical nesting of protected blocks.  The reason for the second
> error is a control fall through violation by the nop (that is unreachable in
> my example), this violates 12.4.2.8.1 of Partition I which states that "exit
> from a protected block cannot be accomplished via fall through."  Even
> though the nop is unreachable, this is incorrect IL--easy to fix with a
> leave that is still unreachable.
>
> Based on that, I have re-formulated my examples and managed to get PEVerify
> passable examples that still abort in Mono 1.1.13.6.
>
> D:\tmp\cs>peverify sample.exe
>
> Microsoft (R) .NET Framework PE Verifier  Version 1.1.4322.573
>  Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
>
> All Classes and Methods in sample.exe Verified
>
> D:\tmp\cs>peverify sample2.exe
>
> Microsoft (R) .NET Framework PE Verifier  Version 1.1.4322.573
>  Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
>
> All Classes and Methods in sample2.exe Verified
>
> D:\tmp\cs>sample.exe
>  Start
> Finally1
>  Finally2
>
> D:\tmp\cs> sample2.exe
> Start
>  Finally1
>
> In Mono the following happens (same as with the original example):
>
> $ mono sample2.exe
>
> ** ERROR **: file mini.c: line 9517 (mini_method_compile): assertion failed:
> (tblock->native_offset)
> aborting...
>  Aborted
>
> $ mono sample.exe
>
>  ** ERROR **: file mini.c: line 9517 (mini_method_compile): assertion
> failed: (tblock->native_offset)
>  aborting...
> Aborted
>
> I have attached two CIL assembly source files that compile to the examples
> used above.  They pass PEVerify and abort in Mono--I believe these two
> examples are compliant to the ECMA-335 specification.
>
> Best regards,
> Almann
>
> --
> Almann T. Goo
> almann.goo at gmail.com
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
>



More information about the Mono-devel-list mailing list