ANTS profiler still fails when Unity pdb symbols are present

Title says it all.

Check previous forums messages. I thought that you would have fixed this by now

Comments

  • 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?
  • 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.
  • 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.
  • 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 ?
  • 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.
Sign In or Register to comment.