[BUG] MethodCallWithSubsetLinkDemandRule crashes

2 views
Skip to first unread message

Exception

unread,
Apr 12, 2008, 6:02:11 PM4/12/08
to Gendarme
Hey there!

When MethodCallWithSubsetLinkDemandRule is run against
Test.Rules.Security.MethodCallWithSubsetLinkDemandTest/
SubsetInheritClass::VirtualMethod(), it crashes with a
NotImplementedException:

An uncatched exception occured. Please fill a bug report @
https://bugzilla.novell.com/
Rule: Gendarme.Rules.Security.MethodCallWithSubsetLinkDemandRule
Target: System.Void
Test.Rules.Security.MethodCallWithSubsetLinkDemandTest/
SubsetInheritClass::VirtualMethod()
Stack trace: System.NotImplementedException: The requested feature is
not implemented.
at Mono.Cecil.SecurityDeclaration.Resolve () [0x00000]
at
Gendarme.Rules.Security.MethodCallWithSubsetLinkDemandRule.GetLinkDemand
(Mono.Cecil.MethodDefinition method) [0x00000]
at Gendarme.Rules.Security.MethodCallWithSubsetLinkDemandRule.Check
(Mono.Cecil.MethodDefinition caller, Mono.Cecil.MethodDefinition
callee) [0x00000]
at
Gendarme.Rules.Security.MethodCallWithSubsetLinkDemandRule.CheckMethod
(Mono.Cecil.MethodDefinition method) [0x00000]
at Gendarme.Framework.Runner.OnMethod
(Gendarme.Framework.RunnerEventArgs e) [0x00000]
at Gendarme.Framework.Runner.Run () [0x00000]
at Gendarme.ConsoleRunner.Run () [0x00000]
at Gendarme.ConsoleRunner.Execute (System.String[] args) [0x00000]


I believe it happens because the rule code calls[1] the
SecurityDeclaration::Resolve() method, and it seems[2] to be left with
no implementation.

^ [1]: <MethodCallWithSubsetLinkDemandRule.cs>
(Gendarme.Rules.Security)

48: case Mono.Cecil.SecurityAction.NonCasLinkDemand:
49: declsec.Resolve ();
50: return declsec.PermissionSet;
51: }

^ [2]: <SecurityDeclaration.cs> (Cecil)

103: public bool Resolve ()
104: {
105: throw new NotImplementedException ();
106: }

I don't understand the security matters (maybe there's a reason why
there's no implementation), yet Gendarme rules should not throw
exceptions so this is certainly a bug (either in Gendarme or Cecil).

Sebastien Pouliot

unread,
Apr 12, 2008, 6:11:16 PM4/12/08
to Gendarme
Hey Dan,

You need to update /mcs (or maybe MD project file still use /cecil)
because Resolve was implemented only recently (this week) in Cecil.

Sebastien

On Apr 12, 6:02 pm, Exception <dan.abra...@gmail.com> wrote:
> Hey there!
>
> When MethodCallWithSubsetLinkDemandRule is run against
> Test.Rules.Security.MethodCallWithSubsetLinkDemandTest/
> SubsetInheritClass::VirtualMethod(), it crashes with a
> NotImplementedException:
>
> An uncatched exception occured. Please fill a bug report @https://bugzilla.novell.com/
Reply all
Reply to author
Forward
0 new messages