macOS运行iOS应用的一个Crash记录 - Invalid parameter not satisfying:\. "frame=!CGRectIsNull(frame)"

stack

现象

使用环境

macOS Montery 12.0.1,MacBook Pro (13-inch, M1, 2020)

操作步骤

mac上运行iOS应用 -> 点击iOS原生输入框(类型需要为TextField)-> 跳转H5页面 -> 点击H5输入框 -> Crash

录屏

flow

堆栈

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000018b1492c8
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [84957]

Triggered by Thread: 0

Application Specific Information:
Crashing on exception: Invalid parameter not satisfying: <SPRoundedWindow: 0x14076d660>. "frame=!CGRectIsNull(frame)"
dyld4 config: DYLD_LIBRARY_PATH=/Users/xxxx/Library/Developer/Xcode/DerivedData/TestMacPro-fmkfqwfrltvdvselxabdtvphcckf/Build/Products/Debug-iphoneos:/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport_macCatalyst.dylib DYLD_FRAMEWORK_PATH=/Users/xxxx/Library/Developer/Xcode/DerivedData/TestMacPro-fmkfqwfrltvdvselxabdtvphcckf/Build/Products/Debug-iphoneos


Last Exception Backtrace:
0 CoreFoundation 0x1882f8118 __exceptionPreprocess + 220
1 libobjc.A.dylib 0x188049808 objc_exception_throw + 60
2 Foundation 0x18926ae20 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0
3 AppKit 0x18ae1ffbc -[NSWindow _reallySetFrame:] + 904
4 AppKit 0x18ae1f874 -[NSWindow _oldPlaceWindow:fromServer:] + 228
5 AppKit 0x18ae1e894 -[NSWindow _setFrameCommon:display:fromServer:] + 2200
6 SafariPlatformSupport 0x1ae618104 __85-[SPSafariPlatformSupport displayOTPAutoFillRelativeToRect:ofView:completionHandler:]_block_invoke + 300
7 SafariPlatformSupport 0x1ae617f8c -[SPSafariPlatformSupport displayOTPAutoFillRelativeToRect:ofView:completionHandler:] + 228
8 UIKitCore 0x1b00d6334 -[UIKeyboardImpl generateAutofillCandidateByAddingTask:] + 948
9 UIKitCore 0x1b00e03fc -[UIKeyboardImpl setDelegate:force:] + 6248
10 UIKitCore 0x1afdc62f4 -[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:] + 2080
11 UIKitCore 0x1afdc5aa8 -[UIKeyboardSceneDelegate _reloadInputViewsForResponder:] + 164
12 UIKitCore 0x1af7394d8 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 132
13 WebKit 0x1c102447c -[WKContentView(WKInteraction) _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:] + 2088
14 WebKit 0x1c0d354d4 WebKit::WebPageProxy::elementDidFocus(WebKit::FocusedElementInformation const&, bool, bool, WTF::OptionSet<WebCore::ActivityState::Flag>, WebKit::UserData const&) + 216
15 WebKit 0x1c0f9bee8 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 61312
16 WebKit 0x1c0993e24 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 272
17 WebKit 0x1c0d041e8 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40
18 WebKit 0x1c09763e0 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 808
19 WebKit 0x1c09759f0 IPC::Connection::dispatchIncomingMessages() + 508
20 JavaScriptCore 0x1bfef8a40 WTF::RunLoop::performWork() + 292
21 JavaScriptCore 0x1bfef9bb0 WTF::RunLoop::performWork(void*) + 36
22 CoreFoundation 0x188278bbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
23 CoreFoundation 0x188278b08 __CFRunLoopDoSource0 + 208
24 CoreFoundation 0x1882787f4 __CFRunLoopDoSources0 + 268
25 CoreFoundation 0x188277168 __CFRunLoopRun + 820
26 CoreFoundation 0x188276694 CFRunLoopRunSpecific + 600
27 HIToolbox 0x190dec990 RunCurrentEventLoopInMode + 292
28 HIToolbox 0x190dec704 ReceiveNextEventCommon + 552
29 HIToolbox 0x190dec4c4 _BlockUntilNextEventMatchingListInModeWithFilter + 72
30 AppKit 0x18adcbaec _DPSNextEvent + 844
31 AppKit 0x18adca390 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1332
32 AppKit 0x18adbc3b0 -[NSApplication run] + 596
33 AppKit 0x18ad8da84 NSApplicationMain + 1064
34 AppKit 0x18b063ff0 +[NSWindow _savedFrameFromString:] + 0
35 UIKitMacHelper 0x19d764484 UINSApplicationMain + 1280
36 UIKitCore 0x1af5b2ce4 UIApplicationMain + 164
37 TestMacPro 0x1020c5ac0 main + 128 (main.m:17)
38 dyld 0x1024c50f4 start + 520

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - Compressor failed a blocking pager_get
VM - pmap_enter failed with resource shortage


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 AppKit 0x18b1492c8 -[NSApplication _crashOnException:] + 324
1 AppKit 0x18b1492c0 -[NSApplication _crashOnException:] + 316
2 AppKit 0x18b148fe0 -[NSApplication reportException:] + 588
3 AppKit 0x18b1f2448 uncaughtErrorProc + 156
4 CoreFoundation 0x1883833d8 __handleUncaughtException + 676
5 libobjc.A.dylib 0x188052194 _objc_terminate() + 132
6 libc++abi.dylib 0x188168ee4 std::__terminate(void (*)()) + 20
7 libc++abi.dylib 0x18816befc __cxa_rethrow + 148
8 libobjc.A.dylib 0x18805ded0 objc_exception_rethrow + 44
9 AppKit 0x18ae1ef20 -[NSWindow _setFrameCommon:display:fromServer:] + 3876
10 SafariPlatformSupport 0x1ae618104 __85-[SPSafariPlatformSupport displayOTPAutoFillRelativeToRect:ofView:completionHandler:]_block_invoke + 300
11 SafariPlatformSupport 0x1ae617f8c -[SPSafariPlatformSupport displayOTPAutoFillRelativeToRect:ofView:completionHandler:] + 228
12 UIKitCore 0x1b00d6334 -[UIKeyboardImpl generateAutofillCandidateByAddingTask:] + 948
13 UIKitCore 0x1b00e03fc -[UIKeyboardImpl setDelegate:force:] + 6248
14 UIKitCore 0x1afdc62f4 -[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:] + 2080
15 UIKitCore 0x1afdc5aa8 -[UIKeyboardSceneDelegate _reloadInputViewsForResponder:] + 164
16 UIKitCore 0x1af7394d8 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 132
17 WebKit 0x1c102447c -[WKContentView(WKInteraction) _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:] + 2088
18 WebKit 0x1c0d354d4 WebKit::WebPageProxy::elementDidFocus(WebKit::FocusedElementInformation const&, bool, bool, WTF::OptionSet<WebCore::ActivityState::Flag>, WebKit::UserData const&) + 216
19 WebKit 0x1c0f9bee8 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 61312
20 WebKit 0x1c0993e24 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 272
21 WebKit 0x1c0d041e8 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40
22 WebKit 0x1c09763e0 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 808
23 WebKit 0x1c09759f0 IPC::Connection::dispatchIncomingMessages() + 508
24 JavaScriptCore 0x1bfef8a40 WTF::RunLoop::performWork() + 292
25 JavaScriptCore 0x1bfef9bb0 WTF::RunLoop::performWork(void*) + 36
26 CoreFoundation 0x188278bbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
27 CoreFoundation 0x188278b08 __CFRunLoopDoSource0 + 208
28 CoreFoundation 0x1882787f4 __CFRunLoopDoSources0 + 268
29 CoreFoundation 0x188277168 __CFRunLoopRun + 820
30 CoreFoundation 0x188276694 CFRunLoopRunSpecific + 600
31 HIToolbox 0x190dec990 RunCurrentEventLoopInMode + 292
32 HIToolbox 0x190dec704 ReceiveNextEventCommon + 552
33 HIToolbox 0x190dec4c4 _BlockUntilNextEventMatchingListInModeWithFilter + 72
34 AppKit 0x18adcbaec _DPSNextEvent + 844
35 AppKit 0x18adca390 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1332
36 AppKit 0x18adbc3b0 -[NSApplication run] + 596
37 AppKit 0x18ad8da84 NSApplicationMain + 1064
38 AppKit 0x18b063ff0 _NSApplicationMainWithInfoDictionary + 24
39 UIKitMacHelper 0x19d764484 UINSApplicationMain + 1280
40 UIKitCore 0x1af5b2ce4 UIApplicationMain + 164
41 TestMacPro 0x1020c5ac0 main + 128 (main.m:17)
42 dyld

复现步骤

flow

解决方案

此问题为苹果系统bug,已将此问题提交给了苹果,原因应该是是由于mac Catalyst 不支持predictive text自动纠错预测文本,可以尝试将mac上TextFiled的自动纠错预测文本关闭

1
textField.autocorrectionType = .no

详细可参考forums

坚持原创技术分享,您的支持将鼓励我继续创作!