grafana / pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Apache License 2.0
132 stars 22 forks source link

Unsupported version of Python: 3.12.0 #168

Open Battlesheepu opened 1 week ago

Battlesheepu commented 1 week ago

Describe the bug you encountered:

I've been trying to use the pyroscope-io Python library to send data to my Pyroscope instance. The problem is, based on the logs, the Python 3.12 version is not supported.

The debug logs say it explicitly:

 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Getting version from python binary BSS
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to get version from BSS section: failed to find version string
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Trying to get version from path: /usr/bin/python3.12
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > python version 3.12.0 detected
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to get interp_head from symbols, scanning BSS section from main binary
 2024-06-22T17:36:41.594Z INFO  py_spy::python_spy > Failed to connect to process, retrying. Error: Unsupported version of Python: 3.12.0
 2024-06-22T17:36:41.614Z INFO  py_spy::python_spy > Got virtual memory maps from pid 20864:

What did you expect to happen instead?

I expected the library to work as it did with the older Python versions.

How did you install pyroscope-rs?

Pyroscope installed via pip install pyroscope-io

$ pip freeze | grep -i pyroscope                                                                                                                                 INT|INT ✘  pyroscope   19:36:42  
pyroscope-io==0.8.7

I've encountered the problems on both Ubuntu 22.04 and 24.04, both with a virtual env created from the system-wide Python and in a Python installation built from source.

Additional words

Huge thanks for the help in advance!

Battlesheepu commented 1 week ago

In terms of py-spy itself, there's already a few issues for it:

So I understand the problem is on the py-spy side, but could we actually track it here to make sure the py-spy version gets bumped as soon as it supports Python 3.12?

korniltsev commented 6 days ago

another option could be to not use pyspy for our pip package. pyspy was designed to be used out of process and pyroscope pip package is inprocess so we don't have to solve some of the issues. This could also help solving performance issues.