Exception in application when profiling

Code profiling for .NET Developers

Moderators: StephenC, Alex.Davies, AndrewH

Exception in application when profiling

Postby nrandell » Fri Dec 11, 2009 12:48 pm

I'm trying to profile an application but no matter what options I enable, it always throws an exception.

I can launch the debugger when the exception gets thrown and see why it is happening, but there is explanation for why it occurs.

My application is quite large, but the area it occurs in is small. The problem has arisen because a csv parser reads '3' in as 0.

This only happens in the profiler. It happens in debug and release. Changing the options seems to make it happen at different lines of the CSV file. I'm wondering if there is a strange interaction between garbage collection and profiling and something is being moved in memory while the profiler is doing something!

I'm running Windows 7 64 bit with 8gb RAM and a dual core processor. All the apps are .net 3.5

Thanks

Nick
Nick Randell
nrandell
 
Posts: 4
Joined: Fri Dec 11, 2009 12:40 pm

Postby StephenC » Fri Dec 11, 2009 1:29 pm

Hi Nick,

is your application using multiple threads?

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby nrandell » Fri Dec 11, 2009 1:49 pm

No, it's a single threaded application.

A string is read from the file. It is then passed to a method to create an object from that. The string is then passed to a csv parser for processing.

When I read the string in the debugger after the exception is thrown, I see it starts with '3;'. However when I check the value read from the first entry, I see '0'. I've put in console diagnostics and they show the same problem.

Changing various profiling options allows the program to run differing amounts!
Nick Randell
nrandell
 
Posts: 4
Joined: Fri Dec 11, 2009 12:40 pm

Postby StephenC » Fri Dec 11, 2009 3:01 pm

We would need to see the program to have any idea what’s going on here.

Anything where the exact timing of operations matters could possibly have its behaviour changed by the profiler, though.

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby nrandell » Mon Jan 11, 2010 1:55 pm

I've got another example with this happening. Can you let me know where I can upload my application to so you can find it.

With the small (ish) example I have, it behaves differently when I copy in the pdb for the main library I want to profile.

This is on Windows 7, 64 bit using Performance Profiler 5.2 professional.
Nick Randell
nrandell
 
Posts: 4
Joined: Fri Dec 11, 2009 12:40 pm

Postby StephenC » Mon Jan 11, 2010 2:43 pm

If the application isn't too large then you can send it to support@red-gate.com and reference this post.

If you hit any issues with the email then post again and i'll sort you out with an upload directory.

Thanks,

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby nrandell » Tue Jan 12, 2010 2:13 pm

Hi Stephen.

I tried emailing, but it looks like the attachment didn't get through. Can you sort out an upload directory please.

Thanks

Nick
Nick Randell
nrandell
 
Posts: 4
Joined: Fri Dec 11, 2009 12:40 pm

Postby StephenC » Tue Jan 12, 2010 2:40 pm

Hi Nick,

could you send support@red-gate.com an email about organizing an upload directory and reference this post that would be great. It will allow us to keep track of issues and offer you better support.

Cheers,

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby Chris.Allen » Thu Jan 21, 2010 6:23 pm

My results: with the same version I get different results. This is, in a way, only to be expected- profiling using the "Instrumentation" technique does change the behaviour of code in various ways. Luckily- we have been working on "Sampling" mode in our new major version which is in Alpha testing at the moment and with this (on Windows 7) I get pretty much identical results.

Please try it (especially in Sampling mode):

http://downloads.red-gate.com//EAP/ANTS ... .0.587.exe
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby justsml » Thu Jan 28, 2010 7:19 pm

I'm running into a similar issue with bizarrely random code execution - things like:
Code: Select all
"Hello".IndexOf("o")

returns 19, and then maybe a negative number if I run again.

It works outside of the profiler.

I'm going to try the v6 Beta....
justsml
 
Posts: 1
Joined: Fri Jan 16, 2009 10:45 pm

Re:

Postby AndrewH » Fri Jan 29, 2010 12:10 pm

Build 663 of the EAP is now out, and should hopefully address the issues on x64.

http://downloads.red-gate.com//EAP/ANTSPerformanceProfiler/ANTSProfiler_6.0.0.663.exe

justsml wrote:I'm running into a similar issue with bizarrely random code execution - things like:
Code: Select all
"Hello".IndexOf("o")


However, this is something I can't reproduce here even with older versions of the profiler. The bug that we found specifically affects methods that return floating point values on x64 systems.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Performance Profiler 5

Who is online

Users browsing this forum: No registered users and 1 guest