[Mono-bugs] [Bug 498545] New: Error in decoding custom attributes on synthetic methods

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Apr 27 13:54:58 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=498545


           Summary: Error in decoding custom attributes on synthetic
                    methods
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: spouliot at novell.com
         QAContact: mono-bugs at lists.ximian.com
                CC: rkumpera at novell.com
          Found By: ---


Short story:

Mono returns one custom attribute [SecurityCritical] for method
"System.Windows.FrameworkElement[,]::.ctor"
since this type is not a "real" method (or type) it should not have any
attribute (at least not a [SecurityCritical] one ;-).

This leads "mono_security_core_clr_level_from_cinfo" (security-core-clr.c) to
return MONO_SECURITY_CORE_CLR_CRITICAL and throw a MethodAccessException on
valid code (e.g. http://robozzle.com/)


Long story (IRC log):

<spouliot> kumpera: hey, any clue how a [SecurityCritical] attributes can
exists on a runtime generated type, like FrameworkElement[,] ?
<kumpera> spouliot: AFAIK, they can't
<kumpera> but
<kumpera> FrameworkElement[,] extends System.Array
<kumpera> and have some synthetic methods like .ctor, Set() and Get()
<kumpera> and implement a bunch of interfaces
<kumpera> err, multidym arrays don't have synthetic interfaces, only unidym
<spouliot> I get this on the .ctor
<kumpera> on mono or on SL?
<spouliot> but there's no [SC] on System.Array
<spouliot> mono
<kumpera> .ctor is synthetic
<kumpera> IOW, there is no C# source for it
<kumpera> neither source of IL
<spouliot> yep, but are we adding any [SC] anywher ?
<spouliot> because it's added or copied/cloned
<kumpera> no idea, really
<kumpera> how do you know you're getting [SC]?
<kumpera> err, from where?
<spouliot> gdb
<kumpera> and how do you check it?
<spouliot> p *cinfo->attrs->ctor->klass
<kumpera> and this cinfo comes from the method of an array
<spouliot> from System.Windows.FrameworkElement[,]::.ctor
<kumpera> spouliot, does this method comes from a dynamic image?
<kumpera> hmm, I guess not
<kumpera> spouliot: what *cinfo->num_attrs print?
<kumpera> spouliot: lol, it's a bug on the reflection code
<kumpera> spouliot: mono screws up when decoding cattr of synthetic array
methods
<spouliot> kumpera: back - glad it's a bug, even if it's weird that it turned
out to be a [SC] :)
<kumpera> I believe it will decode to some random token
<spouliot> heh, really weird to hit that particular spot

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list