Skip to content

[macOS] App crashed when call SetEscapeTouchBarItem #10442

@jhen0409

Description

@jhen0409
  • Electron version: 1.6.8 ~ 1.7.6
  • Operating system: macOS 10.12.1

Expected behavior

Shouldn't crash app when called SetEscapeTouchBarItem native method.

Actual behavior

jhen0409/react-native-debugger#81 (comment) provided the error messages, and seems another one have same problem:

Crashing on exception: -[NSTouchBar setEscapeKeyReplacementItemIdentifier:]: unrecognized selector sent to instance 0x600000288570

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff7f35948b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x00007fff93c4ecad objc_exception_throw + 48
2   CoreFoundation                      0x00007fff7f3dac94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3   CoreFoundation                      0x00007fff7f2cbb55 ___forwarding___ + 1061
4   CoreFoundation                      0x00007fff7f2cb6a8 _CF_forwarding_prep_0 + 120
5   Electron Framework                  0x000000010b33162c _ZN17certificate_trust20ShowCertificateTrustEPN4atom12NativeWindowERK13scoped_refptrIN3net15X509CertificateEERKNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEERKN4base8CallbackIFvvELNSI_8internal8CopyModeE1ELNSL_10RepeatModeE1EEE + 8028
6   Electron Framework                  0x000000010b30e721 _ZN4atom15NativeWindowMac12SetStyleMaskEbm + 1601
7   Electron Framework                  0x000000010b3132b8 _ZN4atom15NativeWindowMac21SetEscapeTouchBarItemERKN4mate20PersistentDictionaryE + 40
8   Electron Framework                  0x000000010b2e8634 _ZN4atom3api6Window21SetEscapeTouchBarItemERKN4mate20PersistentDictionaryE + 20
9   Electron Framework                  0x000000010b275a3e _ZN4base8internal7InvokerINS0_9BindStateIMNS_11CommandLineEFvRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEJNS0_17UnretainedWrapperIS3_EEEEEFvSC_EE3RunEPNS0_13BindStateBaseESC_ + 206
10  Electron Framework                  0x000000010b2759ff _ZN4base8internal7InvokerINS0_9BindStateIMNS_11CommandLineEFvRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEJNS0_17UnretainedWrapperIS3_EEEEEFvSC_EE3RunEPNS0_13BindStateBaseESC_ + 143
11  Electron Framework                  0x000000010b27e12f _ZN4base8internal7InvokerINS0_9BindStateIMN4atom3api3AppEFvRKNS_8FilePathEEJEEEFvPS5_S8_EE3RunEPNS0_13BindStateBaseEOSC_S8_ + 79
12  Electron Framework                  0x000000010b2f0cb0 _ZN4base8internal7InvokerINS0_9BindStateIMN4atom3api6WindowEFvRKN4mate20PersistentDictionaryEEJEEEFvPS5_S9_EE3RunEPNS0_13BindStateBaseEOSD_S9_ + 32
13  Electron Framework                  0x000000010b272961 _ZN4atom3api3App11GetFileIconERKN4base8FilePathEPN4mate9ArgumentsE + 977
14  Electron Framework                  0x000000010b2df23c _ZN4mate8internal10DispatcherIFvPN4atom3api11WebContentsERKNS2_13SetSizeParamsEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINSB_5ValueEEE + 460
15  Electron Framework                  0x000000010b2f09dc _ZN4mate8internal10DispatcherIFvPN4atom3api6WindowERKNS_20PersistentDictionaryEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINSB_5ValueEEE + 124
16  libnode.dylib                       0x000000010f87c025 _ZN2v88internal6StrDupEPKc + 565
17  libnode.dylib                       0x000000010f92cfe8 _ZNK2v88internal8compiler17BranchElimination21ControlPathConditionseqERKS3_ + 4184
18  libnode.dylib                       0x000000010f92c541 _ZNK2v88internal8compiler17BranchElimination21ControlPathConditionseqERKS3_ + 1457
19  ???                                 0x000029ae970043a7 0x0 + 45829834425255
20  ???                                 0x000029ae971dd77f 0x0 + 45829836363647
21  ???                                 0x000029ae971dd638 0x0 + 45829836363320
22  ???                                 0x000029ae971dc55e 0x0 + 45829836359006

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   com.apple.AppKit              	0x00007fff7d1c0836 -[NSApplication _crashOnException:] + 109
1   com.apple.AppKit              	0x00007fff7d1c0768 -[NSApplication reportException:] + 917
2   com.apple.AppKit              	0x00007fff7d29599f uncaughtErrorProc + 158
3   com.apple.CoreFoundation      	0x00007fff7f3d7d2a __handleUncaughtException + 746
4   libobjc.A.dylib               	0x00007fff93c50f15 _objc_terminate() + 94
5   libc++abi.dylib               	0x00007fff93142d69 std::__terminate(void (*)()) + 8
6   libc++abi.dylib               	0x00007fff931427de __cxa_throw + 121
7   libobjc.A.dylib               	0x00007fff93c4edd6 objc_exception_throw + 345
8   com.apple.CoreFoundation      	0x00007fff7f3dac94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
9   com.apple.CoreFoundation      	0x00007fff7f2cbb55 ___forwarding___ + 1061
10  com.apple.CoreFoundation      	0x00007fff7f2cb6a8 _CF_forwarding_prep_0 + 120
11  com.github.electron.framework 	0x000000010b33162c 0x10b265000 + 837164
12  com.github.electron.framework 	0x000000010b30e721 0x10b265000 + 694049
13  com.github.electron.framework 	0x000000010b3132b8 atom::NativeWindowMac::SetEscapeTouchBarItem(mate::PersistentDictionary const&) + 40
14  com.github.electron.framework 	0x000000010b2e8634 atom::api::Window::SetEscapeTouchBarItem(mate::PersistentDictionary const&) + 20

How to reproduce

Here is the app code that used Touch Bar API, it will called _setEscapeTouchBarItem(null) I tracked, but it works as expected for me even CI is green, so I guess maybe it only happened on some macOS versions or settings.

/cc @MarshallOfSound and @urikphytech @danishmughal @dannyvassallo @Manuelandro

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions