[Mono-osx] [MonoMac] Random casting related crashes

Mattiello Joseph mail at joemattiello.com
Wed Mar 9 11:58:20 EST 2011


Over the course of testing a new app written with a MonoMac GUI we've been experiencing sporadic crashes apparently related to invalid type casting. We haven't been able to pin point an exact source so I'm curious if others have experienced the same issue or have any thoughts.

This has been occurring over the course of a couple of months and we regularly update our libs Mono from binary releases and MonoMac from git.

Some examples:
	#1 & #2 are in event loops and get fired very frequently and only a handful of crashes have been reported, so the occurrences are somewhat rare but often enough to be of concern.

1)

              	NSEventMask mask = NSEventMask.AnyEvent;
                NSApplication app = NSApplication.SharedApplication;
    
                NSEvent evt = app.NextEvent(mask, NSDate.DistantPast, NSRunLoop.NSDefaultRunLoopMode, true);
   Exception Source:      MonoMac
   Exception Type:        System.InvalidCastException
   Exception Target Site: NSApplication.NextEvent
   Exception Message:     Cannot cast from source type to destination type.
   Exception Data:        none

   --[ Stack Trace ]------------
   MonoMac.AppKit.NSApplication.NextEvent(NSEventMask mask, NSDate expiration, String mode, Boolean deqFlag)

2)

  NSApplication.SharedApplication.NextEvent(NSEventMask.AnyEvent,
                                                                  NSDate.FromTimeIntervalSinceNow((double)wait / 1000.0),
                                                                  NSRunLoop.NSDefaultRunLoopMode,
                                                                  false);

   Exception Source:      MonoMac
   Exception Type:        System.InvalidCastException
   Exception Target Site: NSDate.FromTimeIntervalSinceNow
   Exception Message:     Cannot cast from source type to destination type.
   Exception Data:        none

   --[ Stack Trace ]------------
   MonoMac.Foundation.NSDate.FromTimeIntervalSinceNow(Double secs)

3)
       foreach (string path in NSWorkspace.SharedWorkspace.MountedLocalVolumePaths)

   Exception Source:      MonoMac
   Exception Type:        System.InvalidCastException
   Exception Target Site: NSWorkspace.get_NotificationCenter
   Exception Message:     Cannot cast from source type to destination type.
   Exception Data:        none

   --[ Stack Trace ]------------
   MonoMac.AppKit.NSWorkspace.get_NotificationCenter()

Thanks for any feedback
-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110309/bf780e49/attachment.html 


More information about the Mono-osx mailing list