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

Compiler crash importing from libc in pxi #2024

Open
matham opened this Issue Nov 25, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@matham

matham commented Nov 25, 2017

Cython seems to be crashing on travis ubuntu for py2 and 3 using the latest version from pip with from libc.stdint cimport int64_t, uint64_t, int32_t, uint32_t, uint16_t, int16_t, uint8_t, int8_t, uintptr_t in this file https://github.com/matham/ffpyplayer/blob/master/ffpyplayer/includes/ffmpeg.pxi.

The error traceback is:

cythoning ffpyplayer/pic.pyx to ffpyplayer/pic.c

Error compiling Cython file:
------------------------------------------------------------
...

from libc.stdint cimport int64_t, uint64_t, int32_t, uint32_t, uint16_t,\
^
------------------------------------------------------------

ffpyplayer/includes/ffmpeg.pxi:2:0: Compiler crash in AnalyseDeclarationsTransform

File 'ModuleNode.py', line 122, in analyse_declarations: ModuleNode(pic.pxd:1:0,
    full_module_name = 'ffpyplayer.pic',
    is_pxd = True)
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(pic.pxd:1:0)
File 'Nodes.py', line 417, in analyse_declarations: StatListNode(ffmpeg.pxi:2:0)
File 'Nodes.py', line 7529, in analyse_declarations: FromCImportStatNode(ffmpeg.pxi:2:0,
    imported_names = [...]/9,
    module_name = u'libc.stdint')

Compiler crash traceback from this point on:
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Compiler/Nodes.py", line 7529, in analyse_declarations
    module_scope = env.find_module(self.module_name, self.pos, relative_level=self.relative_level)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Compiler/Symtab.py", line 1222, in find_module
    module_name, relative_to=relative_to, pos=pos, absolute_fallback=absolute_fallback)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 178, in find_module
    pxd_pathname = self.find_pxd_file(qualified_name, pos)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 239, in find_pxd_file
    pxd = self.search_include_directories(qualified_name, ".pxd", pos, sys_path=sys_path)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 280, in search_include_directories
    tuple(self.include_directories), qualified_name, suffix, pos, include, sys_path)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Utils.py", line 30, in wrapper
    res = cache[args] = f(*args)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/Cython/Utils.py", line 148, in search_include_directories
    path = os.path.join(dir, dotted_filename)
  File "/home/travis/virtualenv/python2.7.13/lib/python2.7/posixpath.py", line 70, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Nov 28, 2017

Contributor

Is there any chance you have a None in your sys.path ?

Contributor

scoder commented Nov 28, 2017

Is there any chance you have a None in your sys.path ?

matham added a commit to matham/ffpyplayer that referenced this issue Nov 29, 2017

@matham

This comment has been minimized.

Show comment
Hide comment
@matham

matham Nov 29, 2017

sys.path prints as ['', '/home/travis/build/matham/ffpyplayer', '/home/travis/virtualenv/python3.5.3/lib/python35.zip', '/home/travis/virtualenv/python3.5.3/lib/python3.5', '/home/travis/virtualenv/python3.5.3/lib/python3.5/plat-linux', '/home/travis/virtualenv/python3.5.3/lib/python3.5/lib-dynload', '/opt/python/3.5.3/lib/python3.5', '/opt/python/3.5.3/lib/python3.5/plat-linux', '/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages'].

matham commented Nov 29, 2017

sys.path prints as ['', '/home/travis/build/matham/ffpyplayer', '/home/travis/virtualenv/python3.5.3/lib/python35.zip', '/home/travis/virtualenv/python3.5.3/lib/python3.5', '/home/travis/virtualenv/python3.5.3/lib/python3.5/plat-linux', '/home/travis/virtualenv/python3.5.3/lib/python3.5/lib-dynload', '/opt/python/3.5.3/lib/python3.5', '/opt/python/3.5.3/lib/python3.5/plat-linux', '/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages'].

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Nov 30, 2017

Contributor

It looks like None values can occur in the include_dirs that you are building in your setup.py script, e.g. when certain environment variables are not passed.

Contributor

scoder commented Nov 30, 2017

It looks like None values can occur in the include_dirs that you are building in your setup.py script, e.g. when certain environment variables are not passed.

@matham

This comment has been minimized.

Show comment
Hide comment
@matham

matham Dec 5, 2017

Seems you're right and that there was a None there. But cython should probably catch that and raise a better error? Because from the error it wasn't clear that it's dealing with a None value.

matham commented Dec 5, 2017

Seems you're right and that there was a None there. But cython should probably catch that and raise a better error? Because from the error it wasn't clear that it's dealing with a None value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment