New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Bug 490 - unalignedassert fails with gcc 4.7 32Bit
Summary: unalignedassert fails with gcc 4.7 32Bit
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.0
Hardware: x86 - 32-bit Linux
: Normal Unknown
Assignee: Nobody
Keywords: alignment, crash
Depends on:
Reported: 2012-07-10 16:47 UTC by andregaschler
Modified: 2014-11-03 00:41 UTC (History)
4 users (show)


Description andregaschler 2012-07-10 16:47:08 UTC
Hi all,

both the current development version and 3.0.6 
fail the unalignedassert test when compiled
with on Ubuntu 12.10 32Bit and Fedora 17 32Bit, 
where gcc 4.7 is default.

With the non-default gcc 4.6, the same test succeeds.

Important: I was let to this bug because our robotics software that includes eigen segfaults in the matrix destructor when being built with gcc 4.7. With gcc 3.6, it works fine.
So this is really a bug relevant to us, not just a failing unit test.

And it occurs both with stable 3.0.6 and development.

How to reproduce (Ubuntu 12.10 32 Bit)

cmake ..
make unalignedassert
./ unalignedassert
cat Testing/Temporary/LastTest.log 

says line 20: 30794 Aborted                 (core dumped) ./$1 > /dev/null 2> .runtest.log
 Test unalignedassert failed: 

Test unalignedassert() failed in /home/gaschler/packages/eigen/latest/eigen/test/unalignedassert.cpp (128)
    Eigen::should_raise_an_assert && "construct_at_boundary<Vector4f>(8)"
<end of output>
Test time =   0.14 sec
Test Failed.

Interesting, gcc 4.6 will succeed on the same platform:

sudo apt-get install g++-4.6 gcc-4.6 cpp-4.6
cmake ../eigen -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.6 -DCMAKE_C_COMPILER=/usr/bin/gcc-4.6 
make unalignedassert
./ unalignedassert

1/1 Test #15: unalignedassert ..................   Passed    0.01 sec

Your help is appreciated.
Comment 1 Gael Guennebaud 2012-07-10 16:51:14 UTC
We are aware of that issue, there is nothing serious for the end user. This is actually a gcc regression:
Comment 2 andregaschler 2012-07-10 17:30:18 UTC
BTW, on the platform Ubuntu 12.10 32Bit,
I got the following testing results:
For Eigen 3.0.6 all succeed except for these two:
The following tests FAILED:
	 15 - unalignedassert (Failed)
	339 - eigensolver_complex_4 (Failed)
Comment 3 Gael Guennebaud 2012-07-11 10:21:31 UTC
because of numerical precision issues, sometimes some tests fail while there is no issue at all. You can check by running eigensolver_complex_4 2 or 3 times:
$ cd build/test
$ ./eigensolver_complex_4

if it consistently fails, then there is an issue. If it fails once, please copy-paste here the associated seed so that we can reproduce.
Comment 4 Christoph Hertzberg 2014-11-03 00:41:54 UTC
Workaround had been committed some time ago:

Note You need to log in before you can comment on or make changes to this bug.