[ruby-opengl-devel] Crash in glGetShaderInfoLog -- SOLVED

Ronald Pijnacker pijnacker at dse.nl
Thu Apr 19 15:16:00 EDT 2007


> On Tuesday 10 April 2007 09:45, you wrote:
> > I tried running with your patch applied. This time it did not crash
> > anymore, but it hung the process.
> > Running in the debugger led to strange results: while stepping through
> > the xfree function, I ended up in rb_str_new.
> >
> > Since this smells like memory gone bad, I ran it though purify. This
> > warns about beyond stack write problems, but I really do not understand
> > why. I've attached a purify screenshot that shows the problem.
> >
> > Possibly there is something corrupted in the ruby-runtime, which
> > triggers these strange problems. However, I have no clue where to look.
> 
> The problem with stack corruption is it is very hard to find where exactly it 
> happens as it is usually caught much later in execution by malloc/free. It 
> may be in the ruby runtime, it may be in the fox library, it may be in our 
> bindings, but it may also be in the underlying opengl implementation 
> (drivers). I've tried to trace it on linux with valgrind, but there seems to 
> be no problem, so i'll try it tommorrow on windows installation to see if 
> thats any different. Can you try to write/run the same code without the fox 
> library (only with glut) to eliminate one of the possibilities ? Thanks.

Found!
The problem had to do with calling conventions. When I tried to isolate
the crash in a small c-program, the same thing happened. Adding APIENTRY
to the function-pointer declaration fixed the problem.

Should I send in a patch for this, or will someone else pick this up?

Regards,

	Ronald.


More information about the ruby-opengl-devel mailing list