vmprof / vmprof-python

vmprof - a statistical program profiler
http://vmprof.com
Other
433 stars 54 forks source link

Broken on MacOS #223

Open pochtar opened 4 years ago

pochtar commented 4 years ago
$ pip3 install vmprof
Collecting vmprof
  Using cached vmprof-0.4.15.tar.gz (289 kB)
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof) (2.22.0)
Requirement already satisfied: six in ./Library/Python/3.7/lib/python/site-packages (from vmprof) (1.14.0)
Requirement already satisfied: pytz in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof) (2019.3)
Requirement already satisfied: colorama in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from vmprof) (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) (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) (1.25.7)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof) (2019.11.28)
Requirement already satisfied: idna<2.9,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests->vmprof) (2.8)
Building wheels for collected packages: vmprof
  Building wheel for vmprof (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/setup.py'"'"'; __file__='"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-wheel-9ge2pm68
       cwd: /private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/
  Complete output (63 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/vmshare
  copying vmshare/binary.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
  copying vmshare/service.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
  copying vmshare/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
  creating build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/show.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/upload.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/reader.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/cli.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/stats.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/profiler.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  copying vmprof/__main__.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
  creating build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/query.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/upload.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/constants.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/merge_point.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/parser.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/marks.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/objects.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/prettyprinter.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  copying jitlog/__main__.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
  running build_ext
  building '_vmprof' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  creating build/temp.macosx-10.9-x86_64-3.7/src
  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.7/include/python3.7m -c src/_vmprof.c -o build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  src/_vmprof.c:68:13: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      co_name = PyUnicode_AsUTF8(co->co_name);
              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/_vmprof.c:71:17: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      co_filename = PyUnicode_AsUTF8(co->co_filename);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2 warnings generated.
  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.7/include/python3.7m -c src/machine.c -o build/temp.macosx-10.9-x86_64-3.7/src/machine.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/compat.c -o build/temp.macosx-10.9-x86_64-3.7/src/compat.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/vmp_stack.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmp_stack.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/vmprof_common.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/vmprof_memory.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_memory.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/symboltable.c -o build/temp.macosx-10.9-x86_64-3.7/src/symboltable.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  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.7/include/python3.7m -c src/vmprof_unix.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_unix.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
  src/vmprof_unix.c:137:34: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
              if (state->thread_id == mythread_id) {
                  ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
  1 warning generated.
  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.7/include/python3.7m -c src/vmprof_mt.c -o build/temp.macosx-10.9-x86_64-3.7/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.7/src/_vmprof.o build/temp.macosx-10.9-x86_64-3.7/src/machine.o build/temp.macosx-10.9-x86_64-3.7/src/compat.o build/temp.macosx-10.9-x86_64-3.7/src/vmp_stack.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_memory.o build/temp.macosx-10.9-x86_64-3.7/src/symboltable.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_unix.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_mt.o -o build/lib.macosx-10.9-x86_64-3.7/_vmprof.cpython-37m-darwin.so
  duplicate symbol '__PyThreadState_Current' in:
      build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o
      build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o
  duplicate symbol '__PyThreadState_Current' in:
      build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o
      build/temp.macosx-10.9-x86_64-3.7/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: Failed building wheel for vmprof
  Running setup.py clean for vmprof
Failed to build vmprof
Installing collected packages: vmprof
    Running setup.py install for vmprof ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/setup.py'"'"'; __file__='"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/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 /private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-record-38cc9kwc/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/vmprof
         cwd: /private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/
    Complete output (63 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/vmshare
    copying vmshare/binary.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
    copying vmshare/service.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
    copying vmshare/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/vmshare
    creating build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/show.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/upload.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/reader.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/cli.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/stats.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/profiler.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    copying vmprof/__main__.py -> build/lib.macosx-10.9-x86_64-3.7/vmprof
    creating build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/query.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/upload.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/constants.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/merge_point.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/parser.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/marks.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/objects.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/prettyprinter.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    copying jitlog/__main__.py -> build/lib.macosx-10.9-x86_64-3.7/jitlog
    running build_ext
    building '_vmprof' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/src
    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.7/include/python3.7m -c src/_vmprof.c -o build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    src/_vmprof.c:68:13: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        co_name = PyUnicode_AsUTF8(co->co_name);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/_vmprof.c:71:17: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        co_filename = PyUnicode_AsUTF8(co->co_filename);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    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.7/include/python3.7m -c src/machine.c -o build/temp.macosx-10.9-x86_64-3.7/src/machine.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/compat.c -o build/temp.macosx-10.9-x86_64-3.7/src/compat.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/vmp_stack.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmp_stack.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/vmprof_common.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/vmprof_memory.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_memory.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/symboltable.c -o build/temp.macosx-10.9-x86_64-3.7/src/symboltable.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    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.7/include/python3.7m -c src/vmprof_unix.c -o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_unix.o -Wno-unused -DVMPROF_APPLE=1 -DVMPROF_UNIX=1 -g -O2 -I src/ -I src/libbacktrace
    src/vmprof_unix.c:137:34: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
                if (state->thread_id == mythread_id) {
                    ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
    1 warning generated.
    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.7/include/python3.7m -c src/vmprof_mt.c -o build/temp.macosx-10.9-x86_64-3.7/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.7/src/_vmprof.o build/temp.macosx-10.9-x86_64-3.7/src/machine.o build/temp.macosx-10.9-x86_64-3.7/src/compat.o build/temp.macosx-10.9-x86_64-3.7/src/vmp_stack.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_memory.o build/temp.macosx-10.9-x86_64-3.7/src/symboltable.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_unix.o build/temp.macosx-10.9-x86_64-3.7/src/vmprof_mt.o -o build/lib.macosx-10.9-x86_64-3.7/_vmprof.cpython-37m-darwin.so
    duplicate symbol '__PyThreadState_Current' in:
        build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o
        build/temp.macosx-10.9-x86_64-3.7/src/vmprof_common.o
    duplicate symbol '__PyThreadState_Current' in:
        build/temp.macosx-10.9-x86_64-3.7/src/_vmprof.o
        build/temp.macosx-10.9-x86_64-3.7/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.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/vmprof/setup.py'"'"'; __file__='"'"'/private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-install-2oor6aet/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 /private/var/folders/c9/2v1s2vfj26qfz74j1zff54vc0000gp/T/pip-record-38cc9kwc/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/vmprof Check the logs for full command output.
pochtar commented 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
MichaelKim0407 commented 4 years ago

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

mattip commented 4 years ago

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.

glyph commented 4 years ago

Still an issue on macOS:

ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G2021
glyph commented 4 years ago

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?

joshfactorial commented 3 years ago

I'm having a very similar problem on Ubuntu 20

/usr/bin/ld: build/temp.linux-x86_64-3.8/src/vmprof_common.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 /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 1

ERROR: 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.

joshfactorial commented 3 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

This worked for me as well on Ubuntu.

matzhaugen commented 3 years ago

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?

markp2 commented 3 years ago

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.
mattip commented 2 years ago

Moving to cibuildwheel #241 would make releasing a new version less painful. Help welcome.

mattip commented 8 months ago

We now have wheels for macos x86_64. We do not have wheels for arm64. Can you use the wheels?

glyph commented 8 months ago

@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? :)

mattip commented 8 months ago

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...

glyph commented 8 months ago

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.

mattip commented 8 months ago

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.

cfbolz commented 8 months ago

@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?

glyph commented 2 months ago

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.