[Numpy-discussion] Segmentation fault with argsort

Christoph Gohlke cgohlke@uci....
Fri Dec 18 12:48:36 CST 2009


On 12/18/2009 9:46 AM, Keith Goodman wrote:
> I am using the numpy 1.3 binary from Ubuntu 9.10. Is this already
> known, fixed, reproducible?
>
>>> np.array(121).argsort(0).argsort(0)
> Segmentation fault
>
> The expected result:
>
> AttributeError: 'np.int64' object has no attribute 'argsort'


On Windows 7 with Python 2.6.4 and numpy 1.4 built with vc2008 from svn 
source: the 64-bit version works, the 32-bit version throws a SystemError:

C:\>python26-x64
Python 2.6.4 (r264:75708, Oct 26 2009, 07:36:50) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.4.0rc2.dev8016'
>>> numpy.array(121).argsort(0).argsort(0)
0

C:\>python26
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.4.0rc2.dev8016'
>>> numpy.array(121).argsort(0).argsort(0)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
SystemError: ..\Python\getargs.c:1413: bad argument to internal function


-- Christoph


More information about the NumPy-Discussion mailing list