pyflame icon indicating copy to clipboard operation
pyflame copied to clipboard

Add support for Python3.7 (#151)

Open henryzhangsta opened this issue 6 years ago • 17 comments

Fixes #151

henryzhangsta avatar Aug 29 '18 23:08 henryzhangsta

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 29 '18 23:08 CLAassistant

...can you, please, merge? thanks!

rpodgorny avatar Sep 13 '18 20:09 rpodgorny

I get an unending spew of

Unexpected ptrace(2) exception: waitpid() indicated a WIFSTOPPED process, but got unexpected signal 11

with this branch.

tavianator avatar Oct 24 '18 19:10 tavianator

@tavianator What kernel/distribution are you using?

henryzhangsta avatar Oct 26 '18 21:10 henryzhangsta

Arch Linux, kernel 4.18.14-arch1-1-ARCH

tavianator avatar Oct 31 '18 16:10 tavianator

@tavianator Can you verify that SELinux is not denying the ptrace call?

henryzhangsta avatar Oct 31 '18 20:10 henryzhangsta

@henryzhangsta No SELinux here. The relevant part of strace is:

ptrace(PTRACE_POKEDATA, 27855, 0x7fb56897e000, 0xccd0ff) = 0
ptrace(PTRACE_GETREGS, 27855, NULL, 0x7ffd34d418f0) = 0
ptrace(PTRACE_SETREGS, 27855, NULL, 0x7ffd34d41730) = 0
ptrace(PTRACE_CONT, 27855, NULL, SIG_0) = 0
wait4(27855, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSEGV}], 0, NULL) = 27855

tavianator avatar Nov 01 '18 13:11 tavianator

I just used it on Arch Linux with kernel 4.19.8-arch1-1-ARCH and did not get any errors, maybe there was something fixed related to this bug.

ghost avatar Dec 11 '18 13:12 ghost

@metafex Hmm, maybe something I'm doing wrong then, still reproduces for me. What's your ./configure line, etc.?

tavianator avatar Dec 11 '18 14:12 tavianator

@tavianator I ran configure without any parameters, it perfectly detects python 3.7 for me. I attached pyflame to a uwsgi process in a container though, how are you running it?

ghost avatar Dec 11 '18 14:12 ghost

$ ./src/pyflame -t python3 -c 'import time; time.sleep(5); print("Hello world")'
Unexpected ptrace(2) exception: waitpid() indicated a WIFSTOPPED process, but got unexpected signal 11
Unexpected ptrace(2) exception: waitpid() indicated a WIFSTOPPED process, but got unexpected signal 11
Unexpected ptrace(2) exception: waitpid() indicated a WIFSTOPPED process, but got unexpected signal 11
...

The crash happens in the Python process when doing PtraceCallFunction(pid, addrs.tstate_get_addr);

tavianator avatar Dec 11 '18 15:12 tavianator

Turns out that this is fixed by https://github.com/uber/pyflame/pull/155, sorry for the noise!

tavianator avatar Dec 17 '18 15:12 tavianator

bump ;-)

rpodgorny avatar Jan 06 '19 00:01 rpodgorny

friendly ping - any reason why this is not merged yet? Having py37 support would be really helpful...

toabctl avatar Mar 26 '19 10:03 toabctl

The person that originally wrote pyflame no longer works at Uber. I have not been able to get an Uber open source contact, so if anyone knows of one, let me know.

henryzhangsta avatar Apr 16 '19 03:04 henryzhangsta

Hi, is anybody trying to build this with python 3.7 installed by pyenv? I cannot get how to pass path to Python3.7 for build pyflame. Can help me? UPDATE: should use env var: export PKG_CONFIG_PATH=~/.pyenv/versions/3.7.3/lib/pkgconfig/

hound672 avatar Aug 01 '19 08:08 hound672

@hound672 I think people have switched to https://github.com/benfred/py-spy these days

tavianator avatar Aug 01 '19 13:08 tavianator