-
Notifications
You must be signed in to change notification settings - Fork 431
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
In "Ubuntu" docker container on Joyent's Triton platform, py-spy exits with os error 38 #22
Comments
I'm guessing it is failing in the call to process_vm_readv - which is a linux system call. It doesn't seem like it's failing for the normal reasons on docker though (permissions denied because of missing ptrace capability: #12 (comment)), so I'm wondering if it is because of the underlying BSD host OS. Can you get the full back trace/log ? (
I would like to support BSD with py-spy, but I'm not sure if that would still be enough to support your use case though =( |
Likely related it doesn't run on alpine linux host either - probably cos the function isn't implemented in musl libc either. Stack trace:
(Separate issue? Possibly an un-solvable one?) |
@ashb I've tested py-spy with alpine linux (using docker, with the python:3.6-alpine image), and it worked for me. There are some hassles installing py-spy with pip under alpine linux, but it should all work (details here #23 ) Did you compile py-spy yourself from source or use the binary wheels on pypi? The linux wheels on pypi are compiled with the musl libc toolchain for portability - so should work on alpine linux (also since it's a statically linked binary, this should remove issues with old versions of glibc. What version of the linux kernel are you using? the underlying process_vm_readv call requires at least a linux 3.2 kernel. (like what does |
pip-wheel based install, and uname reports 4.1.15-2. I wouldn't worry to much about it as this VM is kind of odd and oddly configured in ways I can't remember. I can dig more in to this if you like. This is also an alpine linux host os, but a non-alpine image (python:3.6-slim). |
I have a |
FWIW, I get the same issue trying to run py-spy under docker under CoreOS.
I'd love to hear that this has been solved sometime in the last 9 months! |
Sounds like this is potentially a kernel configuration problem. If the kernel was built without If your host OS kernel is not built with that option, any container running on that OS won't work, since they're running on the same kernel. VM's are completely isolated though and don't depend on the host OS. So I don't think this isn't a musl issue, or a libc issue, but a kernel configuration issue. I'm not sure if there are any workarounds that py-spy can do, like reading |
@codypiersall I think that you are probably right on this, it's the best explanation I've seen for a weird problem. If anyone that is affected by this can verify their kernel config to see if they are lacking CONFIG_CROSS_MEMORY_ATTACH, I'd really appreciate it. Reading from /proc/PID/mem will work as a workaround most of the time- but not if we're in nonblocking mode (proc/mem requires a ptrace attach). It's still probably worth trying as a workaround in this case though |
Yes, the Alpine vanilla kernel with which I met this issue has:
|
I'm affected by this, Host system:
py-spy launched in container:
|
I meet the same issue, both python process and py-spy runs in host.
System Info:
py-spy version:
|
This should be fixed in v0.3.5 - https://pypi.org/project/py-spy/0.3.5/ . |
Triton implements the docker API and can run sort of faux-Linux containers that are (to the best of my non-expert understanding) actually built on top of Solaris zones, as the host OS of Triton compute nodes is SmartOS, which is based on illumos, which is based on OpenSolaris, which is based on BSD and proprietary UNIX implementations.
The README says BSD is not yet supported, so I'm not surprised that it didn't work. It'd be awfully nice if it did, though, and I thought I'd open an issue in case anyone else is trying to use py-spy in a SmartOS container or another BSD or BSD-like environment.
The specific error message I get is:
The text was updated successfully, but these errors were encountered: