views:

220

answers:

5

I've been evaluating profilers and memory checking tools for native C++ programs on Windows and all of them want to be installed and run with administrator privileges. I rarely log in as admin on my machine. If I need to install something or do something that requires administrative privileges, I use runas and it works pretty well.

Is it legitimate for a profiler to require admin privileges, or are the profiler developers just being lazy? Am I being unreasonable by rejecting all of these tools on this basis?

I'm developing with VS 2005 on an XP Pro machine.

+4  A: 

Because they have to look at other process' memory, which is normally taboo.

Joel Coehoorn
YMMV, but on Linux it's very common for a user privileged code to be debugged by a user privileged debugger (of course, both must run under the same user id).
bothie
I'm using AQTime at work (running on Vista) and it never asked for admin privileges (UAC is enabled).
OregonGhost
There are many tools, process explorer for example, do look at other process' memory and thread stack.
Dennis Cheung
OregonGhost- I looked at AQTime and it claims to require admin privileges. At least on XP.
criddell
Administrative privileges are not required for a program running as a user to attach to another program running as that same user. Neither in Windows nor in Linux.
Rob Kennedy
Windows != linux. If your user has administrative privileges, your program/process has adminstrative privileges
Joel Coehoorn
A: 

Sounds like a design choice by the developers. They may have thought it was a good idea to request admin rights before probing around in memory or dynamically altering code in memory since this behaviour is to be expected from some types of malware.

jheriko
+3  A: 

some cpu profilers actually do a statistic averaging using OS interrupts... obviously they cannot do this without privileges for that :)

dionadar
A: 

The most likely explanation is that they are implemented as specialised debuggers, using the Win32 debugging APIs like DebugActiveProcess(). These functions need PROCESS_ALL_ACCESS (as detailed in the documentation) and I would expect that you will need admin rights for that.

IIRC the Visual Studio debugger won't work (properly) either unless you have local admin rights on your system, at least for C++.

Timo Geusch
Users can attach a debugger to their processes. You only need to be admin to attach to another user's process (or a system process).
criddell
+1  A: 

I've been reading about this and I'm slowly coming to the conclusion that profiler-like tools in general do not require administrative access, but stating that you require it is an easy way for the tool makers to avoid all problems related to insufficient privileges.

So, I guess they are being lazy but also somewhat pragmatic.

Correct me if I'm wrong (I'm no expert on the Windows security model), but I believe one way to handle this situation would be to require admin privileges only at install time. Then create a ProfilerUsers user group and grant any necessary privileges to that group, then ask which computer users should be added to that group.

The most shocking thing I've discovered is that a lot of developers run all the time with administrative privileges.

criddell