You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With memprof 0.3.4, if the python2 version is built before the python3 version, cython doesn't rebuild getsize.c so the python3 extension is miscompiled and barfs when imported:
root@tesla:~/memprof-0.3.4# python setup.py build
running build
running build_py
copying memprof/mp_utils.py -> build/lib.linux-x86_64-2.7/memprof
running build_ext
cythoning memprof/getsize.pyx to memprof/getsize.c
building 'memprof.getsize' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/memprof
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c memprof/getsize.c -o build/temp.linux-x86_64-2.7/memprof/getsize.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format -security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/memprof/getsize.o -o build/lib.linux-x86_64-2.7/memprof/getsize.so
running build_scripts
root@tesla:~/memprof-0.3.4# python3 setup.py build
running build
running build_py
copying memprof/mp_utils.py -> build/lib.linux-x86_64-3.4/memprof
running build_ext
skipping 'memprof/getsize.c' Cython extension (up-to-date)
building 'memprof.getsize' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c memprof/getsize.c -o build/temp.linux-x86_64-3.4/memprof/getsize.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/memprof/getsize.o -o build/lib.linux-x86_64-3.4/memprof/getsize.cpython-34m.so
running build_scripts
root@tesla:~/memprof-0.3.4# python3
Python 3.4.3+ (default, Jul 28 2015, 13:17:50)
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import memprof
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/memprof-0.3.4/memprof/__init__.py", line 17, in <module>
from .memprof import *
File "/root/memprof-0.3.4/memprof/memprof.py", line 25, in <module>
from .getsize import getSize, isInteresting
File "memprof/getsize.pyx", line 2, in init memprof.getsize (memprof/getsize.c:1939)
import types
NameError: name 'file' is not defined
I think the problem is in "skipping 'memprof/getsize.c' Cython extension (up-to-date)". If I remove memprof/getsize.c, then the python3 extension builds fine and I can run it. This breaks the building of the package in Debian, which creates first the python2 version and then the python3 one.
With memprof 0.3.4, if the python2 version is built before the python3 version, cython doesn't rebuild
getsize.c
so the python3 extension is miscompiled and barfs when imported:I think the problem is in "skipping 'memprof/getsize.c' Cython extension (up-to-date)". If I remove
memprof/getsize.c
, then the python3 extension builds fine and I can run it. This breaks the building of the package in Debian, which creates first the python2 version and then the python3 one.I've asked this question in stack overflow (https://stackoverflow.com/questions/32296637/regenerate-cython-extension-with-distutils).
The text was updated successfully, but these errors were encountered: