[SciPy-User] Seg. fault from scipy.interpolate or numpy
James Turner
jturner at gemini.edu
Fri Apr 29 11:50:52 EDT 2011
>>> So can you determine exactly which line it crashes on (especially the
>>> value yc) and the shapes of the arrays?
>>
>> Yes, it crashes on the last line, beginning "noise=", not in the loop.
>>
>> Good question about yc; it's value is 127, which is correct, as the
>> test array has a shape of (128, 2048).
>>
>> I just tried splitting up the last line into separate operations and
>> the one that crashes is objfit.clip(min=0.0). If I replace the last
>> line with just that call, I still get the crash.
>>
>> I thought I'd try printing objfit.min() and max() just for fun and
>> those work without crashing, returning -185.079 and 711.543.
>>
>> Thanks,
>>
>> James.
> Good!
> I think that you should be using 'a_min' not 'min' an the argument to an ndarray:
> clip(...)
> a.clip(a_min, a_max, out=None)
Sorry for the slow reply again. I'm running NumPy 1.5.1 and when I
use a_min=0., I get an error that it's an invalid keyword argument,
but min=0 seems to work. That's odd! Anyway, I can give the minimum
as a positional argument and it makes no difference to the crash.
> Also you could try using np.clip(objfit, 0.0) as it should be the same
> as objfit.clip(0.0).
That doesn't work as it says 3 arguments are required -- but that
made me think to try adding a maximum to the clip method as well as
a minimum and voila, it doesn't crash! I don't want a maximum
though :-(. Does this make any sense to you? Maybe there is something
wrong with the way the function is wrapped (by the look if it) as a
method, but I can't see how it can be using an uninitialized maximum
value, as if my data were getting clipped to some random maximum it
should be obvious.
> But I am still curious is why it is crashing on your system. The ticket says
> Python 2.5 on a 64-bit Linux but your backtrace includes 'i686' which suggests
> that it is 32-bit. Can you be more specific of the versions of the software
> regarding 32 vs 64 bit?
I am running 32-bit binaries on a 64-bit machine (our server
installation supports a variety of machines).
Thanks,
James.
More information about the SciPy-User
mailing list