jacobisvd_7 unit test hits data-not-aligned assertion when EIGEN_DEFAULT_TO_ROW_MAJOR is defined
Submitted by Jitse Niesen
Assigned to Nobody
Link to original bugzilla bug (#222)
Version: 3.0
Operating system: Linux
Description
Created attachment 140
Minimal test example
On my computer (gcc 4.3, 32 bits) the jacobisvd_7 unit test fails on a data-not-aligned assertion if compiling the tests in Release mode with SSE2 enabled and EIGEN_DEFAULT_TO_ROW_MAJOR defined.
Side note: Probably not serious enough to delay RC1 for.
See http://eigen.tuxfamily.org/CDash/testDetails.php?test=266017&build=5472 for the precise message.
I did not yet have time to analyze it fully, but here are some results.
I boiled down the test to the attached minimal test example. Compile with -msse2 -O2 and run to trigger the failure. The #define EIGEN_STACK_ALLOCATION_LIMIT 0 is copied from the jacobisvd_7 test and necessary to trigger the bug. The size of 49 is the smallest size for which it goes wrong. The significance of the number is probably that it is one more than 48, the block size for the Householder.
I'll also attach a stack trace shortly. The assertion is triggered in Product.h:442 because actualDestPtr is not aligned. This pointer is defined in Product.h:434. At that point, dest.size() is 0, so ei_aligned_stack_new() calls alloca(). However, alloca(0) does not return an aligned pointer.
Attachment 140, "Minimal test example":
bep.cpp