kebabskal's picture

Trouble debugging on OSX

Hello!

I'm having trouble debugging my OpenTk apps through MonoDevelop.

The application runs fine in Release mode but in Debug i get an exception (below).
The exception in thrown after I do Controls.Add(glControl); or if I use the GameWindow-class.

Have anyone encountered this before?

My system is a Macbook Pro i7 15" (GT330M) with OSX 10.6.3, Mono 2.6.4 and MonoDevelop 2.4.

A test is available here: http://zink-interactive.se/media/2011/opentk-debug-bug.zip

Thanks in advance!
/Hannes

Exception:

Exception: 
** (/Users/hannes/Projects/Revolutions2/Testing/bin/Debug/Testing.exe:51465): WARNING **: mono_class_from_mono_type: implement me 0x8b
 
**
ERROR:class.c:5408:mono_class_from_mono_type: code should not be reached
Stacktrace:
 
  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal (intptr,System.Type) <0x00004>
  at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal (intptr,System.Type) <0x00004>
  at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer (intptr,System.Type) <IL 0x00063, 0x0016e>
  at OpenTK.BindingsBase.GetExtensionDelegate (string,System.Type) <IL 0x00035, 0x00133>
  at OpenTK.BindingsBase.LoadDelegate (string,System.Type) <IL 0x00003, 0x00032>
  at OpenTK.BindingsBase.LoadEntryPoints () <IL 0x0004b, 0x001f5>
  at OpenTK.Platform.DesktopGraphicsContext.LoadAll () <IL 0x00005, 0x00048>
  at OpenTK.Graphics.GraphicsContext.LoadAll () <IL 0x00014, 0x0007e>
  at OpenTK.GLControl.OnHandleCreated (System.EventArgs) <IL 0x00093, 0x002d4>
  at System.Windows.Forms.Control.WmCreate (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5757
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) [0x001e3] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5394
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:807
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) [0x0003c] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs:711
  at System.Windows.Forms.UserControl.WndProc (System.Windows.Forms.Message&) [0x00036] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UserControl.cs:150
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:234
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:215
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x00085] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:242
  at System.Windows.Forms.XplatUICarbon.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1704
  at System.Windows.Forms.XplatUICarbon.CreateWindow (System.Windows.Forms.CreateParams) [0x004d1] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1039
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:504
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) [0x0000c] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:167
  at System.Windows.Forms.Control.CreateHandle () [0x0003a] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4501
  at System.Windows.Forms.Control.CreateControl () [0x0004b] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3784
  at System.Windows.Forms.Control.ChangeParent (System.Windows.Forms.Control) [0x00150] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:1929
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.ChangeParent (System.Windows.Forms.Control) <IL 0x00033, 0x000ba>
  at System.Windows.Forms.Control/ControlCollection.Add (System.Windows.Forms.Control) [0x00178] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:550
  at Testing.TestingForm.OnLoad (System.EventArgs) [0x0000b] in /Users/hannes/Projects/Revolutions2/Testing/TestForm.cs:24
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs) [0x00029] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2988
  at System.Windows.Forms.Form.OnCreateControl () [0x00027] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2105
  at System.Windows.Forms.Control.CreateControl () [0x000a3] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3804
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&) [0x0003b] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5811
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) [0x001db] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5389
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs:807
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) [0x0003c] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs:711
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) [0x00165] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2613
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:234
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:215
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x00085] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:242
  at System.Windows.Forms.XplatUICarbon.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1704
  at System.Windows.Forms.XplatUICarbon.CreateWindow (System.Windows.Forms.CreateParams) [0x0055b] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1047
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:504
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) [0x0000c] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:167
  at System.Windows.Forms.Control.CreateHandle () [0x0003a] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4501
  at System.Windows.Forms.Form.CreateHandle () [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1991
  at System.Windows.Forms.Control.CreateControl () [0x0004b] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3784
  at System.Windows.Forms.Control.SetVisibleCore (bool) [0x00043] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5072
  at System.Windows.Forms.Form.SetVisibleCore (bool) [0x0007b] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:2461
  at System.Windows.Forms.Control.set_Visible (bool) [0x0000c] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:3436
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible (bool) <IL 0x00033, 0x000bb>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) [0x00059] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:864
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) [0x00014] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:763
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.6.4/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:742
  at Testing.TestingForm.Main () [0x00000] in /Users/hannes/Projects/Revolutions2/Testing/TestForm.cs:39
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <IL 0x0001b, 0x00087>
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 Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e, Boolean dequeuing) [0x00000] in <filename unknown>:0 
  at Mono.Debugging.Soft.SoftDebuggerSession.HandleEvent (Mono.Debugger.Soft.Event e) [0x00000] in <filename unknown>:0 
  at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler () [0x00000] in <filename unknown>:0

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This looks like a Mono bug.

Edit: looks like this bug, which is reported as fixed in 2.6.4. I'd suggest posting a bug report to Mono or making a post at mono-devel-list.

kebabskal's picture

Thanks Fiddler!

It looks like the same line of code, but the description of that bug doesn't resemble mine. (Mine only happens in debug mode etc)

I have reported the bug here: https://bugzilla.novell.com/show_bug.cgi?id=623796

Cya!
/Hannes

the Fiddler's picture

Thanks.

There's a new Mono release (2.6.7) that contains bugfixes to the debugger. Worth a try.