Red Gate forums :: View topic - Urgent -There is already a profiler attached to this process
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler 7
ANTS Memory Profiler 7 forum

Urgent -There is already a profiler attached to this process

Search in ANTS Memory Profiler 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
gsuttie



Joined: 30 Nov 2005
Posts: 45
Location: Glasgow, Scotland

PostPosted: Mon Jun 13, 2011 1:54 pm    Post subject: Urgent -There is already a profiler attached to this process Reply with quote

Folks we have an urgent problem with trying to attach Ants profiler to .net 4 process - we are getting the following error message.

There is already a profiler attached to this process.

Exception from HRESULT 0x8013136A

Could someone please help asap.

I am a friend of redgate and using your tool on site and would really appreciate some quick advice.

Many thanks
Gregor
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Mon Jun 13, 2011 2:26 pm    Post subject: Reply with quote

.NET only allows one profiler to be attached to any given process, so this error occurs whenever anything else using the profiling API is already attached to the target process. Unfortunately, the error reported to ANTS is exactly as displayed on screen, so it has no way of knowing what the other profiler is.

It's possible that a crashed UI session would leave behind the ANTS profiler core in the target process. Unfortunately, there's no way to unload the core at this point other than by restarting the process.

Hm, it occurs to me that we haven't tried the case where the profiler environment variables are set but the profiler doesn't start. I think that the core should unload itself and allow a future attach, but I haven't actually tried it.

If it's not ANTS, tracking down the culprit is going to be more difficult. You should be able to see the profiler DLL that's loaded using SysInternals process explorer (ANTS memory profiler will be RedGate.Memory.Core.dll). You can also look at the environment variables to find third-party profilers: specifically, the COR_PROFILER environment variable, which if it's set will be set to the GUID of a COM+ component, which can be looked up in the registry to find out what's being loaded (then you'll need to configure whichever tool it is to stop loading on the target process). If the profiler attached itself via the .NET API, these variables won't be set, so the only way to find out what the profiler is is to spot the actual DLL that's being loaded.

There is at least one third-party profiler that works by loading itself in via this mechanism to every running process on the system to implement its own attach mechanism (this effectively disables any other profiler from running on the system). I *think* IntelliTrace also loads a profiler into anything it's being run on, so that will need to be turned off to make the profiler work.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group