benfred / py-spy

Sampling profiler for Python programs
MIT License
12.16k stars 401 forks source link

"Access is denied" when trying to `py-spy dump` under Windows #527

Open gozdal opened 1 year ago

gozdal commented 1 year ago

I am trying to dump a Python process to understand why it's hung.

I have tried using the same user as the process (it's running under jenkins user from another Login session), a different user and Administrator user. Regardless on which user I choose I get:

(pyspy-venv) C:\Users\dev>py-spy dump --pid 1892
Error: Failed to open process - check if it is running.
Reason: Access is denied. (os error 5)
Reason: Access is denied. (os error 5)

How do I debug the problem? Why isn't Windows letting me see what the process is doing? I can see the process under Process Explorer ran from Administrator user just fine.

This is Windows 10 21H2, build 19044.2006, py-spy 0.3.14, Python 3.10.4

gsarathkumar92 commented 8 months ago

I'm also facing the above issue, any updates on the issue