[SciPy-User] Seg. fault from scipy.interpolate or numpy

James Turner jturner at gemini.edu
Thu Apr 7 12:00:35 EDT 2011


Sorry, I didn't see this right away. Thanks for the reply.

On 28/03/11 11:23, Bruce Southey wrote:
> [snip]
> [I did see the ticket comments and it doesn't crash for me on Linux
> and Python2.7.]
>
> Why do you use 'input' for as the variable name?
> This could be a problem because input is a builtin function. If the
> error goes away then it is most likely a Python bug.

Oh, I hadn't noticed that. That's unfortunate. Changing it doesn't
make any difference though.

> Second, is there a reason for using copy() for 'objfit' instead of one of these?
>      zeros_like : Return an array of zeros with shape and type of input.
>      ones_like : Return an array of ones with shape and type of input.
>      empty_like : Return an empty array with shape and type of input.
>      ones : Return a new array setting values to one.
>      empty : Return a new uninitialized array.

Not really. I was partly inheriting what someone else had done.
Thanks for the tip. Are these faster? I have changed it to zeros_like,
without affecting the segmentation fault.

> 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.



More information about the SciPy-User mailing list