iOS 18 beta 5 NSAttributedString Crash

There have been hundreds of the same crashes occurring every day recently. The crash stack information I have collected is as follows: AppStoreTools: 15F31e AppVariant: 1:iPhone15,4:17 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.***.***.xxxx [1125]

Date/Time: 2024-08-12 06:28:47.8121 +0800 Launch Time: 2024-08-12 06:24:53.4931 +0800 OS Version: iPhone OS 18.0 (22A5326f) Release Type: Beta Baseband Version: 2.16.02 Report Version: 104

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: xxxx [1439]

Triggered by Thread: 0

Last Exception Backtrace: 0 CoreFoundation 0x18f65c08c __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x18c9632e4 objc_exception_throw + 88 (objc-exception.mm:356) 2 Foundation 0x18e2424cc -[NSRLEArray objectAtIndex:effectiveRange:] + 172 (NSAttributedString.m:1408) 3 WebKit 0x1a59d87a0 __70-[WKContentView(WKInteraction) setAttributedMarkedText:selectedRange:]_block_invoke + 156 (WKContentViewInteraction.mm:6305) 4 WebKit 0x1a59d7fec -[WKContentView(WKInteraction) setAttributedMarkedText:selectedRange:] + 136 (WKContentViewInteraction.mm:6297) 5 UIKitCore 0x192db41e0 -[UIResponder(UITextInput_Internal) _setAttributedMarkedText:selectedRange:] + 120 (UITextInput_Internal.m:1735) 6 UIKitCore 0x192a53518 -[UIKBInputDelegateManager setAttributedMarkedText:selectedRange:] + 152 (UIKBInputDelegateManager.m:0) 7 UIKitCore 0x192741050 -[_UIKeyboardStateManager _setAttributedMarkedText:selectedRange:inputString:lastInputString:searchString:compareAttributes:] + 696 (_UIKeyboardStateManager.m:7217) 8 UIKitCore 0x1927407e8 -[_UIKeyboardStateManager setMarkedText:selectedRange:inputString:lastInputString:searchString:candidateOffset:liveConversionSegments:highlighSegmentIndex:] + 692 (_UIKeyboardStateManager.m:7118) 9 UIKitCore 0x192760e38 -[_UIKeyboardStateManager assertIntermediateText:] + 200 (_UIKeyboardStateManager.m:15075) 10 UIKitCore 0x1927440c4 -[_UIKeyboardStateManager syncKeyboardToConfiguration:] + 144 (_UIKeyboardStateManager.m:7934) 11 UIKitCore 0x192745040 __64-[_UIKeyboardStateManager handleKeyboardInput:executionContext:]_block_invoke_2 + 988 (_UIKeyboardStateManager.m:8101) 12 UIKitCore 0x192259834 -[UIKeyboardTaskEntry execute:] + 208 (UIKeyboardTaskQueue.m:869) 13 UIKitCore 0x1922596c8 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 324 (UIKeyboardTaskQueue.m:447) 14 Foundation 0x18e2b783c __NSThreadPerformPerform + 264 (NSThread.m:1084) 15 CoreFoundation 0x18f62f088 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CFRunLoop.c:1950) 16 CoreFoundation 0x18f62f01c __CFRunLoopDoSource0 + 176 (CFRunLoop.c:1994) 17 CoreFoundation 0x18f62cb08 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2031) 18 CoreFoundation 0x18f62bd04 __CFRunLoopRun + 840 (CFRunLoop.c:2949) 19 CoreFoundation 0x18f62b5b8 CFRunLoopRunSpecific + 572 (CFRunLoop.c:3414) 20 GraphicsServices 0x1db3331c4 GSEventRunModal + 164 (GSEvent.c:2196) 21 UIKitCore 0x19218ada0 -[UIApplication _run] + 816 (UIApplication.m:3789) 22 UIKitCore 0x19223917c UIApplicationMain + 340 (UIApplication.m:5439) 23 xxxxx 0x102c1d7b4 main + 84 (main.m:34) 24 dyld 0x1b5120d34 start + 2724 (dyldMain.cpp:1334)

Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001df6be254 __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x0000000216999ef8 pthread_kill + 268 (pthread.c:1721) 2 libsystem_c.dylib 0x0000000197367ad8 abort + 128 (abort.c:122) 3 libc++abi.dylib 0x00000002168bd5b8 abort_message + 132 (abort_message.cpp:78) 4 libc++abi.dylib 0x00000002168abbac demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77) 5 libobjc.A.dylib 0x000000018c97ee04 _objc_terminate() + 156 (objc-exception.mm:496) 6 qihooloan_ios 0x000000010397a790 CPPExceptionTerminate() + 504 7 libc++abi.dylib 0x00000002168bc87c std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59) 8 libc++abi.dylib 0x00000002168c00ac __cxa_rethrow + 204 (cxa_exception.cpp:648) 9 libobjc.A.dylib 0x000000018c97a650 objc_exception_rethrow + 44 (objc-exception.mm:399) 10 CoreFoundation 0x000000018f62b67c CFRunLoopRunSpecific + 768 (CFRunLoop.c:3430) 11 GraphicsServices 0x00000001db3331c4 GSEventRunModal + 164 (GSEvent.c:2196) 12 UIKitCore 0x000000019218ada0 -[UIApplication _run] + 816 (UIApplication.m:3789) 13 UIKitCore 0x000000019223917c UIApplicationMain + 340 (UIApplication.m:5439) 14 xxxxx 0x0000000102c1d7b4 main + 84 (main.m:34) 15 dyld 0x00000001b5120d34 start + 2724 (dyldMain.cpp:1334)

The Developer Forums aren't really the right place to raise bugs in a new version of an OS. Apple's engineers aren't reading through these pages waiting to see if anyone's found a bug before they fix it.

These forums are for third-party developers writing apps for Apple's platforms to discuss issues with their code.

You need to raise each issue you find separately at https://www.apple.com/feedback/ You can post the FB numbers here if you want, so that others can link to them.

The same crash happened to WKWebview on ios18beta5:

NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds
0
CoreFoundation
__exceptionPreprocess
1
libobjc.A.dylib
objc_exception_throw
2
Foundation
blockForLocation
3
WebKit
__70-[WKContentView(WKInteraction) setAttributedMarkedText:selectedRange:]_block_invoke
4
WebKit
-[WKContentView(WKInteraction) setAttributedMarkedText:selectedRange:]
5
UIKitCore
-[UIResponder(UITextInput_Internal) _setAttributedMarkedText:selectedRange:]
6
UIKitCore
-[UIKBInputDelegateManager setAttributedMarkedText:selectedRange:]
7
UIKitCore
-[_UIKeyboardStateManager _setAttributedMarkedText:selectedRange:inputString:lastInputString:searchString:compareAttributes:]
8
UIKitCore
-[_UIKeyboardStateManager setMarkedText:selectedRange:inputString:lastInputString:searchString:candidateOffset:liveConversionSegments:highlighSegmentIndex:]
9
UIKitCore
-[_UIKeyboardStateManager assertIntermediateText:]
10
UIKitCore
-[_UIKeyboardStateManager updateCandidateDisplayAsyncWithCandidateSet:]
11
UIKitCore
-[_UIKeyboardStateManager inputManagerDidGenerateCandidateResultSet:]
12
UIKitCore
__87-[_UIKeyboardStateManager generateCandidatesAsynchronouslyWithRange:selectedCandidate:]_block_invoke_3
13
UIKitCore
-[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
14
UIKitCore
__87-[_UIKeyboardStateManager generateCandidatesAsynchronouslyWithRange:selectedCandidate:]_block_invoke_2
15
UIKitCore
-[UIKeyboardTaskEntry execute:]
16
UIKitCore
-[UIKeyboardTaskQueue continueExecutionOnMainThread]
17
UIKitCore
-[UIKeyboardTaskQueue continueExecutionOnMainThread]
18
Foundation
__NSThreadPerformPerform
19
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
20
CoreFoundation
__CFRunLoopDoSource0
21
CoreFoundation
__CFRunLoopDoSources0
22
CoreFoundation
__CFRunLoopRun
23
CoreFoundation
CFRunLoopRunSpecific
24
GraphicsServices
GSEventRunModal
25
UIKitCore
-[UIApplication _run]
26
UIKitCore
UIApplicationMain

we got the same problem and the Feedback report number is FB14782226

seems beta6 has fixed this issue

iOS 18 beta 5 NSAttributedString Crash
 
 
Q