Skip to content
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

Failed to get python threadid for main thread when profiling a Dockerized process #168

Closed
vainu-lauri opened this issue Sep 23, 2019 · 2 comments

Comments

@vainu-lauri
Copy link

When profiling a python process from host that is running in a Docker container I'm getting lots of these errors:

[2019-09-23T12:04:34.576469893Z ERROR py_spy::python_spy] failed to get python threadid for main thread!
[2019-09-23T12:04:34.607087353Z ERROR py_spy::python_spy] failed to get python threadid for main thread!

Occasionally (like one in 1000 lines) I'm able to see the top view of py-spy for a single sample

This used to work with previous version of py-spy and the issue started occurring with the new 0.2.0 version.

In the container I'm running Python 2.7.15+ and the host is Debian 9.9 running kernel:
4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64 GNU/Linux

@benfred
Copy link
Owner

benfred commented Sep 26, 2019

So - the problem is that we're spamming the log with a non-fatal error message here, and thats getting in the way of the top view =( As a short term fix if you suppress all log messagse with RUST_LOG=none py-spy top --pid 12345 I think everything should still work as before.

I'll get a proper fix in the next release -

benfred added a commit that referenced this issue Sep 27, 2019
When profiling a process inside a docker container from the Host OS, we fail to
unwind the native stack (which we use for figuring out the native thread id).
This caused an issue with the log being spammed with errors about this obscuring
the actual output (#168).

Fix by falling back to previous behaviour in this case, and also downgrade the
error message to a warning.
benfred added a commit that referenced this issue Sep 27, 2019
When profiling a process inside a docker container from the Host OS, we fail to
unwind the native stack (which we use for figuring out the native thread id).
This caused an issue with the log being spammed with errors about this obscuring
the actual output (#168).

Fix by falling back to previous behaviour in this case, and also downgrade the
error message to a warning.
@benfred
Copy link
Owner

benfred commented Sep 27, 2019

fixed in v0.2.1

@benfred benfred closed this as completed Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants