[Numpy-discussion] advanced indexing bug with huge arrays?

David Warde-Farley wardefar at iro.umontreal.ca
Mon Jan 23 05:23:28 EST 2012

A colleague has run into this weird behaviour with NumPy 1.6.1, EPD 7.1-2, on Linux (Fedora Core 14) 64-bit:

> a = numpy.array(numpy.random.randint(256,size=(5000000,972)),dtype='uint8')
> b = numpy.random.randint(5000000,size=(4993210,))
> c = a[b]

It seems c is not getting filled in full, namely:

> In [14]: c[1000000:].sum()
> Out[14]: 0

I haven't been able to reproduce this quite yet, I'll try to find a machine with sufficient memory tomorrow. But does anyone have any insight in the mean time? It smells like some kind of integer overflow bug.



More information about the NumPy-Discussion mailing list