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

Segfault because alignment

Tags: None
(comma "," separated)
User avatar
MasterMind
Registered Member
Posts
3
Karma
0
OS

Segfault because alignment

Sun May 09, 2010 8:46 am
Hi.

I'm using Eigen to develop my own graphics engine (http://code.google.com/p/ufb/), and have a problem. One of my test segfaults (without assertion error and it segfaults with the first call of glCreateProgram() function).

If I disable Eigen alignment (defining EIGEN_DONT_ALIGN) the test works.

Now I tried almost everything, and the thing still crashes (unless I add a qDebug() << "output" to a problematic class's method) and I am wondering if somebody knows for a direction to look into.

And also, I have a class Object, which has fixed-sized vector. This class Object is then subclassed (Camera, Light, ParticleEmitter) and I'm wondering if that could be the problem?

Best regards.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Segfault because alignment

Sun May 09, 2010 9:49 am
have you tried in "debug mode" ? i.e., without defining NDEBUG.

Anyway, you have to take special cares at your class Object, have a look at this page:

http://eigen.tuxfamily.org/dox/Unaligne ... ssert.html
User avatar
MasterMind
Registered Member
Posts
3
Karma
0
OS

Re: Segfault because alignment

Sun May 09, 2010 9:55 am
NDEBUG is not defined (if I define it, it doesn't crash :D ).

I've been looking at those special cases, and tried them out, but nothing worked.

I also included the QtAlignedMalloc, and it still doesn't work.
User avatar
MasterMind
Registered Member
Posts
3
Karma
0
OS

Re: Segfault because alignment

Sun May 09, 2010 10:01 am
This information might help:

Valgrind says this upon crash:

Code: Select all
==10602== Process terminating with default action of signal 11 (SIGSEGV)
==10602==  Access not within mapped region at address 0xD913D298
==10602==    at 0x5124357: ??? (in /usr/lib/opengl/ati/lib/libGL.so.1.2)
==10602==    by 0x81479E3: BGE::Driver::GL3::bind(BGE::Storage::ShaderProgram*) (gl3.cpp:273)


Also note, that one function call is missing (between bind and ??? ).


Bookmarks



Who is online

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