[Numpy-discussion] numpy core dump on linux

Charles R Harris charlesr.harris@gmail....
Wed Sep 2 18:29:31 CDT 2009


On Wed, Sep 2, 2009 at 5:19 PM, Citi, Luca <lciti@essex.ac.uk> wrote:

> I experience the same problem.
> A few more additional test cases:
>
> In [1]: import numpy
>
> In [2]: numpy.lexsort([numpy.arange(5)[::-1].copy(), numpy.arange(5)])
> Out[2]: array([0, 1, 2, 3, 4])
>
> In [3]: numpy.lexsort([numpy.arange(5)[::-1].copy(), numpy.arange(5.)])
> Out[3]: array([0, 1, 2, 3, 4])
>
> In [4]: numpy.lexsort([numpy.arange(5), numpy.arange(5)])
> Out[4]: array([0, 1, 2, 3, 4])
>
> In [5]: numpy.lexsort([numpy.arange(5), numpy.arange(5.)])
> Out[5]: array([0, 1, 2, 3, 4])
>
> In [6]: numpy.lexsort([numpy.arange(5)[::-1], numpy.arange(5)])
> Out[6]: array([0, 1, 2, 3, 4])
>
> In [7]: numpy.lexsort([numpy.arange(5)[::-1], numpy.arange(5.)])
> *** glibc detected *** /usr/bin/python: free(): invalid next size (fast):
> 0x09be6eb8 ***
>
> It looks like the problem is when the first array is reversed and the
> second is float.
>

It's mixing types with different bit sizes, small type first.

In [6]: a = np.array([1.0]*100, dtype=int16)

In [7]: b = np.array([1.0]*100, dtype=int32)

In [8]: lexsort((a[::-1],b))

*Crash*

Probably the results are incorrect for the reverse order of types that
doesn't crash, but different arrays would be needed to check that.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090902/6c64c3c9/attachment.html 


More information about the NumPy-Discussion mailing list