Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on OS X when running monoKickStarter #258

Closed
dellis1972 opened this issue May 10, 2015 · 3 comments
Closed

Crash on OS X when running monoKickStarter #258

dellis1972 opened this issue May 10, 2015 · 3 comments

Comments

@dellis1972
Copy link
Contributor

When running a sample OpenTK app under the monoKickStarter (https://github.com/OutOfOrder/MonoKickstart) project we get the following exception.

An exception was thrown by the type initializer for OpenTK.Platform.MacOS.NSApplication

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.DisplayDevice ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.Factory ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.MacOS.NSApplication ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.MacOS.Class ---> System.ArgumentException: Unknown class: NSAutoreleasePool
  at OpenTK.Platform.MacOS.Class.Get (System.String name) [0x00000] in <filename unknown>:0 
  at OpenTK.Platform.MacOS.Class..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  --- End of inner exception stack trace ---
  at OpenTK.Platform.MacOS.MacOSFactory..ctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenTK.DisplayDevice..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height) [0x00000] in <filename unknown>:0 
  at Simple.SimpleWindow..ctor () [0x00000] in <filename unknown>:0 
  at Simple.SimpleWindow.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.DisplayDevice ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.Factory ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.MacOS.NSApplication ---> System.TypeInitializationException: An exception was thrown by the type initializer for OpenTK.Platform.MacOS.Class ---> System.ArgumentException: Unknown class: NSAutoreleasePool
  at OpenTK.Platform.MacOS.Class.Get (System.String name) [0x00000] in <filename unknown>:0 
  at OpenTK.Platform.MacOS.Class..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  --- End of inner exception stack trace ---
  at OpenTK.Platform.MacOS.MacOSFactory..ctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenTK.DisplayDevice..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height) [0x00000] in <filename unknown>:0 
  at Simple.SimpleWindow..ctor () [0x00000] in <filename unknown>:0 
  at Simple.SimpleWindow.Main () [0x00000] in <filename unknown>:0 
@Frassle
Copy link
Contributor

Frassle commented May 11, 2015

Culprit is objc_getClass("NSAutoreleasepool") is returning NULL. http://stackoverflow.com/questions/11319170/c-as-principal-class-or-a-cocoa-app-without-objc suggests that there does need to be some special linking to get the foundation classes registered and initialized, so this looks like it might be a Kickstart issue.

@tomrijnbeek
Copy link

If I am correct, the current develop of MonoKickstart uses a pretty outdated version of Mono (2.*). There is currently a 3.12 branch that has an updated mono version, but it runs into a different problem for OSX (OutOfOrder/MonoKickstart#2), which also seems to be related to linking to certain foundation classes, so this might be a more general problem with using foundation classes in MonoKickstart applications.

@varon
Copy link
Member

varon commented Jun 11, 2017

Closing as this seems to be an an ancient upstream bug in a wierd configuration.

@varon varon closed this as completed Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants