Hello,
today I’ve updated my linux-kernel to version 2.6.10. Everything ran okay, but as I tried to compile and run my program (which is using shaders) I became a Segmentation Fault. I’ve debugged and backtraced the proggy with gdb but the Output of gdb seems a bit confusing to me:
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0804b914 in installShaders (Vertexx=0xc227794 "
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * a;
}
",
Fragment=0xc227fb4 "void main (void)
{
gl_FragColor = vec4(1.0,0.0,0.0, 1.0);
}
") at main.cpp:79
#2 0x0804bc3e in OpenShaderSource () at main.cpp:128
#3 0x0804e438 in initVideo () at main.cpp:877
#4 0x0804e4d1 in main (argc=1, argv=0xbffffcd4) at main.cpp:886
the code which is responsible for loading the shaders is:
</font><blockquote><font size=“1” face=“Verdana, Arial”>code:</font><hr /><pre style=“font-size:x-small; font-family: monospace;”> int installShaders(const GLcharARB *Vertex,
const GLcharARB *Fragment)
{
GLhandleARB Prog, VS, FS;
GLint vertCompiled, fragCompiled, linked;
VS = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
FS = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB(VS,1,&Vertex, NULL);
glShaderSourceARB(FS,1,&Fragment, NULL);
glCompileShaderARB(VS);
glGetObjectParameterivARB(VS, GL_OBJECT_COMPILE_STATUS_ARB, &vertCompiled);
glCompileShaderARB(FS);
glGetObjectParameterivARB(VS,GL_OBJECT_COMPILE_STATUS_ARB,&fragCompiled);
if(!vertCompiled