tauri: Tauri crash on Mac with 'terminating with uncaught exception of type NSException'
Describe the bug
Development console is not usable and the Tauri app crashes .
To Reproduce
Steps to reproduce the behavior:
- Start Tauri app which contains errors in the JS console
- Right Click to open the dev tools with “inspect element”
- Go to the errors/warnings tab
- Tauri app crashes
2021-11-22 11:52:23.522 app[7546:134328] NSWindow warning: adding an unknown subview: <WKInspectorWKWebView: 0x7f86d8230bf0>. Break on NSLog to debug.
2021-11-22 11:52:23.553 app[7546:134328] Call stack:
(
0 AppKit 0x00007ff81d955a26 -[NSThemeFrame addSubview:] + 112
1 AppKit 0x00007ff81d955766 -[NSView addSubview:positioned:relativeTo:] + 203
2 AppKit 0x00007ff81d95561e -[NSThemeFrame addSubview:positioned:relativeTo:] + 46
3 WebKit 0x00007ff91ef76079 _ZN6WebKit19WebInspectorUIProxy14platformAttachEv + 391
4 WebKit 0x00007ff91f070136 _ZN6WebKit19WebInspectorUIProxy4openEv + 84
5 WebKit 0x00007ff91f28e836 _ZN6WebKit19WebInspectorUIProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 242
6 WebKit 0x00007ff91ec1bbd9 _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE + 199
7 WebKit 0x00007ff91f0017d7 _ZN6WebKit15WebProcessProxy17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE + 31
8 WebKit 0x00007ff91ebf95a4 _ZN3IPC10Connection15dispatchMessageENSt3__110unique_ptrINS_7DecoderENS1_14default_deleteIS3_EEEE + 634
9 WebKit 0x00007ff91ebf8d76 _ZN3IPC10Connection24dispatchIncomingMessagesEv + 408
10 JavaScriptCore 0x00007ff8344cb14f _ZN3WTF7RunLoop11performWorkEv + 287
11 JavaScriptCore 0x00007ff8344cc0aa _ZN3WTF7RunLoop11performWorkEPv + 26
12 CoreFoundation 0x00007ff81af0584d __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
13 CoreFoundation 0x00007ff81af057b5 __CFRunLoopDoSource0 + 180
14 CoreFoundation 0x00007ff81af05534 __CFRunLoopDoSources0 + 242
15 CoreFoundation 0x00007ff81af03f6b __CFRunLoopRun + 893
16 CoreFoundation 0x00007ff81af0352d CFRunLoopRunSpecific + 563
17 HIToolbox 0x00007ff823b213e1 RunCurrentEventLoopInMode + 292
18 HIToolbox 0x00007ff823b21137 ReceiveNextEventCommon + 587
19 HIToolbox 0x00007ff823b20ed5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
20 AppKit 0x00007ff81d92e8f0 _DPSNextEvent + 886
21 AppKit 0x00007ff81d92cf5c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1411
22 AppKit 0x00007ff81d91f359 -[NSApplication run] + 586
23 app 0x0000000108ec0fa6 _ZN60_$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$6invoke17h4c52714f8e3c55e7E + 70
24 app 0x0000000108ec335c _ZN4objc7message8platform15send_unverified17h249f6ee2323c05d0E + 92
25 app 0x0000000108d28cc5 _ZN3tao13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return17hd815c015615be117E + 1333
26 app 0x0000000108d28ffd _ZN3tao13platform_impl8platform10event_loop18EventLoop$LT$T$GT$3run17h4999e2f67f0ff2c7E + 61
27 app 0x0000000108cd7f5c _ZN3tao10event_loop18EventLoop$LT$T$GT$3run17h2aca0274be158d44E + 108
28 app 0x0000000108a011e8 _ZN65_$LT$tauri_runtime_wry..Wry$u20$as$u20$tauri_runtime..Runtime$GT$3run17h3ce11fbebefd911bE + 1032
29 app 0x00000001089b8a1c _ZN5tauri3app12App$LT$R$GT$3run17hf29911d4548c7749E + 332
30 app 0x00000001089b9158 _ZN5tauri3app16Builder$LT$R$GT$3run17hf05f4bf38a78636eE + 200
31 app 0x0000000108d15527 _ZN3app4main17h9113a2ecda016923E + 4071
32 app 0x0000000108a936fe _ZN4core3ops8function6FnOnce9call_once17hfcb8a5ce20c2a1f0E + 14
33 app 0x0000000108a1f921 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h8509b43b10196e08E + 17
34 app 0x0000000108b3efd4 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17haee940333e6881e2E + 20
35 app 0x000000010937c8ea _ZN3std2rt19lang_start_internal17hf65df31c3ffe3b9aE + 650
36 app 0x0000000108b3ef9e _ZN3std2rt10lang_start17hdb2264d3b86664f8E + 46
37 app 0x0000000108d15656 main + 22
38 dyld 0x000000011756a4fe start + 462
)
2021-11-22 11:52:26.105 app[7546:134945] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[15]'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff81af80e5b __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff81ace1b9d objc_exception_throw + 48
2 CoreFoundation 0x00007ff81b03c404 _CFThrowFormattedException + 202
3 CoreFoundation 0x00007ff81b046c71 -[__NSPlaceholderDictionary initWithCapacity:].cold.1 + 0
4 CoreFoundation 0x00007ff81ae8fe62 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 251
5 CoreFoundation 0x00007ff81ae8fd4d +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
6 VisionKitCore 0x00007ffb2a1549d1 -[VKAnalyticsAnalyzerEvent coreAnalyticsDictionary] + 1292
7 VisionKitCore 0x00007ffb2a11807c -[VKAnalyticsProcessor processAndSendEvent:] + 96
8 VisionKitCore 0x00007ffb2a10e4b6 __69-[VKImageAnalyzer _processRequest:progressHandler:completionHandler:]_block_invoke_2 + 1254
9 libdispatch.dylib 0x00007ff81ac86ad8 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x00007ff81ac87cc9 _dispatch_client_callout + 8
11 libdispatch.dylib 0x00007ff81ac8dcee _dispatch_lane_serial_drain + 696
12 libdispatch.dylib 0x00007ff81ac8e7c8 _dispatch_lane_invoke + 366
13 libdispatch.dylib 0x00007ff81ac987e1 _dispatch_workloop_worker_thread + 758
14 libsystem_pthread.dylib 0x00007ff81ae3b08f _pthread_wqthread + 326
15 libsystem_pthread.dylib 0x00007ff81ae3a01b start_wqthread + 15
)
libc++abi: terminating with uncaught exception of type NSException
Expected behavior
App should not crash if i try to open the development console.
Platform and Versions (required):
Operating System - Mac OS, version 12.0.1 X64
Node.js environment
Node.js - 16.13.0
@tauri-apps/cli - 1.0.0-beta-rc.4
@tauri-apps/api - 1.0.0-beta.8
Global packages
npm - 8.1.0
yarn - 1.22.15
Rust environment
rustc - 1.56.1
cargo - 1.56.0
App directory structure
/node_modules
/public
/static
/src-tauri
/.svelte-kit
/src
App
tauri.rs - 1.0.0-beta.8
build-type - bundle
CSP -
distDir - ../public
devPath - http://localhost:3000
Additional context
Add any other context about the problem here.
Stack Trace
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: app [7546]
Path: /Users/USER/*/app
Identifier: app
Version: ???
Code Type: X86-64 (Native)
Parent Process: tauri-cli [7525]
Responsible: Terminal [1269]
User ID: 501
Date/Time: 2021-11-22 11:52:26.1112 +0100
OS Version: macOS 12.0.1 (21A559)
Report Version: 12
Bridge OS Version: 6.0 (19P548)
Anonymous UUID: 2124BCC9-C1D7-9EF2-FE3E-0DEB6E545585
Time Awake Since Boot: 12000 seconds
System Integrity Protection: enabled
Crashed Thread: 21 Dispatch queue: WebKit image analyzer queue
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[15]'
terminating with uncaught exception of type NSException
abort() called
Application Specific Backtrace 0:
0 CoreFoundation 0x00007ff81af80e5b __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff81ace1b9d objc_exception_throw + 48
2 CoreFoundation 0x00007ff81b03c404 _CFThrowFormattedException + 202
3 CoreFoundation 0x00007ff81b046c71 -[__NSPlaceholderDictionary initWithCapacity:].cold.1 + 0
4 CoreFoundation 0x00007ff81ae8fe62 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 251
5 CoreFoundation 0x00007ff81ae8fd4d +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49
6 VisionKitCore 0x00007ffb2a1549d1 -[VKAnalyticsAnalyzerEvent coreAnalyticsDictionary] + 1292
7 VisionKitCore 0x00007ffb2a11807c -[VKAnalyticsProcessor processAndSendEvent:] + 96
8 VisionKitCore 0x00007ffb2a10e4b6 __69-[VKImageAnalyzer _processRequest:progressHandler:completionHandler:]_block_invoke_2 + 1254
9 libdispatch.dylib 0x00007ff81ac86ad8 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x00007ff81ac87cc9 _dispatch_client_callout + 8
11 libdispatch.dylib 0x00007ff81ac8dcee _dispatch_lane_serial_drain + 696
12 libdispatch.dylib 0x00007ff81ac8e7c8 _dispatch_lane_invoke + 366
13 libdispatch.dylib 0x00007ff81ac987e1 _dispatch_workloop_worker_thread + 758
14 libsystem_pthread.dylib 0x00007ff81ae3b08f _pthread_wqthread + 326
15 libsystem_pthread.dylib 0x00007ff81ae3a01b start_wqthread + 15
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x7ff81ae01aba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x7ff81ae01e2b mach_msg + 59
2 CoreFoundation 0x7ff81af05a42 __CFRunLoopServiceMachPort + 319
3 CoreFoundation 0x7ff81af0411b __CFRunLoopRun + 1325
4 CoreFoundation 0x7ff81af0352d CFRunLoopRunSpecific + 563
5 HIToolbox 0x7ff823b213e1 RunCurrentEventLoopInMode + 292
6 HIToolbox 0x7ff823b21137 ReceiveNextEventCommon + 587
7 HIToolbox 0x7ff823b20ed5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
8 AppKit 0x7ff81d92e8f0 _DPSNextEvent + 886
9 AppKit 0x7ff81d92cf5c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1411
10 AppKit 0x7ff81d91f359 -[NSApplication run] + 586
11 app 0x108ec0fa6 _$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$::invoke::h4c52714f8e3c55e7 + 70
12 app 0x108ec335c objc::message::platform::send_unverified::h249f6ee2323c05d0 + 92
13 app 0x108d28cc5 objc::message::send_message::hafb5da6c9bfbdaa2 + 24 (mod.rs:178) [inlined]
14 app 0x108d28cc5 tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run_return::hd815c015615be117 + 1333 (event_loop.rs:179)
15 app 0x108d28ffd tao::platform_impl::platform::event_loop::EventLoop$LT$T$GT$::run::h4999e2f67f0ff2c7 + 61 (event_loop.rs:146)
16 app 0x108cd7f5c tao::event_loop::EventLoop$LT$T$GT$::run::h2aca0274be158d44 + 108 (event_loop.rs:151)
17 app 0x108a011e8 _$LT$tauri_runtime_wry..Wry$u20$as$u20$tauri_runtime..Runtime$GT$::run::h3ce11fbebefd911b + 1032 (lib.rs:1797)
18 app 0x1089b8a1c tauri::app::App$LT$R$GT$::run::hf29911d4548c7749 + 332 (app.rs:431)
19 app 0x1089b9158 tauri::app::Builder$LT$R$GT$::run::hf05f4bf38a78636e + 200 (app.rs:1040)
20 app 0x108d15527 app::main::h9113a2ecda016923 + 4071 (main.rs:12)
21 app 0x108a936fe core::ops::function::FnOnce::call_once::hfcb8a5ce20c2a1f0 + 14 (function.rs:227)
22 app 0x108a1f921 std::sys_common::backtrace::__rust_begin_short_backtrace::h8509b43b10196e08 + 17 (backtrace.rs:125)
23 app 0x108b3efd4 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::haee940333e6881e2 + 20 (rt.rs:63)
24 app 0x10937c8ea std::rt::lang_start_internal::hf65df31c3ffe3b9a + 650
25 app 0x108b3ef9e std::rt::lang_start::hdb2264d3b86664f8 + 46 (rt.rs:62)
26 app 0x108d15656 main + 22
27 dyld 0x11756a4fe start + 462
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 33
- Comments: 38 (19 by maintainers)
From Brent Fulgham on the webkit bugzilla:
https://bugs.webkit.org/show_bug.cgi?id=234699
Thanks apple 🙃
Also happens on macOS 12.1
You’re welcome.
The workaround is updating your macOS version to 12.3 or later. It’s a bug in macOS itself so there is nothing more one can do really.
Thanks for the insight @dceddia. I’ll close this issue since there’s not much to do on our end, I didn’t see the issue since updating to 12.3.
I agree that specifying that there is this crash in
>=12.0, <12.2is a good idea, I just had the experience 😅@jeremychone Yeah that sounds like a different problem. The problem I was seeing with the tooltips is that the entire app hard-crashes back to the desktop. There’s no window left to right-click and reload. The same happens with an inspector window open - if I do something to trigger a tooltip, the entire app crashes (and both my app + the inspector window disappear).
I have 12.3.1. Is it working with 12.3.1 for other users?
Anyway, I completely understand there are nothing that can be done to fix that. Perhaps putting a little warning sign in the doc. Anyway, hopefully, this will get fixed (by Apple) at some point.
Right-clicking an image in release mode crashes for me.
This is a pretty major issue that is a show-stopper for shipping any tauri app.
I’m going to see if I can fix this.
Edit: Seems to be an issue on webview too https://github.com/webview/webview/issues/627. Could be a Monterrey-only issue. VisionKitCore is a new addition in webkit. https://github.com/WebKit/WebKit/blob/1a1fa431f8a684f9b88c05fef1ea9b638fb5f04b/WebKitLibraries/ChangeLog#L10-L18
My guess is that VisionKitCore is requesting some assistance from the user app, but we respond to all requests with nil and CF crashes trying to add bill into the results dictionary.
Logs:
hello_file-2021-12-08-132832.txt
The best log so far:
My image: