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

Test python interpreters without symbols in CI #719

Open
benfred opened this issue Nov 1, 2024 · 3 comments
Open

Test python interpreters without symbols in CI #719

benfred opened this issue Nov 1, 2024 · 3 comments

Comments

@benfred
Copy link
Owner

benfred commented Nov 1, 2024

The BSS scanning fallback code broke after python 3.10 was released (#716) and we didn't notice since this we don't test this functionality out in CI.

We should add some tests that exercise this functionality as part of CI

@benfred benfred changed the title Test python interpreters without symbols Test python interpreters without symbols in CI Nov 1, 2024
@zanieb
Copy link
Contributor

zanieb commented Nov 1, 2024

To continue the discussion from #718,

❯ nm -A `uv python find --python-preference only-system`
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _Py_Initialize
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U __NSGetExecutablePath
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U ___error
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U ___stderrp
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U ___strlcat_chk
/opt/homebrew/opt/[email protected]/bin/python3.12: 0000000100000000 T __mh_execute_header
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _dladdr
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _environ
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _err
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _exit
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _fwrite
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _malloc
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _posix_spawn
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _posix_spawnattr_init
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _posix_spawnattr_setbinpref_np
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _posix_spawnattr_setflags
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _realpath$DARWIN_EXTSN
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _setenv
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _strcpy
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _strlen
/opt/homebrew/opt/[email protected]/bin/python3.12:                  U _strrchr
❯ uv python install 3.12
Searching for Python versions matching: Python 3.12
Installed Python 3.12.7 in 1.47s
 + cpython-3.12.7-macos-aarch64-none
❯ nm -A `uv python find --python-preference only-managed`
/Users/zb/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/bin/python3:                  U _Py_BytesMain
/Users/zb/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/bin/python3: 0000000100008008 d __dyld_private
/Users/zb/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/bin/python3: 0000000100000000 T __mh_execute_header
/Users/zb/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/bin/python3: 00000001000005f0 t _main
/Users/zb/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/bin/python3:                  U dyld_stub_binder

@benfred
Copy link
Owner Author

benfred commented Nov 2, 2024

thanks @zanieb !

I just tested out uv quick for the first (and btw, uv is pretty slick on first impressions - I see why I've been hearing so much about it) - and I think that we're still seeing a _PyRuntime symbol , its just coming from the libpython.so rather than the main python executable (like python is compiled with --enabled-shared here).

[2024-11-02T00:02:50.323911966Z INFO  py_spy::python_process_info] Found libpython binary @ /home/ben/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/libpython3.12.so.1.0
[2024-11-02T00:02:50.534690512Z INFO  py_spy::python_process_info] Getting version from python binary BSS
[2024-11-02T00:02:50.549518057Z INFO  py_spy::python_process_info] Failed to get version from BSS section: failed to find version string
[2024-11-02T00:02:50.549540505Z INFO  py_spy::python_process_info] Getting version from libpython BSS
[2024-11-02T00:02:50.551385878Z INFO  py_spy::version] Found matching version string '3.12.7 (main, Oct 16 2024, 04:37:19) [Clang 18.1.8 ]'
[2024-11-02T00:02:50.551398825Z INFO  py_spy::python_spy] python version 3.12.7 detected
[2024-11-02T00:02:50.551409353Z INFO  py_spy::python_process_info] got symbol _PyRuntime (0x00007ffab8ef2bd0) from libpython binary

@zanieb
Copy link
Contributor

zanieb commented Nov 2, 2024

Alas. Well, good to know the distributions are compatible with a profiler even though we strip them, but too bad it's not helpful here :)

Why aren't the existing Windows tests sufficient if that's where it's usually broken?

(Glad to hear you liked uv!)

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