vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.35k stars 3.52k forks source link

startup error: "Assertion failure in -[_NSCGSWindow setFrame:]" #1282

Closed mikemcbride closed 7 years ago

mikemcbride commented 7 years ago

Issue

Hyper quit unexpectedly, probably as part of a reboot on my machine, and now every time I try to open it I am presented with the dialog below. Regardless of whether I choose Reopen or Don't Reopen, it tries to start up and immediately shuts down again. I wiped out my .hyper.js and .hyper_plugins, removed and reinstalled Hyper, and even rebooted my machine and it is still doing this. It doesn't stay open long enough for me to dig into the dev tools. Has anyone else encountered this issue? Any help is appreciated!

image

ppot commented 7 years ago

a reboot on my machine, ? @mmcbride1007

mikemcbride commented 7 years ago

@ppot I restarted my machine and it closed all my apps before reboot. However, I don't think that's what caused it anymore. Every time I start up Hyper it crashes right away, so I'm guessing that error message is in reference to the last time I try to run it. I'm not sure if there's a way to log startup errors or anything because it shuts down before I ever have a chance to do anything - the window never even displays. Thoughts?

ppot commented 7 years ago

Don't reopen and start a new instance?

mikemcbride commented 7 years ago

@ppot I've tried both. I might try building the app locally to see if I can get any useful information

mikemcbride commented 7 years ago

Okay, hopefully this is more helpful. I tried running it locally and it shut down again, but this was the error thrown in Terminal.app:

