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

Error: Failed to find a python interpreter in the .data section #675

Closed
olumide-x opened this issue Aug 12, 2024 · 5 comments
Closed

Error: Failed to find a python interpreter in the .data section #675

olumide-x opened this issue Aug 12, 2024 · 5 comments

Comments

@olumide-x
Copy link

olumide-x commented Aug 12, 2024

I am running py-spy (version. 0.3.14) on the following simple example (from the GTK python docs) as follows

py-spy record -- python test.py

on Windows. The application ran for a short while but then crashes with the error

`Error: Failed to find a python interpreter in the .data section`
@jairov4
Copy link

jairov4 commented Sep 26, 2024

Same for me on Windows 11 and Python 3.11.9

PS C:\Users\jairo> py-spy top --pid 6516
[2024-09-26T21:34:56.591592500Z INFO  py_spy::config] Command line args: ArgMatches { args: {}, subcommand: Some(SubCommand { id: [hash: 94BC6A87CFA2B1F9], name: "top", matches: ArgMatches { args: {[hash: CD5160AB4406C427]: MatchedArg { occurs: 1, source: Some(CommandLine), indices: [2], type_id: Some(TypeId { t: 8220707328025750160 }), vals: [[AnyValue { inner: TypeId { t: 8220707328025750160 } }]], raw_vals: [["6516"]], ignore_case: false }, [hash: AAFAF59EB7E2AC8]: MatchedArg { occurs: 0, source: Some(DefaultValue), indices: [3], type_id: Some(TypeId { t: 8220707328025750160 }), vals: [[AnyValue { inner: TypeId { t: 8220707328025750160 } }]], raw_vals: [["100"]], ignore_case: false }}, subcommand: None } }) }
[2024-09-26T21:34:56.593518800Z INFO  py_spy::python_spy] Got virtual memory maps from pid 6516:
[2024-09-26T21:34:56.594659600Z INFO  py_spy::python_spy] Found libpython binary @ C:\Users\jairo\AppData\Local\Programs\Python\Python311\python311.dll
[2024-09-26T21:34:56.598030500Z INFO  py_spy::python_spy] Getting version from python binary BSS
[2024-09-26T21:34:56.598683000Z INFO  py_spy::python_spy] Failed to get version from BSS section: failed to find version string
[2024-09-26T21:34:56.598761000Z INFO  py_spy::python_spy] Getting version from libpython BSS
[2024-09-26T21:34:56.599668500Z INFO  py_spy::version] Found matching version string '3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit'
[2024-09-26T21:34:56.599843400Z INFO  py_spy::python_spy] python version 3.11.9 detected
[2024-09-26T21:34:56.599977800Z INFO  py_spy::python_spy] got symbol _PyRuntime (0x00007ffb82137600) from libpython binary
[2024-09-26T21:34:56.600279800Z WARN  py_spy::python_spy] Interpreter address from _PyRuntime symbol is invalid 0000000000000000
[2024-09-26T21:34:56.600387100Z INFO  py_spy::python_spy] Failed to get interp_head from symbols, scanning BSS section from main binary
[2024-09-26T21:34:56.608448500Z INFO  py_spy::python_spy] Failed to get interpreter from binary BSS, scanning libpython BSS
[2024-09-26T21:34:58.338916400Z INFO  py_spy::python_spy] Failed to connect to process, retrying. Error: Failed to find a python interpreter in the .data section

Also on Windows 11 and Python 3.10.0

PS C:\Users\jairo> py-spy top --pid 15988
[2024-09-26T21:54:26.535191700Z INFO  py_spy::config] Command line args: ArgMatches { args: {}, subcommand: Some(SubCommand { id: [hash: 94BC6A87CFA2B1F9], name: "top", matches: ArgMatches { args: {[hash: CD5160AB4406C427]: MatchedArg { occurs: 1, source: Some(CommandLine), indices: [2], type_id: Some(TypeId { t: 8220707328025750160 }), vals: [[AnyValue { inner: TypeId { t: 8220707328025750160 } }]], raw_vals: [["15988"]], ignore_case: false }, [hash: AAFAF59EB7E2AC8]: MatchedArg { occurs: 0, source: Some(DefaultValue), indices: [3], type_id: Some(TypeId { t: 8220707328025750160 }), vals: [[AnyValue { inner: TypeId { t: 8220707328025750160 } }]], raw_vals: [["100"]], ignore_case: false }}, subcommand: None } }) }
[2024-09-26T21:54:26.537111000Z INFO  py_spy::python_spy] Got virtual memory maps from pid 15988:
[2024-09-26T21:54:26.538560100Z INFO  py_spy::python_spy] Found libpython binary @ C:\Users\jairo\AppData\Local\Programs\Python\Python310\python310.dll
[2024-09-26T21:54:26.541912200Z INFO  py_spy::python_spy] Getting version from python binary BSS
[2024-09-26T21:54:26.542565500Z INFO  py_spy::python_spy] Failed to get version from BSS section: failed to find version string
[2024-09-26T21:54:26.542667900Z INFO  py_spy::python_spy] Getting version from libpython BSS
[2024-09-26T21:54:26.543033600Z INFO  py_spy::version] Found matching version string '3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit'
[2024-09-26T21:54:26.543172000Z INFO  py_spy::python_spy] python version 3.10.0 detected
[2024-09-26T21:54:26.543245800Z INFO  py_spy::python_spy] got symbol _PyRuntime (0x00007ffb80e34800) from libpython binary
[2024-09-26T21:54:26.543480000Z WARN  py_spy::python_spy] Interpreter address from _PyRuntime symbol is invalid 0016c0d4003c2bd8
[2024-09-26T21:54:26.543596500Z INFO  py_spy::python_spy] Failed to get interp_head from symbols, scanning BSS section from main binary
[2024-09-26T21:54:26.552387400Z INFO  py_spy::python_spy] Failed to get interpreter from binary BSS, scanning libpython BSS
[2024-09-26T21:54:27.015787500Z INFO  py_spy::python_spy] Failed to connect to process, retrying. Error: Failed to find a python interpreter in the .data section

@jairov4
Copy link

jairov4 commented Sep 26, 2024

may be is any page indicating which version of python works?

@jairov4
Copy link

jairov4 commented Sep 26, 2024

I found it works on Python 3.9 on windows but unfortunately it is useless for my case, my project use python 3.11 syntax :(

@benfred
Copy link
Owner

benfred commented Oct 31, 2024

This should be fixed by #718 -

@benfred
Copy link
Owner

benfred commented Nov 1, 2024

I think this should be fixed in the 0.4 release. Can you try it out and let me know?

If this is still not working please re-open the issue

@benfred benfred closed this as completed Nov 1, 2024
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

3 participants