[SciPy-user] bug crash
Pearu Peterson
pearu at scipy.org
Thu Jun 17 06:40:57 EDT 2004
> On June 16, 2004 02:57 pm, eric jones wrote:
> > Pearu Peterson wrote:
> > >In [1]: from scipy import *
> > >In [6]: b=arange(100000000).astype('f')
> > >
> > >In [7]: b=b*1j
> > >Segmentation fault
> >
> > It would be nice if the failure wasn't so violent...
That seems to be Numeric issue rather than of scipy:
In [2]: from Numeric import *
In [3]: b=arange(100000000).astype('f')
In [4]: b=b*1j
Segmentation fault
libwadpy gives the following traceback:
SegFault: [ C stack trace ]
#8 0x0805a2ba in PyNumber_Multiply()
#7 0x0805bbbe in ?()
#6 0x4049d9a0 in ?()
#5 0x404a25ff in PyUFunc_GenericFunction()
#4 0x404a223e in setup_loop()
#3 0x404a1fa8 in setup_matrices()
#2 0x4049804a in PyArray_FromObject()
#1 0x40497f0f in array_fromobject()
#0 0x40497c3c in PyArray_Cast()
However the following works ok:
In [1]: from Numeric import *
In [2]: b=arange(100000000).astype('D')
In [3]: b=b*1j
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
/home/pearu/<console>
MemoryError: can't allocate memory for array
On Wed, 16 Jun 2004, David M. Cooke wrote:
> Yet another reason to switch to numarray...
>
> >>> import numarray
> >>> b = numarray.arange(100000000, type=numarray.Float64)
> >>> b = b*1j
..
> MemoryError
> >>>
That's not completely fair, also Numeric handles the above example well:
In [1]: from scipy import *
In [2]: b=arange(100000000,typecode='f')
In [3]: b=b*1j
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
/home/pearu/<console>
MemoryError: can't allocate memory for array
though I like numarray in respect that MemoryError is raised immidiately
while with Numeric `b=b*1j` the MemoryError is raised after few
minutes of computations.
Pearu
More information about the SciPy-User
mailing list