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

Monobjc 6.0.2710.0 crashes on OS X versions prior to Mavericks #432

Open
lemonmojo opened this Issue Dec 15, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@lemonmojo

lemonmojo commented Dec 15, 2014

Since upgrading to Monobjc 6.0.2710.0 any Monobjc application crashes instantly upon launch when running on any OS X version prior to Mavericks.

Here's the console output from a new application created with the Xamarin Studio Monobjc Console App Template:

MonobjcPreMountainLionTest[265:707] -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0

Unhandled Exception:
Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
  at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
  at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in <filename unknown>:0 
  at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in <filename unknown>:0 
  at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
  at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
  at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in <filename unknown>:0 
  at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in <filename unknown>:0 
  at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

To me it looks like 3d42143 is the culprit. Since -[NSProcessInfo operatingSystemVersion] is only available since Yosemite it can't be used on older versions. Interestingly it works just fine on a fully patched Mavericks machine. But anything below that, exhibits the crash mentioned above. My guess is that one of the recent Mavericks patches brought support for the property but it probably won't be available on a vanilla installation.

@letiemble

This comment has been minimized.

Show comment
Hide comment
@letiemble

letiemble Jan 6, 2015

Member

Hi,

I have uploaded a new package that reverts the previous code for version
detection. My test environment has broken and I was too confident that the
method will be supported (I mis-read 10.10 and 10.0).

Let me know if you have other issues.

Laurent.

2014-12-15 17:02 GMT+01:00 Felix Deimel notifications@github.com:

Since upgrading to Monobjc 6.0.2710.0 any Monobjc application crashes
instantly upon launch when running on any OS X version prior to Mavericks.

Here's the console output from a new application created with the Xamarin
Studio Monobjc Console App Template:

MonobjcPreMountainLionTest[265:707] -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0

Unhandled Exception:
Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in :0
at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in :0
at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in :0
at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in :0
at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in :0

To me it looks like 3d42143
3d42143
is the culprit. Since -[NSProcessInfo operatingSystemVersion] is only
available since Yosemite it can't be used on older versions. Interestingly
it works just fine on a fully patched Mavericks machine. But anything below
that, exhibits the crash mentioned above. My guess is that one of the
recent Mavericks patches brought support for the property but it probably
won't be available on a vanilla installation.


Reply to this email directly or view it on GitHub
#432.

Member

letiemble commented Jan 6, 2015

Hi,

I have uploaded a new package that reverts the previous code for version
detection. My test environment has broken and I was too confident that the
method will be supported (I mis-read 10.10 and 10.0).

Let me know if you have other issues.

Laurent.

2014-12-15 17:02 GMT+01:00 Felix Deimel notifications@github.com:

Since upgrading to Monobjc 6.0.2710.0 any Monobjc application crashes
instantly upon launch when running on any OS X version prior to Mavericks.

Here's the console output from a new application created with the Xamarin
Studio Monobjc Console App Template:

MonobjcPreMountainLionTest[265:707] -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0

Unhandled Exception:
Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in :0
at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in :0
at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: Monobjc.ObjectiveCException: -[NSProcessInfo operatingSystemVersion]: unrecognized selector sent to instance 0x7b32f6e0
at (wrapper managed-to-native) Monobjc.ObjectiveCRuntime:BootstrapInternal (string)
at Monobjc.ObjectiveCRuntime.Bootstrap (System.String domainToken) [0x00000] in :0
at Monobjc.ObjectiveCRuntime.Initialize (System.String domainToken) [0x00000] in :0
at MonobjcPreMountainLionTest.Program.Main (System.String[] args) [0x00000] in :0

To me it looks like 3d42143
3d42143
is the culprit. Since -[NSProcessInfo operatingSystemVersion] is only
available since Yosemite it can't be used on older versions. Interestingly
it works just fine on a fully patched Mavericks machine. But anything below
that, exhibits the crash mentioned above. My guess is that one of the
recent Mavericks patches brought support for the property but it probably
won't be available on a vanilla installation.


Reply to this email directly or view it on GitHub
#432.

@lemonmojo

This comment has been minimized.

Show comment
Hide comment
@lemonmojo

lemonmojo Jan 7, 2015

@letiemble Cool, thx!
Will take me some time to test this because I'm currently using a modified Monobjc version compiled from source.
That's because I still have issues with this line:

throw new ObjectiveCException (String.Format (CultureInfo.CurrentCulture, Resources.NoClassAttributeFoundForType, type));

This causes exceptions like this one every now and then:

System.TypeInitializationException: An exception was thrown by the type initializer for remojoConnectionTypes.Web.PropertyPageWebMainController ---> Monobjc.ObjectiveCException: No ObjectiveCClass attribute found for type 'Monobjc.Class'
  at Monobjc.Class.GetAttributeName (System.Type type) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) Monobjc.Class:Get (string)
  at Monobjc.Class.Get (System.Type type) [0x00000] in <filename unknown>:0 
  at remojoConnectionTypes.Web.PropertyPageWebMainController..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at remojoConnectionTypes.Web.WebPropertyPages..ctor () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 

I have already looked over all of my projects and there's no class that should be exposed to the Objective-C runtime that doesn't have a ObjectiveCClass attribute.
What I did is replace the line with return "Class"; which seems to get rid of the issue.
I can't say for certain that it completely fixes the issue because it's a rather rare bug, but I haven't seen it ever since making the change.

lemonmojo commented Jan 7, 2015

@letiemble Cool, thx!
Will take me some time to test this because I'm currently using a modified Monobjc version compiled from source.
That's because I still have issues with this line:

throw new ObjectiveCException (String.Format (CultureInfo.CurrentCulture, Resources.NoClassAttributeFoundForType, type));

This causes exceptions like this one every now and then:

System.TypeInitializationException: An exception was thrown by the type initializer for remojoConnectionTypes.Web.PropertyPageWebMainController ---> Monobjc.ObjectiveCException: No ObjectiveCClass attribute found for type 'Monobjc.Class'
  at Monobjc.Class.GetAttributeName (System.Type type) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) Monobjc.Class:Get (string)
  at Monobjc.Class.Get (System.Type type) [0x00000] in <filename unknown>:0 
  at remojoConnectionTypes.Web.PropertyPageWebMainController..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at remojoConnectionTypes.Web.WebPropertyPages..ctor () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 

I have already looked over all of my projects and there's no class that should be exposed to the Objective-C runtime that doesn't have a ObjectiveCClass attribute.
What I did is replace the line with return "Class"; which seems to get rid of the issue.
I can't say for certain that it completely fixes the issue because it's a rather rare bug, but I haven't seen it ever since making the change.

@lemonmojo

This comment has been minimized.

Show comment
Hide comment
@lemonmojo

lemonmojo Jan 15, 2015

@letiemble Just tested 6.0.2744.0 (using your Mono 3.12.0 x64 package) and the NSProcessInfo bug is gone.

lemonmojo commented Jan 15, 2015

@letiemble Just tested 6.0.2744.0 (using your Mono 3.12.0 x64 package) and the NSProcessInfo bug is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment