This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Assertion failed (Yes, I've read the ALIGNMENT issue)

Tags: None
(comma "," separated)
thespiders
Registered Member
Posts
15
Karma
0
Hello, I use the STL container std::vector. I've read the alignment issue on http://eigen.tuxfamily.org/dox/Unaligne ... ssert.html. But it seems I don't understand...

When I do the second push_back, my application crashes.

in my app.h:
-------------------
#include
#include
USING_PART_OF_NAMESPACE_EIGEN
-------------------

in my app.cpp:
-------------------------
std::vector vec;
vec.push_back(Vector(0, 0, 0, 0));
vec.push_back(Vector(0, 0, 0, 0)); // instead of #include but it doesn't help. My compiler is "gcc version 3.4.5 (mingw special)"

I event tried to disable vectorization at all by defining
#define EIGEN_DONT_VECTORIZE
but it didn't help.

Last edited by thespiders on Fri May 22, 2009 3:10 pm, edited 1 time in total.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
What version of Eigen do you use? There are 3 very different StdVector headers: the one in 2.0.0, the one in 2.0.1 and 2.0.2, and finally the one in the development branch.

If you use the development branch (it has the best one) you have to specify explicitly Eigen::aligned_allocator. The online documentation only covers 2.0.2. For the devel branch see the files in the doc/ directory.

Last edited by bjacob on Fri May 22, 2009 3:09 pm, edited 1 time in total.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0
Sorry, I should have specified that: I downloaded and use the "stable" Eigen 2.0.1, not a "devel" version. Does it have the same StdVector headers as 2.0.1? Do you think an upgrade to 2.0.2 would help?
For now I use vector as a workaround but I assume stack objects would be faster.

Last edited by thespiders on Fri May 22, 2009 3:44 pm, edited 1 time in total.
User avatar
bjacob
Registered Member
Posts
658
Karma
3
thespiders wrote:Sorry, I should have specified that: I downloaded and use the "stable" Eigen 2.0.1, not a "devel" version. Does it have the same StdVector headers as 2.0.1? Do you think an upgrade to 2.0.2 would help?

Maybe, as there have been GCC3 fixes.
It's not clear to me why this isn't working for you. If you think this is an issue in Eigen, give us a self-contained test program that we can test with.
You may also want to open our test program test/stdvector.cpp (for the same eigen version) to see an example of usage.

For now I use vector as a workaround but I assume stack objects would be faster.

If you're dynamically creating the vectors4f's, then yes that's slow.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
thespiders
Registered Member
Posts
15
Karma
0
With Eigen 2.0.2 the problem seems to be solved!

I use #include and the program runs whereas it crashes (assertion failed) when I compile and run with Eigen 2.0.1. If you say the dox cover only 2.0.2, maybe you could add a note and recommend to update to the latest Eigen version. Thx for helping.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]