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 MacOS: NSInternalInconsistencyException (Invalid message sent to event) #72634

Closed
tvolkert opened this issue Dec 19, 2020 · 6 comments
Closed
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. P0 Critical issues such as a build break or regression platform-mac Building on or for macOS specifically

Comments

@tvolkert
Copy link
Contributor

Ran my app in debug mode on MacOS and then didn't touch it - just let it sit in the background. Came back to discover this:

2020-12-18 13:10:31.026 payouts[7981:9355285] *** Assertion failure in -[NSEvent charactersIgnoringModifiers], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.60.100/AppKit.subproj/NSEvent.m:2796
2020-12-18 13:10:31.042 payouts[7981:9355285] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid message sent to event "NSEvent: type=FlagsChanged loc=(974.973,46.5195) time=479413.6 flags=0x100 win=0x7fb846a0d3c0 winNum=42698 ctxt=0x0 keyCode=0"'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3301cb57 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6be685bf objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff33045d08 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff35737e9d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   AppKit                              0x00007fff30459b8e -[NSEvent charactersIgnoringModifiers] + 717
	5   AppKit                              0x00007fff30562122 -[NSButton performKeyEquivalent:] + 43
	6   AppKit                              0x00007fff305620dd -[NSControl _performKeyEquivalent:conditionally:] + 150
	7   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	8   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	9   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	10  AppKit                              0x00007fff30aac76c -[NSWindow _commonPerformKeyEquivalent:conditionally:] + 73
	11  AppKit                              0x00007fff305884fd -[NSWindow keyDown:] + 30
	12  FlutterMacOS                        0x000000010657fbc0 -[FlutterViewController propagateKeyEvent:ofType:] + 512
	13  FlutterMacOS                        0x0000000106580338 __49-[FlutterViewController dispatchKeyEvent:ofType:]_block_invoke + 152
	14  FlutterMacOS                        0x000000010657618f _ZZ51-[FlutterEngine sendOnChannel:message:binaryReply:]EN3$_88__invokeEPKhmPv + 95
	15  FlutterMacOS                        0x0000000106a9ec23 _ZNSt3__110__function6__funcIN3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENS_10unique_ptrINS2_7MappingENS_14default_deleteIS8_EEEEE3$_0EENS_9allocatorISD_EEFvvEEclEv + 83
	16  FlutterMacOS                        0x0000000106aa2e2a _ZN7flutter18EmbedderTaskRunner8PostTaskEy + 682
	17  FlutterMacOS                        0x0000000106a897bc FlutterEngineRunTask + 44
	18  FlutterMacOS                        0x0000000106575ca7 __60-[FlutterEngine postMainThreadTask:targetTimeInNanoseconds:]_block_invoke + 71
	19  libdispatch.dylib                   0x00007fff6cfb66c4 _dispatch_call_block_and_release + 12
	20  libdispatch.dylib                   0x00007fff6cfb7658 _dispatch_client_callout + 8
	21  libdispatch.dylib                   0x00007fff6cfc2cab _dispatch_main_queue_callback_4CF + 936
	22  CoreFoundation                      0x00007fff32fdfe81 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	23  CoreFoundation                      0x00007fff32f9fc87 __CFRunLoopRun + 2028
	24  CoreFoundation                      0x00007fff32f9ee3e CFRunLoopRunSpecific + 462
	25  HIToolbox                           0x00007fff31bcbabd RunCurrentEventLoopInMode + 292
	26  HIToolbox                           0x00007fff31bcb7d5 ReceiveNextEventCommon + 584
	27  HIToolbox                           0x00007fff31bcb579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
	28  AppKit                              0x00007fff30211039 _DPSNextEvent + 883
	29  AppKit                              0x00007fff3020f880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
	30  AppKit                              0x00007fff3020158e -[NSApplication run] + 658
	31  AppKit                              0x00007fff301d3396 NSApplicationMain + 777
	32  payouts                             0x000000010656471d main + 13
	33  libdyld.dylib                       0x00007fff6d010cc9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Lost connection to device.

Version info

[✓] Flutter (Channel master, 1.26.0-2.0.pre.84, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-US)
    • Flutter version 1.26.0-2.0.pre.84 at /Users/tvolkert/project/flutter/flutter
    • Framework revision e2a0d03b79 (1 day ago), 2020-12-11 08:23:14 -0800 2020-12-17 19:25:28 -0800
    • Engine revision fd6b409f95
    • Dart version 2.12.0 (build 2.12.0-157.0.dev)
