markohlebar / Import

Xcode extension for adding imports from anywhere in the code ☝️
MIT License
846 stars 40 forks source link

Crash when pressing Install Key Bindings #1

Closed Eddpt closed 7 years ago

Eddpt commented 7 years ago

I tried installing it on macOS 10.12 (16A323) with Xcode 8.0 (8A218a) and every time I pressed Install Key Bindings the Import.app was crashing.

For some reason, changing the order of the following steps fixed it for me:

I had to:

instead.

Any reason why this could be happening?

Other than that, this extension is awesome!

markohlebar commented 7 years ago

@eddpt thanks dude! Any chance for a crash report?

Eddpt commented 7 years ago

Sure!

Performing @selector(installKeyBindings:) from sender NSButton 0x6000001493d0

Import_Crash.txt

markohlebar commented 7 years ago

@Eddpt thanks for that! I'm having some issues symbolicating that though. Not sure if it's because I just changed the extension from .txt to .crash 😬 If you have the time I would appreciate if you could send me the original .crash file.

Eddpt commented 7 years ago

There you go

Import_2016-10-07-115413.zip

markohlebar commented 7 years ago

I'm getting this madness when I'm trying to symbolicate it

Symbolicating Import.crash ... 61721 characters read. Use of uninitialized value $sdkGuess in concatenation (.) or string at ./symbolicatecrash line 1355. SDK guess for tool search is '' otool path is '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool' atos path is '/Applications/Xcode.app/Contents/Developer/usr/bin/atos' symbols path is '/Applications/Xcode.app/Contents/Developer/usr/bin/symbols' size path is '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/size' Use of uninitialized value $model in concatenation (.) or string at ./symbolicatecrash line 1379. Hardware Model OS Version 10.12 Build 16A323 Unsupported crash log version: 12 at ./symbolicatecrash line 614.

I tried all that google offered and couldn't make it symoblicate the thing 😱

I'll try to repro the crash or make some sense of it, cheers!

markohlebar commented 7 years ago

Got something be following this gist https://gist.github.com/bmatcuk/c55a0dd4f8775a3a2c5a

markohlebar commented 7 years ago

Seems to crash here KeyBindingsInserter.insertVanillaPlist() -> () (in Import) (KeyBindingsInserter.swift:49)

Eddpt commented 7 years ago

Hmm, there's a lot of force unwrapping happening around those variables, as a general rule we should avoid it using guard and the likes.

However, are any of those files/variables at all related with something created upon enabling the plug-in? (System Preferences... -> Extensions -> All -> Enable Import)

markohlebar commented 7 years ago

Yeah that's some bad code over there :D Can you send me your ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings file?

Eddpt commented 7 years ago

I can, but it is no longer crashing, if I can replicate it we could look at the file. Do you still want it?

markohlebar commented 7 years ago

I'm guessing it crashes here let bindings = ((existingPlist[KeyBindings.Key.MenuKeyBindings] as! NSDictionary)[KeyBindings.Key.KeyBindings] as! NSMutableArray)

markohlebar commented 7 years ago

Yeah send it over pls :)

Eddpt commented 7 years ago

Default.idekeybindings.zip

markohlebar commented 7 years ago

Yeah it's the same as mine... I'm rewriting that mess with force unwrapping now, hopefully it fixes the situation. Cheers!