
SIGSEGV creating OpenGL 4.0 context
Posted Sunday, 27 June, 2010 - 09:06 by golkeeper inHi all,
Have problem creating 4.0 context, it looks as:
Stacktrace: at (wrapper managed-to-native) object.wrapper_native_0x7fdbcdecff00 (intptr,intptr,intptr,bool,int*) <0x00067> at (wrapper managed-to-native) object.wrapper_native_0x7fdbcdecff00 (intptr,intptr,intptr,bool,int*) <0xffffffff> at (wrapper delegate-invoke) OpenTK.Platform.X11.Glx/Delegates/CreateContextAttribsARB.invoke_intptr__this___intptr_intptr_intptr_bool_int* (intptr,intptr,intptr,bool,int*) <0xffffffff> at OpenTK.Platform.X11.Glx/Arb.CreateContextAttribs (intptr,intptr,intptr,bool,int[]) <0x0007d> at OpenTK.Platform.X11.X11GLContext..ctor (OpenTK.Graphics.GraphicsMode,OpenTK.Platform.IWindowInfo,OpenTK.Graphics.IGraphicsContext,bool,int,int,OpenTK.Graphics.GraphicsContextFlags) <0x005a7> at OpenTK.Platform.X11.X11Factory.CreateGLContext (OpenTK.Graphics.GraphicsMode,OpenTK.Platform.IWindowInfo,OpenTK.Graphics.IGraphicsContext,bool,int,int,OpenTK.Graphics.GraphicsContextFlags) <0x00053> at OpenTK.Graphics.GraphicsContext..ctor (OpenTK.Graphics.GraphicsMode,OpenTK.Platform.IWindowInfo,int,int,OpenTK.Graphics.GraphicsContextFlags) <0x001be> at OpenTK.GameWindow..ctor (int,int,OpenTK.Graphics.GraphicsMode,string,OpenTK.GameWindowFlags,OpenTK.DisplayDevice,int,int,OpenTK.Graphics.GraphicsContextFlags,OpenTK.Graphics.IGraphicsContext) <0x0025f> at OpenTK.GameWindow..ctor (int,int,OpenTK.Graphics.GraphicsMode,string,OpenTK.GameWindowFlags,OpenTK.DisplayDevice,int,int,OpenTK.Graphics.GraphicsContextFlags) <0x00057> at OpenGL4.App.Main () [0x00000] in /media/Data/PROJECTS/MonoOpenTKTest/MonoOpenTKTest/MainWindow.cs:10 at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff> Native stacktrace: /usr/bin/mono() [0x47b77f] /usr/bin/mono() [0x4aef3f] /lib/libpthread.so.0(+0xf8f0) [0x7fdbd0de38f0] /usr/lib/fglrx/dri/fglrx_dri.so(+0xc6e037) [0x7fdbcce1a037] /usr/lib/fglrx/dri/fglrx_dri.so(+0xc77ada) [0x7fdbcce23ada] /usr/lib/fglrx/dri/fglrx_dri.so(+0xc85820) [0x7fdbcce31820] /usr/lib/fglrx/dri/fglrx_dri.so(+0xc8a935) [0x7fdbcce36935] /usr/lib/fglrx/dri/fglrx_dri.so(+0x15f02e5) [0x7fdbcd79c2e5] /usr/lib/fglrx/dri/fglrx_dri.so(+0x15ea790) [0x7fdbcd796790] /usr/lib/fglrx/dri/fglrx_dri.so(driCreateContextAttribs+0x10) [0x7fdbcd796af0] /usr/lib/fglrx/libGL.so.1(+0x3574b) [0x7fdbcdecf74b] /usr/lib/fglrx/libGL.so.1(glXCreateContextAttribsARB+0xc2) [0x7fdbcdecffc2] [0x41aa5797] Debug info from gdb: [Thread debugging using libthread_db enabled] [New Thread 0x7fdbcf684710 (LWP 2140)] [New Thread 0x7fdbd190a710 (LWP 2139)] 0x00007fdbd0de293d in read () from /lib/libpthread.so.0 3 Thread 0x7fdbd190a710 (LWP 2139) 0x00007fdbd0de311d in nanosleep () from /lib/libpthread.so.0 2 Thread 0x7fdbcf684710 (LWP 2140) 0x00007fdbd0de1b50 in sem_wait () from /lib/libpthread.so.0 * 1 Thread 0x7fdbd1aea740 (LWP 2136) 0x00007fdbd0de293d in read () from /lib/libpthread.so.0 Thread 3 (Thread 0x7fdbd190a710 (LWP 2139)): #0 0x00007fdbd0de311d in nanosleep () from /lib/libpthread.so.0 #1 0x0000000000556342 in ?? () #2 0x00007fdbd0dda9ca in start_thread () from /lib/libpthread.so.0 #3 0x00007fdbd08b56cd in clone () from /lib/libc.so.6 #4 0x0000000000000000 in ?? () Thread 2 (Thread 0x7fdbcf684710 (LWP 2140)): #0 0x00007fdbd0de1b50 in sem_wait () from /lib/libpthread.so.0 #1 0x00000000004e4aaa in ?? () #2 0x0000000000505035 in ?? () #3 0x0000000000570073 in ?? () #4 0x000000000058de21 in ?? () #5 0x00007fdbd0dda9ca in start_thread () from /lib/libpthread.so.0 #6 0x00007fdbd08b56cd in clone () from /lib/libc.so.6 #7 0x0000000000000000 in ?? () Thread 1 (Thread 0x7fdbd1aea740 (LWP 2136)): #0 0x00007fdbd0de293d in read () from /lib/libpthread.so.0 #1 0x000000000047b8f4 in ?? () #2 0x00000000004aef3f in ?? () #3 <signal handler called> #4 0x00007fdbcce1a037 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #5 0x00007fdbcce23ada in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #6 0x00007fdbcce31820 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #7 0x00007fdbcce36935 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #8 0x00007fdbcd79c2e5 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #9 0x00007fdbcd796790 in ?? () from /usr/lib/fglrx/dri/fglrx_dri.so #10 0x00007fdbcd796af0 in driCreateContextAttribs () from /usr/lib/fglrx/dri/fglrx_dri.so #11 0x00007fdbcdecf74b in ?? () from /usr/lib/fglrx/libGL.so.1 #12 0x00007fdbcdecffc2 in glXCreateContextAttribsARB () from /usr/lib/fglrx/libGL.so.1 #13 0x0000000041aa5797 in ?? () #14 0x00000000015015a0 in ?? () #15 0x0000000001890fe0 in ?? () #16 0x00007fdbcf6a4fc0 in ?? () #17 0x00007fffee53bde0 in ?? () #18 0x000000000165aa70 in ?? () #19 0x00007fdbcf6a3d20 in ?? () #20 0x00007fffee53bfc0 in ?? () #21 0x0000000001890fe0 in ?? () #22 0x0000000000000000 in ?? () ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. =================================================================
My code is:
using OpenTK; using OpenTK.Graphics; namespace OpenGL4 { public class App { public static void Main() { var wnd=new GameWindow(800, 600, new GraphicsMode( ), "OpenGL4", GameWindowFlags.Default,DisplayDevice.Default,4,0,OpenTK.Graphics.GraphicsContextFlags.Default); wnd.Run(); } } }
Same code with version 3.3 in constructor arguments works fine.
My system is:
Ubuntu 10.04 Catalist 10.6 drivers opentk-1.0-rc1 (and svn version so, both debug and release variants) Mono 2.6.3 (and 2.4 so) Radeon 5450 Phenom X3
fglrxinfo output is:
display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: ATI Radeon HD 5400 Series OpenGL version string: 4.0.9901 Compatibility Profile Context
Is this a driver bug? I do something wrong?
Thanks!
Update: this error doesn't depend on opentk and mono version
Update:
Following C program works good on my system:
#include "GL/glus.h" int main(int argc, char* argv[]) { glusPrepareContext(4, 0 , GLUS_FORWARD_COMPATIBLE_BIT); glusCreateWindow("Example Window", 800, 600, GLUS_FALSE); glusRun(); return 0; }


Comments
Re: SIGSEGV creating OpenGL 4.0 context
There is a similar issue reported here: http://www.opentk.com/node/1884#new
Can you please try compiling and running your project in release mode? (outside of monodevelop) Does it still crash?
Re: SIGSEGV creating OpenGL 4.0 context
Not sure I understand what do you mean saying
compiling and running your project in release mode ? (outside of monodevelop)
I try folowing commands
The result is same.
Re: SIGSEGV creating OpenGL 4.0 context
Thanks for testing. I'll update my drivers to 10.6 and try to reproduce.
Re: SIGSEGV creating OpenGL 4.0 context
Update:
Following C program works good on my system: