Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Getting an exception in gendarme while analyzing a c# application using sonar
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
vishnu  
View profile  
 More options Jan 1 2012, 10:50 pm
From: vishnu <vishnu.vis2...@gmail.com>
Date: Sun, 1 Jan 2012 19:50:51 -0800 (PST)
Local: Sun, Jan 1 2012 10:50 pm
Subject: Getting an exception in gendarme while analyzing a c# application using sonar
Today when I analyzed a C# application (source code size above 20
mb).I am getting an exception  as shown below

[INFO] [11:05:44.212] Sensor
com.hello2morrow.sonarplugin.SonargraphSensor@11ae15a done: 370 ms
[INFO] [11:05:44.212] Sensor CpdSensor...
[INFO] [11:05:44.212] PmdEngine is used
[INFO] [11:05:45.952] Sensor CpdSensor done: 1740 ms
[INFO] [11:05:45.952] Sensor
org.sonar.plugins.csharp.gendarme.GendarmeSensor@10e0623...
[INFO] [11:05:45.962] Gendarme executable not found: 'C:\Program Files
\gendarme-2.10-bin\gendarme.exe'. The embedded version (2.10) will be
used instead.
[INFO] [11:05:47.246]
[INFO] [11:05:47.246] An uncaught exception occured. Please fill a bug
report at https://bugzilla.novell.com/
[INFO] [11:05:47.246] Stack trace: System.ArgumentOutOfRangeException:
Specified argument was out of the range of valid values.
[INFO] [11:05:47.246]    at
Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
[INFO] [11:05:47.246]    at
Gendarme.Framework.Symbols.ExtractFirst(MethodDefinition method)
[INFO] [11:05:47.246]    at
Gendarme.Framework.Symbols.ExtractFirst(TypeDefinition type)
[INFO] [11:05:47.246]    at
Gendarme.Framework.Symbols.GetSource(Defect defect)
[INFO] [11:05:47.246]    at Gendarme.Framework.Defect.get_Source()
[INFO] [11:05:47.246]    at
Gendarme.XmlResultWriter.CreateElement(Defect defect)
[INFO] [11:05:47.246]    at Gendarme.XmlResultWriter.CreateDefects()
[INFO] [11:05:47.246]    at Gendarme.XmlResultWriter.Write()
[INFO] [11:05:47.246]    at Gendarme.ResultWriter.Report()
[INFO] [11:05:47.246]    at Gendarme.ConsoleRunner.Report()
[INFO] [11:05:47.246]    at Gendarme.ConsoleRunner.Execute(String[]
args)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Can not execute Sonar

Embedded error: Gendarme execution failed.
Gendarme analysis failed: execution was interrupted by a non-handled
exception. This is likely a bug inside Gendarme and should be reported
on Novell's bugzilla (http://bugzilla.novell.com) or on the mailing-
list.
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 59 seconds
[INFO] Finished at: Fri Dec 30 11:05:47 IST 2011
[INFO] Final Memory: 21M/62M
[INFO]
------------------------------------------------------------------------

I am using sonar 2.12

I tried with maven and as well as with simple java runner

When I searched for similar exception in  web I could n’t able find
valid reason for this issue.

Please help me out in resolving this issue


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alik Kurdyukov  
View profile  
 More options Feb 13 2012, 7:27 am
From: Alik Kurdyukov <akurdyu...@gmail.com>
Date: Mon, 13 Feb 2012 04:27:01 -0800 (PST)
Local: Mon, Feb 13 2012 7:27 am
Subject: Re: Getting an exception in gendarme while analyzing a c# application using sonar
Hi,

I have exactly the same exception. And the problem has something to
relation with COM library connection. I just turned off Gendarme from
sonar build. I'll try to investigate the problem if I build Gandarme.

On Jan 2, 7:50 am, vishnu <vishnu.vis2...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jb Evain  
View profile  
 More options Feb 13 2012, 8:09 am
From: Jb Evain <jbev...@gmail.com>
Date: Mon, 13 Feb 2012 14:09:26 +0100
Local: Mon, Feb 13 2012 8:09 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar
Hey,