2016-12-20 15:13:43.453 Electron[11509:188529] *** Assertion failure in -[_NSCGSWindow setFrame:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.76/CGS.subproj/NSCGSWindow.m:663

No idea what that means, but I'm hoping it looks familiar to someone here?

mikemcbride commented 7 years ago

When I try to navigate to the directory listed there, there isn't a com.apple.xbs inside of /Library/Caches so I'm not sure where to go from here.

mikemcbride commented 7 years ago

Seems related to this?

mikemcbride commented 7 years ago

@ppot any thoughts? sorry, but I've not done much with Electron so I don't know what to make of that error message 😕

ppot commented 7 years ago

Maybe @rauchg can chim in. I honestly have no idea for this.

mikemcbride commented 7 years ago

Thanks @ppot, appreciate your time.

@rauchg - is there any additional troubleshooting I can do on my end? My lack of knowledge around Electron is limiting me a bit here. I've tried digging through issues and forums to see if others had this issue. Aside from the one I mentioned above, the other instances I saw with similar errors were related to CocoaPods installs in Xcode, so not much help. I'm happy to continue diagnosing on my own, but would appreciate any guidance 😄

mikemcbride commented 7 years ago

I was digging through the crash report. It's pretty lengthy but there's a bit near the top that might give some more ideas as to what's happening. I'm just kind of fumbling around here, not really sure what I'm looking for.

Process:               Hyper [34984]
Path:                  /Applications/Hyper.app/Contents/MacOS/Hyper
Identifier:            co.zeit.hyper
Version:               1.0.0 (1.0.0.1303)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Hyper [34984]
User ID:               1413629075

Date/Time:             2017-01-01 20:31:11.007 -0600
OS Version:            Mac OS X 10.12.2 (16C67)
Report Version:        12
Anonymous UUID:        17EF87BB-1225-4D18-84A4-0E1BEC557AFC

Sleep/Wake UUID:       E19EFEFE-6DCF-482E-89A5-63A164DD540D

Time Awake Since Boot: 270000 seconds
Time Since Wake:       380 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [0]

Application Specific Information:
Crashing on exception: Invalid parameter not satisfying: CGRectContainsRect(CGRectMake((CGFloat)INT_MIN, (CGFloat)INT_MIN, (CGFloat)INT_MAX - (CGFloat)INT_MIN, (CGFloat)INT_MAX - (CGFloat)INT_MIN), frame)

The last line there seems helpful maybe? The next part of the crash log is below. I cut it off at what seemed like a good spot, but the error mentioned in the issue description can be found on the line marked 4:

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff9a126e7b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x00007fffaed11cad objc_exception_throw + 48
2   CoreFoundation                      0x00007fff9a12bb82 +[NSException raise:format:arguments:] + 98
3   Foundation                          0x00007fff9bb75d50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4   AppKit                              0x00007fff97cf5519 -[_NSCGSWindow setFrame:] + 252
5   AppKit                              0x00007fff97dbd268 _NSCreateWindowWithOpaqueShape2 + 162
6   AppKit                              0x00007fff97dbbea9 -[NSWindow _commonAwake] + 1150
7   AppKit                              0x00007fff9846f2d6 -[NSWindow _resolveAutomaticEnterFullScreenFlags] + 51
8   AppKit                              0x00007fff97dbb8cf -[NSWindow makeKeyAndOrderFront:] + 31
9   Electron Framework                  0x0000000108d4e23d _ZN4atom15NativeWindowMac4ShowEv + 189
10  Electron Framework                  0x0000000108d205f1 _ZN4atom3api6Window4ShowEv + 17
11  Electron Framework                  0x0000000108d24aa0 _ZNK4base8internal15RunnableAdapterIMN4atom3api6WindowEFvvEE3RunIPS4_JEEEvOT_DpOT0_ + 32
12  Electron Framework                  0x0000000108d24a79 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKNS0_15RunnableAdapterIMN4atom3api6WindowEFvvEEEJPS7_EEEvOT_DpOT0_ + 9
13  Electron Framework                  0x0000000108d24a6c _ZN4base8internal7InvokerINS0_9BindStateINS0_15RunnableAdapterIMN4atom3api6WindowEFvvEEEJEEEFvPS6_EE7RunImplIRKS9_RKNSt3__15tupleIJEEEJEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEEOSB_ + 12
14  Electron Framework                  0x0000000108d2499a _ZN4base8internal7InvokerINS0_9BindStateINS0_15RunnableAdapterIMN4atom3api6WindowEFvvEEEJEEEFvPS6_EE3RunEPNS0_13BindStateBaseEOSB_ + 26
15  Electron Framework                  0x0000000108d2492c _ZNK4base8CallbackIFvPN4atom3api6WindowEELNS_8internal8CopyModeE1EE3RunES4_ + 28
16  Electron Framework                  0x0000000108d24808 _ZN4mate8internal7InvokerINS0_13IndicesHolderIJLm0EEEEJPN4atom3api6WindowEEE18DispatchToCallbackEN4base8CallbackIFvS7_ELNS9_8internal8CopyModeE1EEE + 56
17  Electron Framework                  0x0000000108d246bc _ZN4mate8internal10DispatcherIFvPN4atom3api6WindowEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINS8_5ValueEEE + 124
18  libnode.dylib                       0x000000010cee673a _ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE + 298
19  libnode.dylib                       0x000000010cf209be _ZN2v88internal8Builtins17InvokeApiFunctionEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS4_INS0_6ObjectEEEiPS8_ + 1822
20  libnode.dylib                       0x000000010cf4b24f _ZN2v88internal17PrototypeIterator43AdvanceFollowingProxiesIgnoringAccessChecksEv + 22495
21  ???                                 0x0000051319f06147 0x0 + 5579597701447
22  ???                                 0x000005131a1dee5b 0x0 + 5579600686683
23  ???                                 0x0000051319f07cb5 0x0 + 5579597708469
24  ???                                 0x000005131a1a4770 0x0 + 5579600447344
25  ???                                 0x000005131a039881 0x0 + 5579598960769
26  ???                                 0x0000051319f07cb5 0x0 + 5579597708469

I'll keep trying to figure out what's causing this, if anyone has insights that would be super appreciated 👍

mikemcbride commented 7 years ago

Two reported bugs (on non-related Mac apps) are detailing some similar issues:

https://ape-a-plasmid-editor.wikispaces.com/share/view/75858305 https://dev.omnetpp.org/bugs/view.php?id=937

Both seem to be related to external monitors. I'm currently not plugged in to any external monitor but was at the time. Maybe the computer has cached the last window position and is trying to put it there upon open but it can't. Seems more likely that there was some issue with where the app window is trying to initialize within that monitor, based on the CGRectContainsRect error, but I could be way off.

mikemcbride commented 7 years ago

I was finally able to fix the issue. I'm pretty certain it had to do with some strange issue about being off-screen or something with an external monitor. The problem was the macOS tries to reopen windows in the last position they were in, so every time I tried to reopen the app it tried reopening in the bad place that caused the error.

How to fix it, in case anyone else runs into this kind of thing:

That was enough for me to force the application to start up normally and not try and pick up cached preferences for things like window placement.