jezzmemo/JJException

NSTextContentStorage类没有崩溃事件, 但是却被框架捕获到异常了(不用到框架不会出现崩溃的情况)

Closed this issue · 10 comments

CallStack:(
0 YY 0x00000001021f4bcf -[JJExceptionProxy handleCrashException:exceptionCategory:extraInfo:] + 127
1 YY 0x00000001021f480a _Z20handleCrashException24JJExceptionGuardCategoryP8NSString + 90
2 YY 0x00000001021f64f5 -[NSAttributedString(AttributedStringHook) hookEnumerateAttributesInRange:options:usingBlock:] + 229
3 UIFoundation 0x00007fff242b7e4d -[NSTextContentStorage _supportsTextAttributesInRange:] + 216
4 UIFoundation 0x00007fff242b8e58 -[NSTextContentStorage synchronizeTextLayoutManagers:] + 91
5 UIFoundation 0x00007fff24269fdf -[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:] + 398
6 UIFoundation 0x00007fff2427051e -[NSTextLayoutManager enumerateViewportElementsFromLocation:options:usingBlock:] + 77
7 UIFoundation 0x00007fff242d198b -[NSTextViewportLayoutController layoutViewport] + 1711
8 UIKitCore 0x00007fff255af1fe +[UIView(Animation) performWithoutAnimation:] + 84
9 UIKitCore 0x00007fff24a50bb0 -[_UITextLayoutCanvasView layoutSubviews] + 97
10 UIKitCore 0x00007fff255bcaad -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2962
11 QuartzCore 0x00007fff2893c2b6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 548
12 QuartzCore 0x00007fff289474f1 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
13 QuartzCore 0x00007fff288830ca _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 652
14 QuartzCore 0x00007fff288bac47 _ZN2CA11Transaction6commitEv + 699
15 QuartzCore 0x00007fff288bbfc8 _ZN2CA11Transaction25flush_as_runloop_observerEb + 60
16 CoreFoundation 0x00007fff20368c77 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
17 CoreFoundation 0x00007fff2036349c __CFRunLoopDoObservers + 541
18 CoreFoundation 0x00007fff20363a4c __CFRunLoopRun + 1126
19 CoreFoundation 0x00007fff20363103 CFRunLoopRunSpecific + 567
20 GraphicsServices 0x00007fff2c851cd3 GSEventRunModal + 139
21 UIKitCore 0x00007fff24ffbe63 -[UIApplication _run] + 928
22 UIKitCore 0x00007fff25000a53 UIApplicationMain + 101
23 YY 0x00000001019fa058 main + 104
24 dyld 0x0000000103b1fe1e start_sim + 10
25 ??? 0x0000000000000001 0x0 + 1
26 ??? 0x0000000000000001 0x0 + 1
)

只要这个属性secureTextEntry设置为true, 就会引起该异常, 设置为false则不会

iOS 15

Duplicate of #109

初步看来是系统报出来的,肯定是系统内部的变化导致的

if ((range.location + range.length <= self.length) || ((range.location == NSNotFound) && (range.length == 0))) {
    [self hookEnumerateAttributesInRange:range options:opts usingBlock:block];
}else{
    handleCrashException(JJExceptionGuardNSStringContainer,[NSString stringWithFormat:@"NSAttributedString enumerateAttributesInRange range:%@",NSStringFromRange(range)]);
}

本地测试已解决

9b0375d
@superClown @meleebombs @kealdishx 麻烦大家切换到分支模式,我已经提交到了master分支,iOS15,iOS14帮忙测试下

pod 'JJException', :git => 'https://github.com/jezzmemo/JJException.git'

我测试了没问题~

测试没问题

@superClown @meleebombs 0.2.11 已发布

流弊