[Numpy-discussion] numpy.any segfaults for large object arrays

Stéfan van der Walt stefan at sun.ac.za
Mon Mar 24 20:46:35 EDT 2008


Hi Martin

Please file a bug on the trac page: http://projects.scipy.org/scipy/numpy

You may mark memory errors as blockers for the next release.
Confirmed under latest SVN.

Thanks
Stéfan

On Mon, Mar 24, 2008 at 2:05 PM, Martin Manns <mmanns at gmx.net> wrote:
> Hello,
>
>  I am encountering a problem (a bug?) with the numpy any function.
>  Since the python any function behaves in a slightly different way,
>  I would like to keep using numpy's.
>
>  Here is the problem:
>
>  $ python
>  Python 2.5.1 (r251:54863, Jan 26 2008, 01:34:00)
>  [GCC 4.1.2 (Gentoo 4.1.2)] on linux2
>  Type "help", "copyright", "credits" or "license" for more information.
>  >>> import numpy
>  >>> numpy.version.version
>  '1.0.4'
>  >>> numpy.version.release
>  True
>  >>> small_zero = [0] * 1000
>  >>> large_zero = [0] * 1000000
>  >>> small_none = [None] * 1000
>  >>> large_none = [None] * 1000000
>  >>> any(small_zero)
>  False
>  >>> any(large_zero)
>  False
>  >>> any(small_none)
>  False
>  >>> any(large_none)
>  False
>  >>> any(numpy.array(small_zero))
>  False
>  >>> any(numpy.array(large_zero))
>  False
>  >>> any(numpy.array(small_none))
>  False
>  >>> any(numpy.array(large_none))
>  False
>  >>> numpy.any(numpy.array(small_zero))
>  False
>  >>> numpy.any(numpy.array(large_zero))
>  False
>  >>> numpy.any(numpy.array(small_none))
>  False
>  >>> numpy.any(numpy.array(large_none))
>  Segmentation fault
>
>  The segfault occurs for other object arrays as well.
>  Any idea how to get around this?
>
>  Thanks in advance
>
>  Martin
>
>  P.S. I tried the bug tracker but my e-mail does not seem to show up.



More information about the NumPy-Discussion mailing list