On Mon, Jan 2, 2012 at 4:50 AM, vishnu <vishnu.vis2...@gmail.com> wrote:
> [INFO] [11:05:47.246] An uncaught exception occured. Please fill a bug
> report at https://bugzilla.novell.com/
> [INFO] [11:05:47.246] Stack trace: System.ArgumentOutOfRangeException:
> Specified argument was out of the range of valid values.
> [INFO] [11:05:47.246]    at
> Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
> [INFO] [11:05:47.246]    at
> Gendarme.Framework.Symbols.ExtractFirst(MethodDefinition method)
> [INFO] [11:05:47.246]    at
> Gendarme.Framework.Symbols.ExtractFirst(TypeDefinition type)
> [INFO] [11:05:47.246]    at
> Gendarme.Framework.Symbols.GetSource(Defect defect)
> [INFO] [11:05:47.246]    at Gendarme.Framework.Defect.get_Source()
> [INFO] [11:05:47.246]    at

This stack trace seems to indicate that you have a method with the
HasBody flag, but which doesn't have any Instruction.

Could you verify that this assumption is true?

I'll fix gendarme to not crash on this anyway.

Jb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alik Kurdyukov  
View profile  
 More options Feb 13 2012, 8:35 am
From: Alik Kurdyukov <akurdyu...@gmail.com>
Date: Mon, 13 Feb 2012 17:35:24 +0400
Local: Mon, Feb 13 2012 8:35 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

Hey,

I'm not sure I understand what's HasBody flag for methods. How can I check the assumption?

The assembly that crashed Gendarme includes 'native' code with ".custom" marks on methods. ILDASM show no disassemblies for them. For ex:
.class interface public abstract auto ansi import P2ClientGateMTA.IP2BLMessage
{
  .custom instance void [mscorlib]System.Runtime.InteropServices.TypeIdentifierAttribute::.ctor() = ( 01 00 00 00 )
  .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 38 35 42 43 37 41 33 2D 39 43 45 34   // ..$A85BC7A3-9CE4
                                                                                                  2D 34 32 39 45 2D 41 33 37 30 2D 35 38 37 35 44   // -429E-A370-5875D
                                                                                                  45 46 45 42 33 45 39 00 00 )                      // EFEB3E9..
  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor () = ( 01 00 00 00 )

} // end of class P2ClientGateMTA.IP2BLMessage

--
Best regards,
Alik Kurdyukov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jb Evain  
View profile  
 More options Feb 13 2012, 9:31 am
From: Jb Evain <jbev...@gmail.com>
Date: Mon, 13 Feb 2012 15:31:59 +0100
Local: Mon, Feb 13 2012 9:31 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

On Mon, Feb 13, 2012 at 2:35 PM, Alik Kurdyukov <akurdyu...@gmail.com> wrote:
> I'm not sure I understand what's HasBody flag for methods. How can I check
> the assumption?

You can run on your assembly a piece of code using Cecil like:

var module = ModuleDefinition.ReadModule("MyAssembly.dll");
foreach (var method in module.GetTypes().SelectMany(t =>
t.Methods).Where(m => m.HasBody && m.Body.Instructions.Count == 0)) {
  Console.WriteLine ("Method with empty body: {0}", method);

}

And you'll have the names of actual methods with empty bodies.

Jb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alik Kurdyukov  
View profile  
 More options Feb 13 2012, 10:01 am
From: Alik Kurdyukov <akurdyu...@gmail.com>
Date: Mon, 13 Feb 2012 19:01:25 +0400
Local: Mon, Feb 13 2012 10:01 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

Thank you for code sample. For my assembly it gives:

