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 #1

Closed
mottosso opened this issue Aug 21, 2018 · 5 comments
Closed

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

mottosso opened this issue Aug 21, 2018 · 5 comments

Comments

@mottosso
Copy link

Hi @benfred,

Loving the goals for this project, but understand it's a little early.

Running this on Windows 10, Python 3.6 x64, profiling another instance of the same version I get this.

$ pip install py-spy
$ c:\Python36\scripts\py-spy --pid 4024
Error: Failed to find a python interpreter in the .data section

Likely a separate problem, but profiling a Python 2.7 x64 instance yields this.

$ c:\Python36\scripts\py-spy --pid 1140
Error: Unsupported version of Python: 2.2.2

The Python instances were merely started, with nothing much going on.

$ c:\Python36\python.exe
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

$ c:\Python27\python.exe
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Any way I can work around this?

@benfred
Copy link
Owner

benfred commented Aug 22, 2018

Thanks for the bug report! This is really helpful.

It seems like you found two different problems:

  1. The first problem was pulling out the wrong version of python (2.2.2). I’m scanning the BSS section for the sys.version variable - and in your case there was another semver string included that was getting picked up (was finding this string here instead: https://github.com/python/cpython/blob/master/Modules/_sre.c#L39, so was thinking you had a v2.2 python install =(. I’ve fixed here to match more tightly 00ec463 - if you pull the most recent code and build it it should work now.

  2. The second problem is a bit trickier - On windows right now we need the symbol files for python, and it seems like it failed to load some of the symbols we need =( Symbols should be installed with python3.6 though - what are the contents of your c:\python36 directory? The symbol files ’python36.pdb’ and ‘python.pdb’ should be there. For python2.7 the symbol files aren’t installed with the installer from python.org (though they are installed with anaconda), however you can download the python2.7 symbols here .

Also If you see the symbol files for python36 and it still doesn’t work, can you try enabling logging and rerunning?

set RUST_LOG=info
py-spy —pid pid

I’m hoping to fix the code to not require symbol files on windows pretty soon - the OSX and Linux versions both work without symbols, and it shouldn’t be too hard to get this going for windows.

This library is still super early in development - I’ve only really put it up here to get some early feedback (and haven’t posted it anywhere public yet =). I’m still working through some of the issues, but I am hoping to have it ready for wider release in the next week or so.

Thanks again, and let me know if you find any other issues!

@benfred
Copy link
Owner

benfred commented Aug 22, 2018

The fix for working without symbols on windows turned out to be pretty easy actually: 6809f59 . I'm hoping this last commit will fix the issues you were seeing

@mottosso
Copy link
Author

mottosso commented Aug 22, 2018

Thanks for the quick reply, and fix! Giving this a try next.

and haven’t posted it anywhere public yet =)

I came across the project on DuckDuckGo, searching for "sampling profiler python"; yours was the first result. :)

@benfred
Copy link
Owner

benfred commented Sep 5, 2018

I think it's ready for general use now - I've fixed this issue (and a bunch of others with the system python on OSX, homebrew installs etc). Thanks for giving this a go!

@benfred benfred closed this as completed Sep 5, 2018
@mottosso
Copy link
Author

mottosso commented Sep 6, 2018

It works! :)

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