app crashes on macOS BigSur with 'Invalid parameter not satisfying: !isnan(newOrigin.y)'

Ever since BigSur was released, our app starts seeing thousands of crashes for macOS 10.16.0 and 11.0.1

the crash is due to this exception:
  • *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: !isnan(newOrigin.y)'

and the exception backtrace looks like this:
Code Block CoreFoundation 0x00007fff203a1000 + 1029791
libobjc.A.dylib 0x00007fff201c1000 + 78793
CoreFoundation 0x00007fff203a1000 + 1197330
Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
AppKit -[NSView setFrameOrigin:]
AppKit -[NSView setFrame:]
AppKit -[_NSFullScreenDetachedToolbarMenuBarCompanionController updateContentViewForMenuBarReveal]
AppKit -[_NSFullScreenDetachedToolbarMenuBarCompanionController setMenuBarReveal:]
AppKit +[_NSFullScreenSpace initialize]
AppKit +[NSCGSSpace addMenuBarRevealChangedNotificationHandler:]
Foundation -[__NSObserver _doit:]
CoreFoundation 0x00007fff203a1000 + 487388
CoreFoundation 0x00007fff203a1000 + 1124507
CoreFoundation 0x00007fff203a1000 + 1124367
CoreFoundation 0x00007fff203a1000 + 293838
Foundation -[NSNotificationCenter postNotificationName:object:userInfo:]
SkyLight 0x00007fff24b93000 + 2014909
SkyLight 0x00007fff24b93000 + 51236
SkyLight 0x00007fff24b93000 + 49848
SkyLight 0x00007fff24b93000 + 2786204
SkyLight 0x00007fff24b93000 + 2785987
libdispatch.dylib _dispatch_call_block_and_release
libdispatch.dylib _dispatch_client_callout
libdispatch.dylib _dispatch_main_queue_callback_4CF
CoreFoundation 0x00007fff203a1000 + 780640
CoreFoundation 0x00007fff203a1000 + 526402
CoreFoundation 0x00007fff203a1000 + 521918
HIToolbox RunCurrentEventLoopInMode
HIToolbox ReceiveNextEventCommon
HIToolbox _BlockUntilNextEventMatchingListInModeWithFilter
AppKit _DPSNextEvent
AppKit -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
AppKit -[NSApplication run]
AppKit NSApplicationMain
MyApp main AppDelegate.swift:11
libdyld.dylib start


this crash stack is specific to macOS BigSur, it doesn't happen on any of the previous macOS versions (we support all the way back to High Sierra)

I'm trying to hunt this crash down but I'm unable to get any repro of this specific crash.

deducing from the stack trace it looks like AppKit is trying to turn my app's window into a full screen window but I could be wrong.

I was wondering if anyone else had seen similar crash like this?
Post not yet marked as solved Up vote post of gietal Down vote post of gietal
3k views
  • YES Does anyone at Apple know what's going on with this. It seems so many people are having this issue, and no solution to this problem. Please help!

Add a Comment

Replies

What helped to me is removing saved Safari windows state.

To remove it:

  1. Open Terminal app
  2. Copy&paste this
rm /Users/ivanparfenchuk/Library/Containers/com.apple.Safari/Data/Library/Saved\ Application\ State/com.apple.Safari.savedState/windows.plist
  1. and hit Return.

This is on macOS Big Sur. If the file isn't there, try to search for windows.plist in other places

  • This worked for me and I believe the Safari bug is triggered when the window size is under some threshold.

    You can also browse to that location in Finder and remove the file manually.

Add a Comment

This resolved the issue for me. Suggest instead to use a more generic command that would apply to all users and does not contain the user in the path.

rm ~/Library/Containers/com.apple.Safari/Data/Library/Saved\ Application\ State/com.apple.Safari.savedState/windows.plist

  • Perfect! Worked great!

Add a Comment

Hello ,

I tried ,with sudo, and the terminal said operation not permited :/

Hi hdemuylder, you need to let terminal permit the operation: https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/ Then it works