-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes profiled program is left suspended #390
Comments
the suspended process can be resumed with I tried poking at it a bit with
On a good run (when the process is successfully resumed), this ends with:
Compare with a run where the process is left suspended, where the
|
I was only able to reproduce this with |
Which py-spy version are you running? |
thanks for the bug report! I've managed to reproduce on the latest version of py-spy. It also only happens for me using -raw format. (@Jongy it looks like the fix you put in for ptrace attach in py-spy v0.3.4 is unrelated to this issue benfred/remoteprocess#7 - I think this bug is to do with thread cleanup on the sampling thread). |
I have a first draft attempt at fixing here #391 - @richvdh can you try this out to see if this fixes? (once the build has finished you can download the pre-built wheels from https://github.com/benfred/py-spy/actions/runs/822517355 under 'artifacts' - which will save you from having to compile from source). I still have to add logic for the subprocess sampling before merging this - but will get that in a couple days |
It's indeed what I thought initially. But I was under the impression that upon exit, the tracee gets released automatically. It can be reproduced with a simple |
yup, that seems to work fine. |
Thanks! Fix is in py-spy 0.3.7 (which will be pushed out to pypi/crates.io automatically by CI in the next 30 minutes or so). |
Encountered this when spying a pytorch program. The |
@shyn I'm sorry to hear that =( Is there any other information you can share for tracking this down ? I haven't seen that myself since the fix went in |
Some environments: When the process is suspended, Will try to reproduce this when free ;) |
Easy to reproduce. Just run |
This is intermittent, but: sometimes, once a
py-spy record -d <duration>
completes, the program being profiled is left in a suspended state.for example:
The text was updated successfully, but these errors were encountered: