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 startup: System.NotSupportedException: Specified method is not supported. #2769

Closed
cpcallen opened this issue May 25, 2019 · 8 comments
Labels
macOS Issues specific for macOS Support Issues that are support requests

Comments

@cpcallen
Copy link

Background

CKAN Version: 1.25.4

KSP Version: 1.7.0

Operating System: macOS High Sierra 10.13.6

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? Yes.

Problem

What steps did you take in CKAN?

Installed CKAN using homebrew. Installation succeeded, but running $ ckan encountered issue #2630, so I applied the suggested fix of installing the mono-mdk cask instead of the mono formula:

$ brew uninstall --ignore-dependencies mono
Uninstalling /usr/local/Cellar/mono/5.20.1.19... (3,824 files, 417MB)

$ brew cask install mono-mdk
[… SNIP …]
==> Satisfying dependencies
==> Downloading https://download.mono-project.com/archive/5.20.1/macos-10-universal/MonoFramework-MDK-5.20.1.19.macos10.xamarin.univ
######################################################################## 100.0%
[… SNIP …]
installer: The install was successful.
🍺  mono-mdk was successfully installed!

After restarting bash to pick up the new path for mono, I started ckan with no arguments.

What did you expect to happen?

Something useful, like a usage message.

What happened instead?

It promptly crashed:

$ ckan 
WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all
Setting up CKAN for the first time...
Creating /Users/cpcallen/Library/Application Support/Steam/SteamApps/common/Kerbal Space Program/CKAN
Scanning for installed mods...
System.NotSupportedException: Specified method is not supported.
  at System.Drawing.MacSupport.GetCGContextForView (System.IntPtr handle) [0x0001a] in <9b724d20ab5f4edb8ef04e1dfd7e70c6>:0 
  at System.Drawing.Graphics.FromHwnd (System.IntPtr hwnd) [0x00055] in <9b724d20ab5f4edb8ef04e1dfd7e70c6>:0 
  at System.Windows.Forms.Control.CreateGraphics () [0x00019] in <4e2b4a35de3c46448d5450fc4127b3cc>:0
[… SNIP …]
  at System.Activator.CreateInstance[T] () [0x00015] in <6e26a535bf76467f9082042847cb7d56>:0 
  at CKAN.ControlFactory.CreateControl[T] () [0x00017] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.Main.RecreateDialogs () [0x00022] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.Main..ctor (System.String[] cmdlineArgs, CKAN.KSPManager mgr, CKAN.GUIUser user, System.Boolean showConsole) [0x00288] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at (wrapper remoting-invoke-with-check) CKAN.Main..ctor(string[],CKAN.KSPManager,CKAN.GUIUser,bool)
  at CKAN.GUI.Main_ (System.String[] args, CKAN.KSPManager manager, System.Boolean showConsole) [0x0003b] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.CmdLine.MainClass.Gui (CKAN.KSPManager manager, CKAN.CmdLine.GuiOptions options, System.String[] args) [0x00008] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.CmdLine.MainClass.RunSimpleAction (CKAN.CmdLine.Options cmdline, CKAN.CmdLine.CommonOptions options, System.String[] args, CKAN.IUser user, CKAN.KSPManager manager) [0x002ab] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.CmdLine.MainClass.Execute (CKAN.KSPManager manager, CKAN.CmdLine.CommonOptions opts, System.String[] args) [0x00187] in <2c2371fb3f2949b2a6dfae930758e6ee>:0 
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x00091] in <2c2371fb3f2949b2a6dfae930758e6ee>:0  

Full crash dump output.

CKAN error codes (if applicable): Not sure. Dump output ends with "Abort trap: 6".

@DasSkelett DasSkelett added macOS Issues specific for macOS Bug Something is not working as intended labels May 25, 2019
@HebaruSan HebaruSan removed the Bug Something is not working as intended label May 25, 2019
@HebaruSan
Copy link
Member

Homebrew's mono doesn't work. Install the package from mono-project.com:

https://github.com/KSP-CKAN/CKAN/wiki/Installing-CKAN-on-OSX

@HebaruSan HebaruSan added the Support Issues that are support requests label May 25, 2019
@HebaruSan
Copy link
Member

Also the workaround that you referenced specifically stated "ckan is functional with ckan consoleui and other text-only commands". You tried to run the GUI.

@cpcallen
Copy link
Author

Also the workaround that you referenced specifically stated "ckan is functional with ckan consoleui and other text-only commands". You tried to run the GUI.

That is useful and non-obvious information—thanks!

@cpcallen
Copy link
Author

Please reopen.

I have removed the mono and mono-mdk homebrew packages, and installed the official package from mono-project.com, and more or less exactly the same crash occurs, so the problem does not relate to homebrew.

@HebaruSan
Copy link
Member

Oh right, just running "ckan" from the command line will run into #2272, the GUI can only run in 32-bit mode. Try:

mono --arch=32 ckan.exe

The .dmg download does that automatically.

@cpcallen
Copy link
Author

mono --arch=32 ckan.exe

That does indeed solve the problem. I wonder if it would be worth updating the script created by the ckan.rb Homebrew formula to more closely resemble the one provided in the .app bundle (and also remove the misleading reference to the non-existent ckan-app cask).

@DasSkelett
Copy link
Member

That does indeed solve the problem. I wonder if it would be worth updating the script created by the ckan.rb Homebrew formula to more closely resemble the one provided in the .app bundle (and also remove the misleading reference to the non-existent ckan-app cask).

I don't know the package update policy of Homebrew, but if you are going to create a PR, you could try to update the version of CKAN they distribute, especially because there were some bugs leading to crashes on macOS fixed since v1.25.4.

https://github.com/Homebrew/homebrew-core/blob/fd1ef471a25cb83041e710018f9ad9686fc50d97/Formula/ckan.rb#L4

CKAN v1.26.2 is the most recent version.

But again, I don't know how Homebrew works, so that might be nonsense.

@HebaruSan
Copy link
Member

As I understand it, the homebrew team welcomes (in fact depends on) changes from its users, so you might as well try.
The CKAN team has no involvement with that cask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Issues specific for macOS Support Issues that are support requests
Projects
None yet
Development

No branches or pull requests

3 participants