[SciPy-dev] f2py and ATLAS crashing bug

Pauli Virtanen pav+sp@iki...
Mon Nov 9 03:19:43 CST 2009


Sun, 08 Nov 2009 18:42:56 -0500, Anne Archibald wrote:
> I am still trying to fix the bug where non-aligned matrices can cause
> ATLAS to segfault, and I think I need to improve my understanding of
> f2py somewhat.
> First of all, I'll note that the bug appears in several routines (eig,
> svd, qr, rq, hessenberg, and schur that I have found so far) but only
> when the overwrite_a flag is passed in. So I tried to determine how
> overwrite_a is used in these routines, and I am puzzled. The python
> routines appear to pass it unmodified to the FORTRAN routines. The .pyf
> files mention it in the python call signatures, but nowhere else; from
> the f2py files it looks like it should be ignored. But clearly it has
> some effect, since it allows crashes.

You can probably get more insight by looking at what f2py generates from 
the .pyf files:


	capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);

So, overwrite_a seems to turn copying the array off. Now the question is 
then why intent(align8) doesn't help: looking at


it seems that it always forces a copy of misaligned arrays -- but taking 
a look with gdb could be useful to verify this... Maybe there's a bug?

(BTW, did you rm -rf build/ after adding the align8 directives -- there's 
so much autogeneration going on there that it might be possible that 
something is not updating correctly.)

Pauli Virtanen

More information about the Scipy-dev mailing list