[Mono-bugs] [Bug 462925] New: Gendarme crashes when method cannot be resolved

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 30 05:59:26 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=462925


           Summary: Gendarme crashes when method cannot be resolved
           Product: Mono: Tools
           Version: SVN
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Gendarme
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tamara.roberson at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=262756)
 --> (https://bugzilla.novell.com/attachment.cgi?id=262756)
Quick sanity check patch against SVN r122229

I think this occurs with P/Invoke'd methods that cannot be properly traced
back.

The attached patch against SVN r122229 is enough to allow Gendarme to process
Muine (which was my original intent).  However, much more extensive sanity
checking across the board is necessary to ensure that we don't grind up against
an uncaught NullReferenceException.

I just have these instances fail silently. This is probably best so we can
obtain as much useful information as possible.


Example Solution:

static bool DoesReturnDisposable (MethodReference call)
{
        if (call == null)
                throw new ArgumentNullException ("call");

        if (call.Resolve () == null)
                return false;

        [...]
}



Example Failure:

$ /usr/bin/gendarme /usr/local/lib/muine/muine.exe
Gendarme v2.0.0.0
Copyright (C) 2005-2008 Novell, Inc. and contributors

/usr/local/lib/muine/muine.exe
An uncaught exception occured. Please fill a bug report @
https://bugzilla.novell.com/
Rule:   Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule
Target: System.Void
Muine.HandleView/GetSelectionData::Func(Gtk.TreeModel,Gtk.TreePath,Gtk.TreeIter)
Stack trace: System.NullReferenceException: Object reference not set to an
instance of an object
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.GetInterfaceImplementor
(Mono.Cecil.TypeDefinition type, Gendarme.Framework.Helpers.MethodSignature
signature) [0x00000] 
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.GetBaseImplementor
(Mono.Cecil.TypeDefinition type, Gendarme.Framework.Helpers.MethodSignature
signature) [0x00000] 
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.GetBaseImplementor
(Mono.Cecil.TypeReference type, Gendarme.Framework.Helpers.MethodSignature
signature) [0x00000] 
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.UpdateParameterLeastType
(Mono.Cecil.ParameterReference parameter,
Gendarme.Framework.Helpers.StackEntryUsageResult[] usageResults) [0x00000] 
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.CheckParameter
(Mono.Cecil.MethodDefinition method, Mono.Cecil.Cil.Instruction ins) [0x00000] 
  at
Gendarme.Rules.Maintainability.AvoidUnnecessarySpecializationRule.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]


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


More information about the mono-bugs mailing list