ANTS profiler still fails when Unity pdb symbols are present

Code profiling for .NET Developers

Moderators: Luke Jefferson, StephenC, Alex.Davies, AndrewH, melvyn.harbour, Laura Morley

ANTS profiler still fails when Unity pdb symbols are present

Postby slaneyrw » Thu Jun 24, 2010 1:51 am

Title says it all.

Check previous forums messages. I thought that you would have fixed this by now
slaneyrw
 
Posts: 28
Joined: Tue Feb 08, 2005 10:01 pm

Postby nick.maidment » Thu Jun 24, 2010 9:48 am

Sorry to hear you're still having problems. After looking in the development database, the developers thought they had fixed it for this version. Are you getting the same error?
nick.maidment
 
Posts: 74
Joined: Fri Jan 29, 2010 1:55 pm

Postby AndrewH » Thu Jun 24, 2010 11:29 am

We fixed several bugs with identical symptoms during the v6 EAP and beta periods. This specific case was not tested by us as we had no evidence that it was any different from the other cases we knew about, and the EAP feedback that we got was that the issues caused by these bugs were no longer occurring, so there was no reason for us to investigate this specific case.

I have reproduced an issue with Unity 2.0, however. It only occurs if the target application is 64-bit and the profiler is in a line-level mode and seems to be due to an access violation in the .NET JIT. It's possible to work around the problem for now by changing the application target to x86 or by deleting the pdb or switching to a different profiling mode.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm

Postby AndrewH » Thu Jun 24, 2010 3:28 pm

I've now narrowed this down to an issue with the way that the profiler handles assemblies with the SecurityTransparent attribute, combined with a bug in .NET 2's verification of this attribute.

In .NET 4, this will produce a SecurityVerificationException. In .NET 2, nothing happens when using the x86 JIT and the x64 JIT crashes.

This means that you can also work around the problem by removing the SecurityTransparent attribute from any assemblies you want to use line-level timings on.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm

Postby slaneyrw » Thu Jun 24, 2010 10:30 pm

Thanks Andrew...

x64 ASP.NET MVC application, with Unity 2.0 and all Unity assemblies are marked with this attribute.

Is there a KB article from MS on the .NET 2 bug, I might be able to get a hotfix using our Premier support agreement ?
slaneyrw
 
Posts: 28
Joined: Tue Feb 08, 2005 10:01 pm

Postby AndrewH » Fri Jun 25, 2010 10:58 am

I haven't been able to find anything on Microsoft's site about this problem, though I can write my own assembly marked as SecurityTransparent and call P/Invokes from it.

A fix for the .NET issue wouldn't help with the profiler, however, as the problem is due to code being generated by the profiler that can't run in a SecurityTransparent assembly. The only difference would be that the program would crash with an exception instead of an access violation.

We'll look into fixing this in a minor release: the solution will probably have to be to disable line-level timings for SecurityTransparent methods.
Andrew Hunter
Software Developer
Red Gate Software Ltd.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Performance Profiler 6

Who is online

Users browsing this forum: No registered users and 0 guests