memory corruption inside glutMainLoop()?

Go To


I'm having some trouble with VBO's with my project. note: The code worked perfectly before trying to use VBO's.

Here's the error:

Here's the gdb backtrace:

My glut+glew initialization code and some relevant code and data structures:

ps: A valgrind output is enormous because of fglrx code.

2012-04-04 16:52
by Victor
Alas, with memory corruption, cause and effect can be as far apart as Mercury and Pluto. I'd recommend going back through previous commits until the problem disappears. Then maybe update the question with the questionable code - Thomas 2012-04-04 17:24
Post a SSCCE that reproduces the problem - genpfault 2012-04-04 18:26
@Thomas I know, and the relevant code section is the new part. That's everything that changed from one commit to another. I can't remove just part of the new code, since it introduces a whole new way of rendering objects - Victor 2012-04-04 19:26
@genpfault I'm trying to create one, but none of the SSCCE I created so far reproduces the problem... = - Victor 2012-04-04 19:26


From what I can see within your code, you have enabled a vertex, normal, and texture coordinate array:


However, you only set a pointer to the vertex array:

glVertexPointer(3, GL_FLOAT, sizeof(GPoint), 0);

Whenever I do this, my programs crash as well. Try commenting out the normal and texture coordinate arrays and try it again.

2012-04-05 02:54
by Nyatra
So simple, yet so distant solution... Thank you very much. Btw, I had to change the order of the includes too! I had to include GL/glew.h as the first included file and comment out the unused arrays - Victor 2012-04-05 12:16