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

Incorrect version detected on python 3.11 #731

Open
yiding opened this issue Dec 3, 2024 · 0 comments
Open

Incorrect version detected on python 3.11 #731

yiding opened this issue Dec 3, 2024 · 0 comments

Comments

@yiding
Copy link

yiding commented Dec 3, 2024

Python version: 3.11
OS: linux, nixos

I notice that py-spy sometimes fails to work for a process (and works after some arbitrary number of restarts). Running with debug messages I see this:

[2024-12-03T21:19:29.884313787Z INFO  py_spy::python_process_info] Found libpython binary @ /home/yiding/.local/share/uv/python/cpython-3.11.10-linux-x86_64-gnu/lib/libpython3.11.so.1.0
[2024-12-03T21:19:29.907063354Z INFO  py_spy::python_process_info] got symbol Py_GetVersion.version (0x00007f89dd46af60) from libpython binary
[2024-12-03T21:19:29.907104533Z INFO  py_spy::python_process_info] Getting version from symbol address
[2024-12-03T21:19:29.907129454Z INFO  py_spy::python_process_info] Getting version from python binary BSS
[2024-12-03T21:19:29.907136255Z INFO  py_spy::python_process_info] Failed to get version from BSS section: failed to find version string
[2024-12-03T21:19:29.907139735Z INFO  py_spy::python_process_info] Getting version from libpython BSS
[2024-12-03T21:19:29.907456044Z INFO  py_spy::version] Found matching version string '3.8.3 or higherError creating functionuser-defined function raised e'
[2024-12-03T21:19:29.907493109Z INFO  py_spy::python_spy] python version 3.8.3 detected
[2024-12-03T21:19:29.907498683Z INFO  py_spy::python_process_info] got symbol _PyRuntime (0x00007f89dd401850) from libpython binary
[2024-12-03T21:19:29.907528765Z WARN  py_spy::python_process_info] Interpreter address from _PyRuntime symbol is invalid 2054455320726574
[2024-12-03T21:19:29.907531639Z INFO  py_spy::python_process_info] Failed to find runtime address from symbols, scanning BSS section from main binary
[2024-12-03T21:19:29.907539144Z INFO  py_spy::python_process_info] Failed to get interpreter from binary BSS, scanning libpython BSS

Running 'strings' on the libpython binary i see a string like this, which is probably what it matched on:

deterministic=True requires SQLite 3.8.3 or higher

This string comes from sqlite library built into cpython (and seems to be removed in later versions): https://github.com/python/cpython/blob/3.11/Modules/_sqlite/connection.c#L1015

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

1 participant