Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have a Mac OS X application that lives as an icon menu in the Mac menu bar (a bit like Dropbox).
To indicate download activity, the app sometimes modifies:
- the text of the menu's first item
- the icon (to create a small animation with 5 frames)
The app works fine otherwise, but it always crashes after these reproducible steps:
1. Open the app's menu in the Mac OS X top bar
2. Move the mouse around on any item of the menu
3. After moving for a few seconds or minutes of moving around, the stack trace below appears in the console
4. If executed from Xamarin, the UI shows a spinning spinwheel and the app continues to execute until it tries to modify the menu's icon or first item text. If executed from install package without Xamarin, the whole app crashes immediately.
Thread started: #10
Thread finished: #10
at <unknown> <0xffffffff>
at (wrapper managed-to-native) MonoMac.AppKit.NSApplication.NSApplicationMain (int,string) <IL 0x0009d, 0xffffffff>
at MonoMac.AppKit.NSApplication.Main (string) <IL 0x00041, 0x00103>
at CmisSync.GUI.Run () [0x00007] in [Users/nico/src/CmisSyncMaster/CmisSync/Mac/GUI.cs:82
at CmisSync.Program.Main (string) [0x001ca] in [Users/nico/src/CmisSyncMaster/CmisSync/Program.cs:128
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Debug info from gdb:
Xamarin Studio 5.5.3 build 6
Mac OS X 10.9.5 and Mac OS X 10.10
In some cases, crashes like this can be caused by items going out of memory and then objective-c calling back into your code. You could find the item that you expect to be called on when clicked and force it to stay in memory by holding it in a static reference.
Could you provide a reproduction case for me to look at? There isn't enough here to go by.
The issue only happens if I modify the icon at a high frequency (every 200 milliseconds), like this:
myNSStatusItem.Image = <a small NSImage>;
myNSStatusItem.Image.Size = new SizeF(16, 16);
No freeze if I disable this.
All of my code is managed.
Since you are frequently modifying the NSImage, maybe you are hitting a bug in your application where something in getting garbaged collected.
Did adding a GC.Collect (2) change the behavior?
I'm going to need more information to help sort this out. Do you have an example that shows the behavior?
It has almost been two weeks. I'm going to close this bug as I don't have enough information to reproduce. Please reply with more information.