Bug 51349 - [Profiler-Mac] Opening Preferences throws ArgumentNullException and crashes Xamarin Profiler.app
Summary: [Profiler-Mac] Opening Preferences throws ArgumentNullException and crashes X...
Status: VERIFIED FIXED
Alias: None
Product: Profiler
Classification: Xamarin
Component: Mac ()
Version: 1.0.x
Hardware: Macintosh Mac OS
: High normal
Target Milestone: (C9)
Assignee: Jose Medrano
URL:
Depends on:
Blocks:
 
Reported: 2017-01-10 18:41 UTC by Colby Williams
Modified: 2017-02-01 17:00 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 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.

Related Links:
Status:
VERIFIED FIXED

Description Colby Williams 2017-01-10 18:41:43 UTC
* Xamarin Profiler version -  1.1.3.71
* Arch x86_64
* macOS Sierra version 10.12.2
* Visual Studio for Mac version 7.0.0.560
* Xamarin Studio version 6.2.0.1358 
* details - https://gist.github.com/colbylwilliams/da04af1af038ca562c59f14b4ab62cd6

--

Background:

My mac had version 1.1.1.40 of the Xamarin Profiler.app installed (and likely several versions before that).  The app's Preferences window opened fine.

I updated to version 1.1.3.71 and attempting to open the app's Preferences (with mouse or ⌘ + ,), the Profiler displays an alert dialog titled "An error has occurred", with the message "Value cannot be null."  Upon closing the alert, the app crashes.

The log at `~/Library/Logs/Xamarin.Profiler` reports a System.ArgumentNullException (stack trace is copy/pasted below).

Finally, I've tried uninstalling (deleting) Xamarin Profiler.app, and reinstalling several times (as well as deleting the app's preferences and saved state .plist files) but the error continues to occur on the fresh installs.


```
XamarinProfiler.Core.Profiler Critical: 0 : [2017-01-09 16:48:12.7491] uncaught exception
System.ArgumentNullException: Value cannot be null.
Parameter name: value
  at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
  at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/3508/cbea5f86/source/xamarin-macios/src/AppKit/NSApplication.cs:94 
  at XamarinProfiler.Mac.MainClass.Main (System.String[] args) [0x00039] in /Users/builder/data/lanes/3894/b68ce0f3/source/profiler/src/XamarinProfiler.Mac/Main.cs:34 
XamarinProfiler.Core.Profiler Critical: 0 : [2017-01-09 16:48:12.7491] uncaught exception
System.ArgumentNullException: Value cannot be null.
Parameter name: value
  at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
  at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/3508/cbea5f86/source/xamarin-macios/src/AppKit/NSApplication.cs:94 
  at XamarinProfiler.Mac.MainClass.Main (System.String[] args) [0x00039] in /Users/builder/data/lanes/3894/b68ce0f3/source/profiler/src/XamarinProfiler.Mac/Main.cs:34 
```
Comment 1 Rodrigo Moya 2017-01-13 14:15:42 UTC
This is probably the new App Arguments config setting, which we try to read and set to a NSTextField without a proper null checking
Comment 2 xamarin-release-manager 2017-01-17 08:05:24 UTC
Fixed in version 1.1.99.246 (master)

Author: Jose?? Medrano
Commit: 27fa04d01e7f35595e8aef3defee26a9e51352ac (xamarin/profiler)
Comment 4 Mohit Kheterpal 2017-02-01 17:00:18 UTC
I have checked this issue and able to reproduce this issue using command given by Rodrigo i.e. "defaults delete ~/Library/Preferences/Xamarin.Profiler.plist ExecutableArguments"

However, I am also observed that this issue has been fixed with C9 build of profiler i.e. profiler-mac-1.1.8-44_b6ae30298f1545049f9b4aa4c70779f5d831c346

Hence closing this issue by marking it as Verified.

thanks