@tvolkert tvolkert added c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. platform-mac Building on or for macOS specifically a: desktop Running on desktop P1 High-priority issues at the top of the work list labels Dec 19, 2020
@tvolkert
Copy link
Contributor Author

tvolkert commented Dec 19, 2020

I'm able to reproduce this 100% of the time by simply CMD-TAB'ing away from the app.

@tvolkert
Copy link
Contributor Author

Bisected to #72318

@tvolkert
Copy link
Contributor Author

Further bisected it to flutter/engine#21231 - @gspencergoog

Stack trace from my host_debug_unopt build:

2020-12-18 20:15:08.864 payouts[93337:10108522] *** Assertion failure in -[NSEvent charactersIgnoringModifiers], /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.60.100/AppKit.subproj/NSEvent.m:2796
2020-12-18 20:15:08.903 payouts[93337:10108522] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid message sent to event "NSEvent: type=FlagsChanged loc=(234.48,220.734) time=500729.9 flags=0x100108 win=0x7fce44a2ea50 winNum=45347 ctxt=0x0 keyCode=55"'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff3301cb57 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff6be685bf objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff33045d08 +[NSException raise:format:arguments:] + 88
	3   Foundation                          0x00007fff35737e9d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
	4   AppKit                              0x00007fff30459b8e -[NSEvent charactersIgnoringModifiers] + 717
	5   AppKit                              0x00007fff30562122 -[NSButton performKeyEquivalent:] + 43
	6   AppKit                              0x00007fff305620dd -[NSControl _performKeyEquivalent:conditionally:] + 150
	7   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	8   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	9   AppKit                              0x00007fff30561fb1 -[NSView performKeyEquivalent:] + 189
	10  AppKit                              0x00007fff30aac76c -[NSWindow _commonPerformKeyEquivalent:conditionally:] + 73
	11  AppKit                              0x00007fff305884fd -[NSWindow keyDown:] + 30
	12  FlutterMacOS                        0x000000010851d33a -[FlutterViewController propagateKeyEvent:ofType:] + 1034
	13  FlutterMacOS                        0x000000010851e0de __49-[FlutterViewController dispatchKeyEvent:ofType:]_block_invoke + 270
	14  FlutterMacOS                        0x0000000109b4509f __48-[FlutterBasicMessageChannel sendMessage:reply:]_block_invoke + 127
	15  FlutterMacOS                        0x00000001084fb373 _ZZ51-[FlutterEngine sendOnChannel:message:binaryReply:]ENK3$_8clEPKhmPv + 195
	16  FlutterMacOS                        0x00000001084fb283 _ZZ51-[FlutterEngine sendOnChannel:message:binaryReply:]EN3$_88__invokeEPKhmPv + 51
	17  FlutterMacOS                        0x0000000109bca567 _ZZ42FlutterPlatformMessageCreateResponseHandleENK4$_73clEPKhm + 55
	18  FlutterMacOS                        0x0000000109bca4b8 _ZNSt3__18__invokeIRZ42FlutterPlatformMessageCreateResponseHandleE4$_73JPKhmEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS5_DpOS6_ + 88
	19  FlutterMacOS                        0x0000000109bca3d5 _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZ42FlutterPlatformMessageCreateResponseHandleE4$_73PKhmEEEvDpOT_ + 85
	20  FlutterMacOS                        0x0000000109bca355 _ZNSt3__110__function12__alloc_funcIZ42FlutterPlatformMessageCreateResponseHandleE4$_73NS_9allocatorIS2_EEFvPKhmEEclEOS6_Om + 85
	21  FlutterMacOS                        0x0000000109bc7e76 _ZNSt3__110__function6__funcIZ42FlutterPlatformMessageCreateResponseHandleE4$_73NS_9allocatorIS2_EEFvPKhmEEclEOS6_Om + 86
	22  FlutterMacOS                        0x00000001086800e8 _ZNKSt3__110__function12__value_funcIFvPKhmEEclEOS3_Om + 120
	23  FlutterMacOS                        0x000000010867d823 _ZNKSt3__18functionIFvPKhmEEclES2_m + 83
	24  FlutterMacOS                        0x0000000109c107a7 _ZZN7flutter31EmbedderPlatformMessageResponse8CompleteENSt3__110unique_ptrIN3fml7MappingENS1_14default_deleteIS4_EEEEENK3$_0clEv + 103
	25  FlutterMacOS                        0x0000000109c10621 _ZNK3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENSt3__110unique_ptrINS_7MappingENS4_14default_deleteIS6_EEEEE3$_0EclIJEEEDaDpOT_ + 49
	26  FlutterMacOS                        0x0000000109c1057b _ZNSt3__18__invokeIRN3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENS_10unique_ptrINS1_7MappingENS_14default_deleteIS7_EEEEE3$_0EEJEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOSE_DpOSF_ + 43
	27  FlutterMacOS                        0x0000000109c104cb _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRN3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENS_10unique_ptrINS3_7MappingENS_14default_deleteIS9_EEEEE3$_0EEEEEvDpOT_ + 43
	28  FlutterMacOS                        0x0000000109c1047b _ZNSt3__110__function12__alloc_funcIN3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENS_10unique_ptrINS2_7MappingENS_14default_deleteIS8_EEEEE3$_0EENS_9allocatorISD_EEFvvEEclEv + 43
	29  FlutterMacOS                        0x0000000109c0dffc _ZNSt3__110__function6__funcIN3fml8internal14CopyableLambdaIZN7flutter31EmbedderPlatformMessageResponse8CompleteENS_10unique_ptrINS2_7MappingENS_14default_deleteIS8_EEEEE3$_0EENS_9allocatorISD_EEFvvEEclEv + 44
	30  FlutterMacOS                        0x000000010865d113 _ZNKSt3__110__function12__value_funcIFvvEEclEv + 67
	31  FlutterMacOS                        0x0000000108659e73 _ZNKSt3__18functionIFvvEEclEv + 35
	32  FlutterMacOS                        0x0000000109c271bd _ZN7flutter18EmbedderTaskRunner8PostTaskEy + 621
	33  FlutterMacOS                        0x0000000109c2e830 _ZNK7flutter18EmbedderThreadHost8PostTaskExy + 160
	34  FlutterMacOS                        0x0000000109bd8daa _ZN7flutter14EmbedderEngine7RunTaskEPK11FlutterTask + 90
	35  FlutterMacOS                        0x0000000109b5632d FlutterEngineRunTask + 109
	36  FlutterMacOS                        0x00000001084fa991 __60-[FlutterEngine postMainThreadTask:targetTimeInNanoseconds:]_block_invoke + 113
	37  libdispatch.dylib                   0x00007fff6cfb66c4 _dispatch_call_block_and_release + 12
	38  libdispatch.dylib                   0x00007fff6cfb7658 _dispatch_client_callout + 8
	39  libdispatch.dylib                   0x00007fff6cfc2cab _dispatch_main_queue_callback_4CF + 936
	40  CoreFoundation                      0x00007fff32fdfe81 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	41  CoreFoundation                      0x00007fff32f9fc87 __CFRunLoopRun + 2028
	42  CoreFoundation                      0x00007fff32f9ee3e CFRunLoopRunSpecific + 462
	43  HIToolbox                           0x00007fff31bcbabd RunCurrentEventLoopInMode + 292
	44  HIToolbox                           0x00007fff31bcb7d5 ReceiveNextEventCommon + 584
	45  HIToolbox                           0x00007fff31bcb579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
	46  AppKit                              0x00007fff30211039 _DPSNextEvent + 883
	47  AppKit                              0x00007fff3020f880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
	48  AppKit                              0x00007fff3020158e -[NSApplication run] + 658
	49  AppKit                              0x00007fff301d3396 NSApplicationMain + 777
	50  payouts                             0x0000000107bfe71d main + 13
	51  libdyld.dylib                       0x00007fff6d010cc9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@tvolkert tvolkert added P2 and removed P1 High-priority issues at the top of the work list labels Dec 19, 2020
@gspencergoog
Copy link
Contributor

This should be fixed by flutter/engine#23154

@tvolkert
Copy link
Contributor Author

Dup of #72393

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
@flutter-triage-bot flutter-triage-bot bot added P0 Critical issues such as a build break or regression and removed P2 labels Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. P0 Critical issues such as a build break or regression platform-mac Building on or for macOS specifically
Projects
None yet
Development

No branches or pull requests

2 participants