Failed to locate libpython within timeout period.
lxkaka opened this issue · 9 comments
I'm using python 3.5 , when I execute the command "src/pyflame -s 60 -r 0.01 -p 25192 | /FlameGraph/flamegraph.pl > test_flame.svg"
The error 'Failed to locate libpython within timeout period' was raised. Is that a compatible issue?
Can you give more details? What is the process you're trying to trace? Do the unit tests pass (as indicated by make check
) after you build Pyflame?
I tried to trace uWSGI prcocess. Some unit tests failed(9 failed, 19 passed).
This is a fail example
def test_monitor(dijkstra):
"""Basic test for the monitor mode."""
proc = subprocess.Popen(
['./src/pyflame', '-p', str(dijkstra.pid)],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True)
out, err = communicate(proc)
> assert not err
E AssertionError: assert not 'Failed to seize PID 26726\n'
tests/test_end_to_end.py:170: AssertionError
You need to enable ptrace: https://pyflame.readthedocs.io/en/latest/faq.html?#what-are-these-ptrace-permissions-errors
@eklitzke I'm seeing this as well and I seem to have all my ptrace capabilities in order...rather, this seems related to the tool being confused about which Python to run against. Is there anything to support that theory? When I run make check
only test_permission_error
fails, and it's because of the error message originally listed in this issue. The process I'm trying to trace is running under a different UID, so that may also be related?
I appreciate your help! 🍻
Dropping into a shell as the user that owns the process improved things; the tests all pass. However, attempting to run pyflame produced Failed to seize PID
and after making the change from #152 it's not much more helpful:
Failed to attach to PID 24056: Operation not permitted
I'm attempting to trace a Django process under mod_wsgi. We have our WSGIDaemonProcess
display-name
set such that I can do the following:
$ ps aux | grep django
# Select a PID
$ ./src/pyflame -s 10 -r 0.01 -p <PID>
Am I misunderstanding something?
Try using sudo ...pyflame ...
It worked for me.
Using sudo causes even more problems because now it can't find modules... Either from the project or from the standard lib. Any solution to this?
@sird0d0 see here for how we got it to work with Python 3.4. Bad news is I haven't been able to figure out how to get it working on Python 3.7 yet, even after looking at some other PRs floating around 😢
Same issue with Python 3.7