Open pochtar opened 4 years ago
P.S. the old version works fine,
$ pip3 install vmprof==0.4.9
Collecting vmprof==0.4.9
Downloading vmprof-0.4.9.tar.gz (289 kB)
|████████████████████████████████| 289 kB 55 kB/s
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (2.22.0)
Requirement already satisfied: six in /Users/max/Library/Python/3.7/lib/python/site-packages (from vmprof==0.4.9) (1.14.0)
Requirement already satisfied: pytz in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (2019.3)
Requirement already satisfied: colorama in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (0.4.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (1.25.7)
Requirement already satisfied: idna<2.9,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (2019.11.28)
Building wheels for collected packages: vmprof
Building wheel for vmprof (setup.py) ... done
Created wheel for vmprof: filename=vmprof-0.4.9-cp37-cp37m-macosx_10_9_x86_64.whl size=50386 sha256=3452b041a0d8b8ad1585328a63e9df7b496d7c2813eab2dbc41aa2ec909029e3
Stored in directory: /Users/max/Library/Caches/pip/wheels/56/0d/6e/4dc958c64b121831edda8f6a57810c3c33435ad83f7201d08d
Successfully built vmprof
Installing collected packages: vmprof
Successfully installed vmprof-0.4.9
Can confirm on Mac 10.14.6 with Python 3.8. Installing 0.4.9 works.
I don't know why this issue is still here after getting "fixed".. #160 #189
It is still open and occurring since the fix was not part of a release. The fix went in Aug 2019, the last release was in May.
Still an issue on macOS:
ProductName: Mac OS X
ProductVersion: 10.15.6
BuildVersion: 19G2021
It seems like this fails to build any source version, and the bug is that wheels aren't getting uploaded. Are there some build options one needs to set?
I'm having a very similar problem on Ubuntu 20
_PyThreadState_Current'; build/temp.linux-x86_64-3.8/src/_vmprof.o:/tmp/pip-install-mvuv1_s9/vmprof/src/vmprof_common.h:92: first defined here /usr/bin/ld: build/temp.linux-x86_64-3.8/src/vmprof_unix.o:/tmp/pip-install-mvuv1_s9/vmprof/src/vmprof_common.h:92: multiple definition of
_PyThreadState_Current'; build/temp.linux-x86_64-3.8/src/_vmprof.o:/tmp/pip-install-mvuv1_s9/vmprof/src/vmprof_common.h:92: first defined here
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1ERROR: Command errored out with exit status 1: /home/joshfactorial/Documents/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mvuv1_s9/vmprof/setup.py'"'"'; file='"'"'/tmp/pip-install-mvuv1_s9/vmprof/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-5zk9xeu7/install-record.txt --single-version-externally-managed --compile --install-headers /home/joshfactorial/Documents/venv/include/site/python3.8/vmprof Check the logs for full command output.
P.S. the old version works fine,
$ pip3 install vmprof==0.4.9 Collecting vmprof==0.4.9 Downloading vmprof-0.4.9.tar.gz (289 kB) |████████████████████████████████| 289 kB 55 kB/s Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (2.22.0) Requirement already satisfied: six in /Users/max/Library/Python/3.7/lib/python/site-packages (from vmprof==0.4.9) (1.14.0) Requirement already satisfied: pytz in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (2019.3) Requirement already satisfied: colorama in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof==0.4.9) (0.4.3) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (3.0.4) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (1.25.7) Requirement already satisfied: idna<2.9,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (2.8) Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof==0.4.9) (2019.11.28) Building wheels for collected packages: vmprof Building wheel for vmprof (setup.py) ... done Created wheel for vmprof: filename=vmprof-0.4.9-cp37-cp37m-macosx_10_9_x86_64.whl size=50386 sha256=3452b041a0d8b8ad1585328a63e9df7b496d7c2813eab2dbc41aa2ec909029e3 Stored in directory: /Users/max/Library/Caches/pip/wheels/56/0d/6e/4dc958c64b121831edda8f6a57810c3c33435ad83f7201d08d Successfully built vmprof Installing collected packages: vmprof Successfully installed vmprof-0.4.9
This worked for me as well on Ubuntu.
I'm also getting this duplicate symbol error with mac 10.15.7. Can we just upload the wheels for py3.7 and py3.8 on macOS as part of the release?
Same here on MacOs Catalina 10.15.7 with python 3.8 Install fails:
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/vmprof_mt.c -o build/temp.macosx-10.9-x86_64-3.8/src/vmprof_mt.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.8/src/_vmprof.o build/temp.macosx-10.9-x86_64-3.8/src/machine.o build/temp.macosx-10.9-x86_64-3.8/src/compat.o build/temp.macosx-10.9-x86_64-3.8/src/vmp_stack.o build/temp.macosx-10.9-x86_64-3.8/src/vmprof_common.o build/temp.macosx-10.9-x86_64-3.8/src/vmprof_memory.o build/temp.macosx-10.9-x86_64-3.8/src/symboltable.o build/temp.macosx-10.9-x86_64-3.8/src/vmprof_unix.o build/temp.macosx-10.9-x86_64-3.8/src/vmprof_mt.o -o build/lib.macosx-10.9-x86_64-3.8/_vmprof.cpython-38-darwin.so
duplicate symbol '__PyThreadState_Current' in:
build/temp.macosx-10.9-x86_64-3.8/src/_vmprof.o
build/temp.macosx-10.9-x86_64-3.8/src/vmprof_common.o
duplicate symbol '__PyThreadState_Current' in:
build/temp.macosx-10.9-x86_64-3.8/src/_vmprof.o
build/temp.macosx-10.9-x86_64-3.8/src/vmprof_unix.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-u4ykvrfd/vmprof_d371c90df7e947eabcf191353bf3f850/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-u4ykvrfd/vmprof_d371c90df7e947eabcf191353bf3f850/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-36d7nzl2/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/vmprof Check the logs for full command output.
Moving to cibuildwheel #241 would make releasing a new version less painful. Help welcome.
We now have wheels for macos x86_64. We do not have wheels for arm64. Can you use the wheels?
@mattip awesome. It has been forever and a day since I tried to use vmprof due to this issue, so, can you remind me how to do a quick test case? :)
I think this is supposed to work
python -m vmprof -o output.log <program.py> <program parameters>
then
vmprofshow output.log
There is a also a way to get the output into a flamegraph, @cfbolz might know better. I guess we should add that to the FAQ...
And, it works! Thanks so much for following up on this bug.
Generating the flamegraph is a bit annoying, since it involves cloning two repos (one python, one perl) but it did work without me having to install anything else.
Generating the flamegraph is a bit annoying, since it involves cloning two repos (one python, one perl)
What was the exact workflow? We should document it and maybe we can streamline it.
@glyph a student of mine has been working on an importer to the Firefox profiling web app: https://github.com/Cskorpion/vmprof-firefox-converter It's not super well documented, advertised and tested yet, but the basics (flamegraphs for example) work quite well. Maybe you could try it and let us know what you think?
Generating the flamegraph is a bit annoying, since it involves cloning two repos (one python, one perl)
What was the exact workflow? We should document it and maybe we can streamline it.
$ python -m vmprof -o output.log <program.py> <program parameters>
$ git clone https://github.com/methane/vmprof-flamegraph
$ python vmprof-flamegraph/vmprof-flamegraph.py output.log > fginput.txt
$ git clone https://github.com/brendangregg/FlameGraph
$ perl FlameGraph/flamegraph.pl fginput.txt > fg.svg
then open fg.svg
in your viewer of choice.