Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-24 Thread Stefan Behnel
Vitja Makarov, 24.03.2011 19:15: 2011/3/24 Stefan Behnel: Vitja Makarov, 23.03.2011 20:11: 2011/3/23 Stefan Behnel: Vitja Makarov, 23.03.2011 17:25: File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl if 'pxd' in s.level: AttributeError: 'Pyr

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-24 Thread Vitja Makarov
2011/3/24 Stefan Behnel : > Vitja Makarov, 23.03.2011 20:11: >> >> 2011/3/23 Stefan Behnel: >>> >>> Vitja Makarov, 23.03.2011 17:25:   File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl     if 'pxd' in s.level: AttributeError: 'Pyrex

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread Stefan Behnel
Vitja Makarov, 23.03.2011 20:11: 2011/3/23 Stefan Behnel: Vitja Makarov, 23.03.2011 17:25: File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl if 'pxd' in s.level: AttributeError: 'PyrexScanner' object has no attribute 'level' Yes it does: """

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread Vitja Makarov
2011/3/23 Stefan Behnel : > Vitja Makarov, 23.03.2011 17:25: >> >>   File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", >> line 2307, in p_c_arg_decl >>     if 'pxd' in s.level: >> AttributeError: 'PyrexScanner' object has no attribute 'level' > > Yes it does: > > """ > # Cython/Plex/

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread Stefan Behnel
Vitja Makarov, 23.03.2011 17:25: def f(): return lambda x=0: x f()() Gives me this bogus code at function entry: Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; values[0] = ((PyObject *)0); // <<< !!! Looks like the default value is considered an

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread Stefan Behnel
Vitja Makarov, 23.03.2011 17:25: File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py", line 2307, in p_c_arg_decl if 'pxd' in s.level: AttributeError: 'PyrexScanner' object has no attribute 'level' Yes it does: """ # Cython/Plex/Scanners.pxd cdef class Scanner: [...]

Re: [Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread Vitja Makarov
2011/3/23 René Rex : > Hello > > The attached code creates a segfault with Cython 0.14.1. A workaround > is to use a real function instead of lambda. Using the normal python > interpreter the same code works flawlessly. > > Here are my build commands: > > cython --embed vectorizeBug.pyx > gcc -pthr

[Cython] Bug report: lambda and numpy.vectorize segfaults

2011-03-23 Thread René Rex
Hello The attached code creates a segfault with Cython 0.14.1. A workaround is to use a real function instead of lambda. Using the normal python interpreter the same code works flawlessly. Here are my build commands: cython --embed vectorizeBug.pyx gcc -pthread -fno-strict-aliasing -DNDEBUG -g -