[Numpy-discussion] segmentation fault
Pauli Virtanen
pav at iki.fi
Wed May 28 11:27:54 EDT 2008
ke, 2008-05-28 kello 10:59 -0400, Scott Ransom kirjoitti:
> Hmmm. Interesting. I'm on a 64-bit Debian Unstable system with numpy
> 1.0.4 and python 2.5.2 and I don't get this:
>
> In [1]: import numpy as np
>
> In [2]: np.__version__
> Out[2]: '1.0.4'
>
> In [3]: def fn():
> ...: x = np.random.rand(5,2)
> ...: x.cumsum(None, out=x)
> ...: return x
> ...:
>
> In [4]: fn()
> Out[4]:
> array([[ 0.40329303, 0.45335328],
> [ 0.85664631, 0.84798294],
> [ 1.71329262, 0.05877989],
> [ 2.56127556, 0.99401291],
> [ 4.27456818, 0.79275409]])
>
> Wonder if the 64-bit thing could be the difference?
Try running fn() again to make the bug bomb out:
$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> imp
KeyboardInterrupt
>>> import numpy as np
>>> def fn():
... x = np.random.rand(5,2)
... x.cumsum(None, out=x)
... return x
...
>>> np.__version__
'1.0.5.dev5024'
>>> fn()
array([[ 0.59654253, 0.12577169],
[ 0.72231422, 0.30600244],
[ 1.44462843, 0.35849553],
[ 1.75063088, 0.56925858],
[ 3.19525931, 0.77487798]])
>>> fn()
*** glibc detected *** python: munmap_chunk(): invalid pointer:
0x08439d28 ***
--
Pauli Virtanen
More information about the NumPy-Discussion
mailing list