[MonoDevelop] I can't debug any openGL program

Daniel Soto daniel.soto2k at gmail.com
Sat May 1 13:49:20 EDT 2010


Hi.

I'm not sure if this error must be reported here, or in Mono-list.

I try to debug an openGL application, using OpenTK or using Tao, in both
the debug fails and crashes.

Here I show when debugging using OpenTK.

This is the little app.

public static void Main (string[] args)
		{
			MainWindow mainWindow = new MainWindow(); 
            mainWindow.Title = "OpenTK Test !!!";
            mainWindow.Run();
		}

class MainWindow : GameWindow {
 
        protected override void OnLoad(EventArgs e) {
			int a;
			a=0;
            GL.ClearColor(Color.MidnightBlue);
        }
 
        protected override void OnRenderFrame(FrameEventArgs e) {
            GL.Clear(ClearBufferMask.ColorBufferBit |
ClearBufferMask.DepthBufferBit); 
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadIdentity();
 
            GL.Color3(Color.Red);
            GL.Begin(BeginMode.Triangles);						// Drawing Using
TrianGL.es
            GL.Vertex3(0.0f, 0.2f, 0.0f);				// Top
            GL.Vertex3(-0.2f, -0.2f, 0.0f);				// Bottom Left
            GL.Vertex3(0.2f, -0.2f, 0.0f);				// Bottom Right
            GL.End();
 
            SwapBuffers();
        }
    }

The debug crashes inmediatly, displaying the application trace attached.
However, if I run not debugging, I not set any breakpoing, or in release
mode, the app runs fine.

Here is the trace of application displayed in Monodevelop.

Any help? It's a bug?

Thanks in advance!

Daniel.
-------------- next part --------------
Loaded assembly: /home/daniel/Projects/OpenTKTest/bin/Debug/OpenTKTest.exe
Loaded assembly: /home/daniel/Projects/OpenTKTest/bin/Debug/OpenTK.dll [External]
Loaded assembly: /usr/local/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll [External]
Loaded assembly: /usr/local/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll [External]
Resolved pending breakpoint at 'Main.cs:9' to Void OpenTKTest.MainClass:Main ():0.
Resolved pending breakpoint at 'MainWindow.cs:13' to Void OpenTKTest.MainWindow:OnLoad ():0.
Stacktrace:


Native stacktrace:

	/usr/local/bin/mono() [0x80d4c04]
	/usr/local/bin/mono() [0x810ee8b]
	[0xb771a410]
	/usr/local/bin/mono() [0x80f58b3]
	/usr/local/bin/mono() [0x81da932]
	/usr/local/bin/mono() [0x8202dd9]
	/lib/tls/i686/cmov/libpthread.so.0(+0x596e) [0xb760a96e]
	/lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0xb7552a0e]

Debug info from gdb:

Mono support loaded.
[Thread debugging using libthread_db enabled]
[Nuevo Thread 0xb6212b70 (LWP 2630)]
[Nuevo Thread 0xb6313b70 (LWP 2629)]
[Nuevo Thread 0xb6703b70 (LWP 2628)]
[Nuevo Thread 0xb72e2b70 (LWP 2626)]
0xb771a422 in __kernel_vsyscall ()
  5 Thread 0xb72e2b70 (LWP 2626)  0xb771a422 in __kernel_vsyscall ()
  4 Thread 0xb6703b70 (LWP 2628)  0xb771a422 in __kernel_vsyscall ()
  3 Thread 0xb6313b70 (LWP 2629)  0xb771a422 in __kernel_vsyscall ()
  2 Thread 0xb6212b70 (LWP 2630)  0xb771a422 in __kernel_vsyscall ()
* 1 Thread 0xb74526f0 (LWP 2624)  0xb771a422 in __kernel_vsyscall ()

Hilo 5 (Thread 0xb72e2b70 (LWP 2626)):
#0  0xb771a422 in __kernel_vsyscall ()
#1  0xb760f015 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x0820313c in GC_wait_marker () at pthread_support.c:1785
#3  0x081fe1e4 in GC_help_marker (my_mark_no=2) at mark.c:1116
#4  0x08201fb2 in GC_mark_thread (id=0x0) at pthread_support.c:548
#5  0xb760a96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb7552a0e in clone () from /lib/tls/i686/cmov/libc.so.6

Hilo 4 (Thread 0xb6703b70 (LWP 2628)):
#0  0xb771a422 in __kernel_vsyscall ()
#1  0xb7612736 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x081ea948 in collection_thread (unused=0x0) at collection.c:34
#3  0xb760a96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb7552a0e in clone () from /lib/tls/i686/cmov/libc.so.6

Hilo 3 (Thread 0xb6313b70 (LWP 2629)):
#0  0xb771a422 in __kernel_vsyscall ()
#1  0xb7611245 in sem_wait@@GLIBC_2.1 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x08114790 in finalizer_thread (unused=0x0) at gc.c:1022
#3  0x0818ba8c in start_wrapper (data=0x90c35d0) at threads.c:661
#4  0x081da932 in thread_start_routine (args=0x90c68c4) at wthreads.c:286
#5  0x08202dd9 in GC_start_routine (arg=0x32ec0) at pthread_support.c:1390
#6  0xb760a96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb7552a0e in clone () from /lib/tls/i686/cmov/libc.so.6

Hilo 2 (Thread 0xb6212b70 (LWP 2630)):
#0  0xb771a422 in __kernel_vsyscall ()
#1  0xb7611f5b in read () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x080d4dd4 in read (signal=11, ctx=0xb610dd0c)
    at /usr/include/bits/unistd.h:45
#3  mono_handle_native_sigsegv (signal=11, ctx=0xb610dd0c)
    at mini-exceptions.c:1818
#4  0x0810ee8b in mono_arch_handle_altstack_exception (sigctx=0xb610dd0c, 
    fault_addr=0x182474b5, stack_ovf=0) at exceptions-x86.c:910
#5  <signal handler called>
#6  type_commands (command=1, p=0x92df32c " \304]\267@", 
    end=<value optimized out>, buf=0xb6212274) at debugger-agent.c:5096
#7  0x080f58b3 in debugger_thread (arg=0x0) at debugger-agent.c:6141
#8  0x081da932 in thread_start_routine (args=0x90c694c) at wthreads.c:286
#9  0x08202dd9 in GC_start_routine (arg=0x32ec0) at pthread_support.c:1390
#10 0xb760a96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7552a0e in clone () from /lib/tls/i686/cmov/libc.so.6

Hilo 1 (Thread 0xb74526f0 (LWP 2624)):
#0  0xb771a422 in __kernel_vsyscall ()
#1  0xb760f015 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x080f1ec9 in suspend_current () at debugger-agent.c:2198
#3  0x080f29cd in process_event (event=EVENT_KIND_TYPE_LOAD, 
    arg=<value optimized out>, il_offset=<value optimized out>, ctx=0x0, 
    events=0x9288ed8, suspend_policy=2) at debugger-agent.c:2692
#4  0x080f2c25 in process_profiler_event (event=EVENT_KIND_TYPE_LOAD, arg=
    0x18247489) at debugger-agent.c:2712
#5  0x080f2f26 in jit_end (prof=0x82c7f48, method=
    Traceback (most recent call last):
  File "/usr/local/bin/mono-gdb.py", line 150, in to_string
    class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
RuntimeError: No se puede acceder a la memoria en la dirección 0x182474b5
, jinfo=0x92d7864, result=0) at debugger-agent.c:2947
#6  0x08114f2a in mono_profiler_method_end_jit (method=
    Traceback (most recent call last):
  File "/usr/local/bin/mono-gdb.py", line 150, in to_string
    class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ())
RuntimeError: No se puede acceder a la memoria en la dirección 0x182474b5
, jinfo=0x92d7864, result=0) at profiler.c:326
#7  0x080631a4 in mono_jit_compile_method_inner (method=
    "System.Object:wrapper_native_0xb59b4070 ()", opt=<value optimized out>, 
    ex=<value optimized out>) at mini.c:4326
#8  mono_jit_compile_method_with_opt (method=
    "System.Object:wrapper_native_0xb59b4070 ()", opt=<value optimized out>, 
    ex=<value optimized out>) at mini.c:4378
#9  0x080634ee in mono_jit_compile_method (method=
    "System.Object:wrapper_native_0xb59b4070 ()") at mini.c:4403
#10 0x0816aa9c in mono_ftnptr_to_delegate (klass="SwapIntervalSGI", ftn=
    0xb59b4070) at marshal.c:508
#11 0xb5a36505 in ?? ()
#12 0xb5a36497 in ?? ()
#13 0xb5a36194 in ?? ()
#14 0xb5a35f73 in ?? ()
#15 0xb5a35a56 in ?? ()
#16 0xb5a3332f in ?? ()
#17 0xb5a32b77 in ?? ()
#18 0xb5a31f93 in ?? ()
#19 0xb6713943 in ?? ()
#20 0xb6713533 in ?? ()
#21 0xb6713492 in ?? ()
#22 0xb6704749 in ?? ()
#23 0xb67046bc in ?? ()
#24 0xb6704414 in ?? ()
#25 0xb6704529 in ?? ()
#26 0x080635d1 in mono_jit_runtime_invoke (method=
    "OpenTKTest.MainClass:Main ()", obj=0x0, params=0xbfab54dc, exc=0x0)
    at mini.c:4731
#27 0x081a5430 in mono_runtime_invoke (method="OpenTKTest.MainClass:Main ()", 
    obj=0x0, params=0xbfab54dc, exc=0x0) at object.c:2613
#28 0x081a8dde in mono_runtime_exec_main (method=
    "OpenTKTest.MainClass:Main ()", args=0x51f90, exc=0x0) at object.c:3579
#29 0x081aad82 in mono_runtime_run_main (method=
    "OpenTKTest.MainClass:Main ()", argc=1, argv=0xbfab5710, exc=0x0)
    at object.c:3353
#30 0x080b44f1 in main_thread_handler (argc=4, argv=0xbfab5704)
    at driver.c:999
#31 mono_main (argc=4, argv=0xbfab5704) at driver.c:1732
#32 0x0805b6a5 in main (argc=4, argv=0xbfab5704) at main.c:34

=================================================================
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.
=================================================================

Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
  at Mono.Debugger.Soft.Connection.SendReceive (CommandSet command_set, Int32 command, Mono.Debugger.Soft.PacketWriter packet) [0x00000] in <filename unknown>:0 
  at Mono.Debugger.Soft.Connection.Type_GetInfo (Int64 id) [0x00000] in <filename unknown>:0 
  at Mono.Debugger.Soft.TypeMirror.GetInfo () [0x00000] in <filename unknown>:0 
  at Mono.Debugger.Soft.TypeMirror.get_FullName () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Debugger.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e, Boolean dequeuing) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Debugger.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Debugger.Soft.SoftDebuggerSession.EventHandler () [0x00000] in <filename unknown>:0 



More information about the Monodevelop-list mailing list