[SciPy-user] numpy.fastCopyAndTranspose Segfaults

Travis E. Oliphant oliphant@enthought....
Wed Apr 30 10:10:04 CDT 2008


Dave wrote:
> I tried posting to the numpy mailing list but it didn't seem to make it through
> so I'm re-posting in case it's of interest to the scipy community.
>
> As the subject says the below code will crash the Python interpreter. I'm
> running 32-bit Win XP on an x64 xeon cpu.
>
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>
> from datetime import datetime, timedelta
> from numpy import asarray, fastCopyAndTranspose
> import numpy
> numpy.__version__
> '1.0.5.dev5008'
> timestamps = [datetime(2007,1,1)]
> while timestamps[-1] < datetime(2007,12,31):
>     timestamps.append(timestamps[-1] + timedelta(1))
>
> x = [asarray(timestamps),asarray(range(len(timestamps)))]
> fastCopyAndTranspose(x)
>
>
>   
It looks like the segfault occurs in the printing of the result.    If 
you set y = fastCopyAndTranspose(x)  you don't get a segfault until you 
try to print it (actually __repr__ it).  

This should be filed as a ticket.


-Travis




More information about the SciPy-user mailing list