Sigsev during shader/program creation

68 views
Skip to first unread message

haukehil...@web.de

unread,
Apr 1, 2014, 12:22:16 PM4/1/14
to go...@googlegroups.com
I get s sigsev when trying to create a shader or program

SIGSEGV: segmentation violation
PC=0x0
signal arrived during cgo execution

runtime.cgocall(0x4003ec0, 0x45cfed8)
    /usr/local/go/src/pkg/runtime/cgocall.c:149 +0x11b fp=0x45cfec0
github.com/go-gl/gl._Cfunc_glCreateProgram(0x3f80000000000000)
[...]

Calls to set the clear color and clear the buffer, for eample, work. I have added the runtime.LockOSThread() to my program.

I am on OSX 10.9 using Go 1.2.1, glfw 3.0.4 and glew-1.10.0.

Any ideas what might be going wrong?

Thanks,
Hauke

Dmitri Shuralyov

unread,
Apr 1, 2014, 7:34:30 PM4/1/14
to go...@googlegroups.com
I have a few ideas of what could be wrong, but it'd be much easier if I could see the source code and try to confirm...

Are you forgetting to do gl.Init() or glew.Init()? Is glew even neccessary?
Are you not requesting a recent enough version of OpenGL context?

That error message basically means the gl.glCreateProgram function pointer is null (it wasn't set to a correct value due to some reason).

You can take a look at this working sample that indirectly uses gl.CreateProgram (via "github.com/Ysgard/GoGLutils" package) successfully for reference: https://gist.github.com/shurcooL/5816852

hawk

unread,
Apr 2, 2014, 3:47:04 PM4/2/14
to go...@googlegroups.com
Thanks! Yes, I forgot to call gl.Init(), wasn't aware of that method since that doesn't exist in "naked" OpenGL.

Now I am fighting with sigsevs, I guess due to goroutines switching threads. Everything works fine when I call everything from the main method (which has its goroutine locked), but I'd like to bundle graphics calls in a static library. But I'll try a little longer before I call for help.. :-)

Thanks again,
Hauke
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages