[SciPy-dev] scipy errors

Anne Archibald peridot.faceted@gmail....
Wed Nov 4 21:39:21 CST 2009

2009/11/4 Charles R Harris <charlesr.harris@gmail.com>:
> I see the following test errors on ubuntu_x86_64 9.10
> ERROR: Check linalg works with non-aligned memory
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.6/nose/case.py", line 183, in runTest
>     self.test(*self.arg)
>   File
> "/usr/local/lib/python2.6/dist-packages/scipy/linalg/tests/test_decomp.py",
> line 1067, in test_aligned_mem
>     eig(z.T, overwrite_a=True)
>   File "/usr/local/lib/python2.6/dist-packages/scipy/linalg/decomp.py", line
> 158, in eig
>     geev, = get_lapack_funcs(('geev',),(a1,))
>   File "/usr/local/lib/python2.6/dist-packages/scipy/linalg/lapack.py", line
> 82, in get_lapack_funcs
>     raise ValueError("Non-aligned array cannot be passed to LAPACK without
> copying")
> ValueError: Non-aligned array cannot be passed to LAPACK without copying
> I suspect the last failure is an mpmath version problem, and maybe the
> second also. Is anyone else seeing the other error?

This error is related to ticket 794:
Under certain poorly-defined circumstances, passing non-aligned
matrices to ATLAS can cause a segfault. I've posted a support request
on the ATLAS tracker, hoping to find out whether it's supposed to be
able to deal with non-aligned matrices, and in the meantime I have
code to raise exceptions when non-aligned matrices are fed to LAPACK.

I don't know whether the bug occurs at all on 64-bit systems, and I
don't know whether it's the result of us abusing ATLAS or a bug in
ATLAS. If it's a bug in ATLAS, I don't know for sure what triggers it
- in particular, whether alignment actually solves the problem on all

One solution would be to annotate all relevant f2py LAPACK wrappers
with the new align8 keyword and hope that cures the problem (by
forcing a copy of all not-sufficiently-aligned arrays on all LAPACK

Another "solution" would be to simply remove the failing test and tell
people not to feed non-aligned matrices full of outrageous values into
ATLAS on pain of segfaults. (The bug was filed by someone who'd had a
segfault while working with an unpickled array, so it does bite some

A third option would be to raise ValueErrors any time non-aligned
matrices are supposed to be passed to LAPACK. (This is what happens
now, but the tests fail when this happens; if this were the permanent
decision I would of course fix the tests to expect exceptions.)

It might be possible, though I'm not sure how and it would be
complicated, to trigger all this working-around only when using ATLAS.

I'm not sure how best to deal with this. What do you think?


More information about the Scipy-dev mailing list