thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

memory corruption on argmax(-1, out=...) (Trac #2160) #5952

Open numpy-gitbot opened 12 years ago

numpy-gitbot commented 12 years ago

Original ticket http://projects.scipy.org/numpy/ticket/2160 on 2012-06-14 by trac user mattip, assigned to unknown.

Running this one liner crashes python with a glibc memory corruption

numpy.arange(15).reshape((5,3)).argmax(-1, out=numpy.ones((3,1), dtype=int))

on centos6 64 bit Python 2.6.6 (r266:84292, Dec 7 2011, 20:48:22) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2

numpy.version.version '2.0.0.dev-4fcb53e'

numpy-gitbot commented 12 years ago

trac user mattip wrote on 2012-06-14

It seems to be quite a corner case, preallocating the out arg prevents the crash.