Method with empty body: System.Void P2ClientGateMTA.IP2Connection::_VtblGap1_1()
Method with empty body: System.Void P2ClientGateMTA.IP2Connection::_VtblGap2_5()
Method with empty body: System.Void P2ClientGateMTA.IP2Connection::_VtblGap3_2()
Method with empty body: System.Void P2ClientGateMTA.IP2Connection::_VtblGap4_2()
Method with empty body: System.Void P2ClientGateMTA.IP2TableSet::_VtblGap1_4()
Method with empty body: System.Void P2ClientGateMTA.IP2TableSet::_VtblGap2_5()
Method with empty body: System.Void P2ClientGateMTA.IP2DataStreamEvents_Event::_VtblGap1_2()
Method with empty body: System.Void P2ClientGateMTA.IP2DataStreamEvents_Event::_VtblGap2_4()
Method with empty body: System.Void P2ClientGateMTA.IP2BLMessage::_VtblGap1_3()
Method with empty body: System.Void P2ClientGateMTA.IP2BLMessage::_VtblGap2_3()
Method with empty body: System.Void P2ClientGateMTA.IP2DataStreamEvents::_VtblGap1_1()
Method with empty body: System.Void P2ClientGateMTA.IP2DataStreamEvents::_VtblGap2_2()

BTW, I can give you binaries for P2ClientGateMTA assembly. Can it be of any help?

--
Best regards,
Alik Kurdyukov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jb Evain  
View profile  
 More options Feb 13 2012, 11:23 am
From: Jb Evain <jbev...@gmail.com>
Date: Mon, 13 Feb 2012 17:23:45 +0100
Local: Mon, Feb 13 2012 11:23 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar
I see,

This is a Microsoft C# compiler bug:

https://connect.microsoft.com/VisualStudio/feedback/details/595412/bu...

They emit managed methods which claim to be managed but are actually
implemented by the runtime. Not that they care a lot.

I committed a fix to gendarme
(1fbb7ea90bbb96d2d28f9567ec7dee8dc735cfc7), you can either build
gendarme yourself or have the sonar guys cherry-pick this fix.

Jb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alik Kurdyukov  
View profile  
 More options Feb 14 2012, 7:29 am
From: Alik Kurdyukov <akurdyu...@gmail.com>
Date: Tue, 14 Feb 2012 16:29:35 +0400
Local: Tues, Feb 14 2012 7:29 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

Jb,

Thank you for hotfixing the problem. Do you have any dates for next Gendarme release?

--
Best regards,
Alik Kurdyukov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebastien Pouliot  
View profile  
 More options Feb 14 2012, 7:59 am
From: Sebastien Pouliot <sebastien.poul...@gmail.com>
Date: Tue, 14 Feb 2012 07:59:38 -0500
Local: Tues, Feb 14 2012 7:59 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar
Hello Alik,

Gendarme official releases occurs at the same time as Mono releases.
The beta cycle for 2.11 should start soon - but we're a few months
away from a stable 2.12.

Sebastien


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ty  
View profile  
 More options May 23 2012, 12:14 pm
From: Ty <tie...@gmail.com>
Date: Wed, 23 May 2012 09:14:52 -0700 (PDT)
Local: Wed, May 23 2012 12:14 pm
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

Jb,

I am running into similar problems like Alik posted earlier. I downloaded
the new 2.11  version of gendarme
(gendarme-2.11-snapshot-20110305-win32-setup), but the problem is still
there. Wondering if your hot fix has been included into new 2.11 version
release.

BTW, I am totally new to using sonar .NET plugin, can you point me to where
to get your a fix to gendarme
(1fbb7ea90bbb96d2d28f9567ec7dee8dc735cfc7)?

Thanks a lot for your help.

Ty


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kulvinder Singh  
View profile  
 More options May 31 2012, 6:22 am
From: Kulvinder Singh <kulvinder.si...@gmail.com>
Date: Thu, 31 May 2012 03:22:40 -0700 (PDT)
Local: Thurs, May 31 2012 6:22 am
Subject: Re: [gendarme] Getting an exception in gendarme while analyzing a c# application using sonar

I'm running in to this too, here is a link to the commit Jb made:  
https://www.ohloh.net/p/gendarme/commits/163580935 (couldn't get Google to
find it from the UID).

I'll keep an eye out for news too.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »