Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on iOS 10 occasionly #960

Open
AlasKuNull opened this issue Jun 6, 2018 · 14 comments
Open

crash on iOS 10 occasionly #960

AlasKuNull opened this issue Jun 6, 2018 · 14 comments

Comments

@AlasKuNull
Copy link

Crash on #0 Thread

libobjc.A.dylib objc_msgSend + 16
1 UIFoundation -[NSATSTypesetter actionForControlCharacterAtIndex:] + 116
2 UIFoundation -[NSATSGlyphStorage setGlyphRange:characterRange:] + 3128
3 UIFoundation -[NSATSTypesetter _ctTypesetter] + 276
4 UIFoundation -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 128
5 UIFoundation -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2316
6 UIFoundation -[NSATSTypesetter layoutParagraphAtPoint:] + 160
7 UIFoundation -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 2948
8 UIFoundation -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244
9 UIFoundation -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448
10 UIFoundation -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1116
11 UIFoundation _NSFastFillAllLayoutHolesForGlyphRange + 1416
12 UIFoundation -[NSLayoutManager ensureLayoutForBoundingRect:inTextContainer:] + 220
13 UIKit ___38-[UITextView _visibleRangeWithLayout:]_block_invoke + 112
14 UIFoundation -[NSLayoutManager(TextLocking) coordinateAccess:] + 64
15 UIKit -[UITextView _visibleRangeWithLayout:] + 144
16 UIKit -[_UITextViewRestorableScrollPosition initWithTextView:] + 100
17 UIKit +[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] + 68
18 UIKit -[UITextView setContentOffset:] + 80
19 AsyncDisplayKit ASTextKitAttributes::hash() const + 2748
20 UIKit -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60
21 UIKit -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 448
22 UIKit -[UIScrollView removeFromSuperview] + 40
23 UIKit -[UIView dealloc] + 1176
24 Foundation -[NSConcretePointerArray replacePointerAtIndex:withPointer:] + 176
25 AsyncDisplayKit ASPageCoordinatesForPagesThatIntersectRect + 33912
26 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32
27 CoreFoundation ___CFRunLoopDoObservers + 372
28 CoreFoundation ___CFRunLoopRun + 1024
29 CoreFoundation CFRunLoopRunSpecific + 444
30 GraphicsServices GSEventRunModal + 180
31 UIKit -[UIApplication _run] + 684
32 UIKit UIApplicationMain + 208
33 CapabilityOfJanpanese 0x00000001000a0000 + 22964
34 libdyld.dylib _start + 4

I added the code in ASTextKitComponentsTextView file, but is also crash occasionly in iOS 10.

`- (void)setContentOffset:(CGPoint)contentOffset {

if (_isDeallocing) {

    return;
}
[super setContentOffset:contentOffset];

}

  • (void)dealloc {

    _isDeallocing = YES;
    }`

@GeekTree0101
Copy link
Contributor

Try to use setContentOffset in MainThread DispatchQueue

@lamlv2305
Copy link

I have same issue with setContentOffset crash.

Just open view with ASEditableTextNode then pop this view, and waiting for crash.

Thread Queue:

Thread 1 Queue : com.apple.main-thread (serial)
#0	0x0000000181e81b90 in objc_msgSend ()
#1	0x00000001878ab08c in -[NSGlyphGenerator generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:] ()
#2	0x000000018787e094 in -[NSLayoutManager(NSPrivate) _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] ()
#3	0x000000018787fee0 in _NSFastFillAllGlyphHolesForGlyphRange ()
#4	0x00000001878b8a08 in -[NSLayoutManager characterRangeForGlyphRange:actualGlyphRange:] ()
#5	0x0000000188296638 in __38-[UITextView _visibleRangeWithLayout:]_block_invoke ()
#6	0x00000001878bb6f0 in -[NSLayoutManager(TextLocking) coordinateAccess:] ()
#7	0x0000000188296504 in -[UITextView _visibleRangeWithLayout:] ()
#8	0x000000018829be4c in -[_UITextViewRestorableScrollPosition initWithTextView:] ()
#9	0x000000018829b9fc in +[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] ()
#10	0x00000001882938d0 in -[UITextView setContentOffset:] ()
#11	0x0000000100438728 in ::-[ASTextKitComponentsTextView setContentOffset:](CGPoint) at /MY_FOLDER/Pods/Texture/Source/TextKit/ASTextKitComponents.mm:67
#12	0x0000000187c7e62c in -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] ()
#13	0x0000000187a38214 in -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] ()
#14	0x0000000187a38008 in -[UIScrollView removeFromSuperview] ()
#15	0x0000000187950824 in -[UIView dealloc] ()
#16	0x000000018315e9a0 in -[NSConcretePointerArray replacePointerAtIndex:withPointer:] ()
#17	0x00000001003f0414 in ::-[ASRunLoopQueue processQueue]() at /MY_FOLDER/Pods/Texture/Source/ASRunLoopQueue.mm:468
#18	0x00000001003efe98 in ::__56-[ASRunLoopQueue initWithRunLoop:retainObjects:handler:]_block_invoke(CFRunLoopObserverRef, CFRunLoopActivity) at /MU_FOLDER/Pods/Texture/Source/ASRunLoopQueue.mm:381
#19	0x00000001827c07b0 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#20	0x00000001827be554 in __CFRunLoopDoObservers ()
#21	0x00000001827be984 in __CFRunLoopRun ()
#22	0x00000001826e8d10 in CFRunLoopRunSpecific ()
#23	0x0000000183fd0088 in GSEventRunModal ()
#24	0x00000001879bdf70 in UIApplicationMain ()
#25	0x00000001000709ec in main at /MY_FOLDER/AppDelegate.swift:14
#26	0x00000001822868b8 in start ()
and `bt all` :
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x13e85150)
    frame #0: 0x0000000181e81b90 libobjc.A.dylib`objc_msgSend + 16
    frame #1: 0x00000001878ab08c UIFoundation`-[NSGlyphGenerator generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:] + 256
    frame #2: 0x000000018787e094 UIFoundation`-[NSLayoutManager(NSPrivate) _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] + 724
    frame #3: 0x000000018787fee0 UIFoundation`_NSFastFillAllGlyphHolesForGlyphRange + 684
    frame #4: 0x00000001878b8a08 UIFoundation`-[NSLayoutManager characterRangeForGlyphRange:actualGlyphRange:] + 76
    frame #5: 0x0000000188296638 UIKit`__38-[UITextView _visibleRangeWithLayout:]_block_invoke + 232
    frame #6: 0x00000001878bb6f0 UIFoundation`-[NSLayoutManager(TextLocking) coordinateAccess:] + 64
    frame #7: 0x0000000188296504 UIKit`-[UITextView _visibleRangeWithLayout:] + 144
    frame #8: 0x000000018829be4c UIKit`-[_UITextViewRestorableScrollPosition initWithTextView:] + 100
    frame #9: 0x000000018829b9fc UIKit`+[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] + 68
    frame #10: 0x00000001882938d0 UIKit`-[UITextView setContentOffset:] + 84
  * frame #11: 0x0000000100438728 AsyncDisplayKit`::-[ASTextKitComponentsTextView setContentOffset:](self=0x000000013e8b3000, _cmd="setContentOffset:", contentOffset=(x = 0, y = 0)) at ASTextKitComponents.mm:67
    frame #12: 0x0000000187c7e62c UIKit`-[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60
    frame #13: 0x0000000187a38214 UIKit`-[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 460
    frame #14: 0x0000000187a38008 UIKit`-[UIScrollView removeFromSuperview] + 40
    frame #15: 0x0000000187950824 UIKit`-[UIView dealloc] + 952
    frame #16: 0x000000018315e9a0 Foundation`-[NSConcretePointerArray replacePointerAtIndex:withPointer:] + 192
    frame #17: 0x00000001003f0414 AsyncDisplayKit`::-[ASRunLoopQueue processQueue](self=0x000000013dda5e00, _cmd="processQueue") at ASRunLoopQueue.mm:468
    frame #18: 0x00000001003efe98 AsyncDisplayKit`::__56-[ASRunLoopQueue initWithRunLoop:retainObjects:handler:]_block_invoke(.block_descriptor=0x000000013f1f4790, observer=0x000000013ddc9430, activity=32) at ASRunLoopQueue.mm:381
    frame #19: 0x00000001827c07b0 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    frame #20: 0x00000001827be554 CoreFoundation`__CFRunLoopDoObservers + 372
    frame #21: 0x00000001827be984 CoreFoundation`__CFRunLoopRun + 928
    frame #22: 0x00000001826e8d10 CoreFoundation`CFRunLoopRunSpecific + 384
    frame #23: 0x0000000183fd0088 GraphicsServices`GSEventRunModal + 180
    frame #24: 0x00000001879bdf70 UIKit`UIApplicationMain + 204
    frame #25: 0x00000001000709ec Example`main at AppDelegate.swift:14
    frame #26: 0x00000001822868b8 libdyld.dylib`start + 4
  thread #2, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x00000001823a54d8 libsystem_kernel.dylib`kevent_qos + 8
    frame #1: 0x00000001022560fc libdispatch.dylib`_dispatch_mgr_invoke + 232
    frame #2: 0x0000000102243cb8 libdispatch.dylib`_dispatch_mgr_thread + 52
  thread #3
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #4
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #5
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #7
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #8
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #9
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #10, name = 'GCDAsyncSocket-CFStream'
    frame #0: 0x0000000182388fd8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x0000000182388e54 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x00000001827c0ce8 CoreFoundation`__CFRunLoopServiceMachPort + 196
    frame #3: 0x00000001827be9ec CoreFoundation`__CFRunLoopRun + 1032
    frame #4: 0x00000001826e8d10 CoreFoundation`CFRunLoopRunSpecific + 384
    frame #5: 0x00000001830f8d8c Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
    frame #6: 0x0000000100b769c8 CocoaAsyncSocket`+[GCDAsyncSocket cfstreamThread](self=GCDAsyncSocket, _cmd="cfstreamThread") at GCDAsyncSocket.m:7601
    frame #7: 0x00000001831dfe1c Foundation`__NSThread__start__ + 1000
    frame #8: 0x000000018246fb28 libsystem_pthread.dylib`_pthread_body + 156
    frame #9: 0x000000018246fa8c libsystem_pthread.dylib`_pthread_start + 156
    frame #10: 0x000000018246d028 libsystem_pthread.dylib`thread_start + 4
  thread #11, name = 'com.apple.CFSocket.private'
    frame #0: 0x00000001823a4344 libsystem_kernel.dylib`__select + 8
    frame #1: 0x00000001827c7250 CoreFoundation`__CFSocketManager + 648
    frame #2: 0x000000018246fb28 libsystem_pthread.dylib`_pthread_body + 156
    frame #3: 0x000000018246fa8c libsystem_pthread.dylib`_pthread_start + 156
    frame #4: 0x000000018246d028 libsystem_pthread.dylib`thread_start + 4
  thread #12
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #13, name = 'com.apple.NSURLConnectionLoader'
    frame #0: 0x0000000182388fd8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x0000000182388e54 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x00000001827c0ce8 CoreFoundation`__CFRunLoopServiceMachPort + 196
    frame #3: 0x00000001827be9ec CoreFoundation`__CFRunLoopRun + 1032
    frame #4: 0x00000001826e8d10 CoreFoundation`CFRunLoopRunSpecific + 384
    frame #5: 0x0000000182e69af4 CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 412
    frame #6: 0x00000001831dfe1c Foundation`__NSThread__start__ + 1000
    frame #7: 0x000000018246fb28 libsystem_pthread.dylib`_pthread_body + 156
    frame #8: 0x000000018246fa8c libsystem_pthread.dylib`_pthread_start + 156
    frame #9: 0x000000018246d028 libsystem_pthread.dylib`thread_start + 4
  thread #14
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #15
    frame #0: 0x00000001823a4b48 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x000000018246d530 libsystem_pthread.dylib`_pthread_wqthread + 1284
    frame #2: 0x000000018246d020 libsystem_pthread.dylib`start_wqthread + 4
  thread #16, name = 'ASDeallocQueue'
    frame #0: 0x0000000182388fd8 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x0000000182388e54 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x00000001827c0ce8 CoreFoundation`__CFRunLoopServiceMachPort + 196
    frame #3: 0x00000001827be9ec CoreFoundation`__CFRunLoopRun + 1032
    frame #4: 0x00000001826e8d10 CoreFoundation`CFRunLoopRunSpecific + 384
    frame #5: 0x0000000182736464 CoreFoundation`CFRunLoopRun + 112
    frame #6: 0x00000001003edfe4 AsyncDisplayKit`::-[ASDeallocQueueV1 threadMain](self=0x000000013f416910, _cmd="threadMain") at ASRunLoopQueue.mm:124
    frame #7: 0x00000001831dfe1c Foundation`__NSThread__start__ + 1000
    frame #8: 0x000000018246fb28 libsystem_pthread.dylib`_pthread_body + 156
    frame #9: 0x000000018246fa8c libsystem_pthread.dylib`_pthread_start + 156
    frame #10: 0x000000018246d028 libsystem_pthread.dylib`thread_start + 4

@ay8s
Copy link
Collaborator

ay8s commented Jul 26, 2018

@zoka2305 @AlasKuNull Would you be up for pulling together a small project with the issue happening?

@Shaninnik
Copy link

I am also experiencing this issue, but I never was able to reproduce it locally, crash log is identical - [UIView dealloc] -> [ASTextKitComponentsTextView setContentOffset] -> crash

0   libobjc.A.dylib               	0x0000000182b45b90 objc_msgSend + 16 (objc-msg-arm64.s:260)
1   UIFoundation                  	0x000000018856d588 -[NSATSTypesetter actionForControlCharacterAtIndex:] + 120 (NSATSTypesetter.m:1079)
2   UIFoundation                  	0x000000018856fd14 -[NSATSGlyphStorage setGlyphRange:characterRange:] + 3200 (NSATSTypesetter.m:1830)
3   UIFoundation                  	0x000000018856b2f4 -[NSATSTypesetter _ctTypesetter] + 276 (NSATSTypesetter.m:526)
4   UIFoundation                  	0x0000000188574888 -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 124 (NSATSTypesetter.m:3312)
5   UIFoundation                  	0x000000018856bf0c -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2364 (NSATSTypesetter.m:714)
6   UIFoundation                  	0x000000018856d664 -[NSATSTypesetter layoutParagraphAtPoint:] + 160 (NSATSTypesetter.m:1095)
7   UIFoundation                  	0x00000001885c20a4 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 3036 (NSTypesetter.m:938)
8   UIFoundation                  	0x00000001885c2dec -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244 (NSTypesetter.m:1143)
9   UIFoundation                  	0x000000018856e0d0 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448 (NSATSTypesetter.m:1276)
10  UIFoundation                  	0x000000018855a68c -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1044 (NSLayoutManager_Private.m:655)
11  UIFoundation                  	0x0000000188560c4c _NSFastFillAllLayoutHolesForGlyphRange + 1504 (NSLayoutManager_Private.m:5401)
12  UIFoundation                  	0x0000000188597244 -[NSLayoutManager enumerateLineFragmentsForGlyphRange:usingBlock:] + 84 (NSLayoutManager.m:3041)
13  UIKit                         	0x00000001886fb7fc __38-[UITextView _rectForScrollToVisible:]_block_invoke + 156 (UITextView.m:2322)
14  UIFoundation                  	0x00000001885976f0 -[NSLayoutManager(TextLocking) coordinateAccess:] + 64 (NSLayoutManager.m:3251)
15  UIKit                         	0x00000001886fb614 -[UITextView _rectForScrollToVisible:] + 248 (UITextView.m:2319)
16  UIKit                         	0x0000000188f77e68 -[_UITextViewRestorableScrollPosition initWithTextView:] + 160 (UITextView.m:4044)
17  UIKit                         	0x0000000188f779dc +[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] + 68 (UITextView.m:3980)
18  UIKit                         	0x0000000188f6f81c -[UITextView setContentOffset:] + 84 (UITextView.m:1320)
19  AsyncDisplayKit               	0x000000010093c938 -[ASTextKitComponentsTextView setContentOffset:] + 60 (ASTextKitComponents.mm:67)
20  UIKit                         	0x000000018895a71c -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60 (UIScrollView.m:6273)
21  UIKit                         	0x000000018871432c -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 460 (UIScrollView.m:5484)
22  UIKit                         	0x0000000188714120 -[UIScrollView removeFromSuperview] + 40 (UIScrollView.m:1570)
23  UIKit                         	0x000000018862c924 -[UIView dealloc] + 952 (UIView.m:2803)

@ay8s
Copy link
Collaborator

ay8s commented Aug 1, 2018

@Shaninnik Could you pull a small project together to aid in debugging?

@Shaninnik
Copy link

@ay8s I would be glad to help, but unfortunately I do not see how. I don't even know at what specific part of the app it is crashing, I have never seen this crash personally, and crash log is not informative enough. But according to crashlytics this happens quite a lot, on both iOS 9 and iOS 10. And started happening after we released an update that fixed a number of memory leaks. We also have another variation of this crash:

Thread 0 Crashed:
0   libobjc.A.dylib               	0x0000000182b45b90 objc_msgSend + 16 (objc-msg-arm64.s:260)
1   UIFoundation                  	0x00000001885c0464 -[NSTypesetter lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:] + 148 (NSTypesetter.m:523)
2   UIFoundation                  	0x000000018856c03c -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2668 (NSATSTypesetter.m:753)
3   UIFoundation                  	0x000000018856d664 -[NSATSTypesetter layoutParagraphAtPoint:] + 160 (NSATSTypesetter.m:1095)
4   UIFoundation                  	0x00000001885c20a4 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 3036 (NSTypesetter.m:938)
5   UIFoundation                  	0x00000001885c2dec -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244 (NSTypesetter.m:1143)
6   UIFoundation                  	0x000000018856e0d0 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448 (NSATSTypesetter.m:1276)
7   UIFoundation                  	0x000000018855a68c -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1044 (NSLayoutManager_Private.m:655)
8   UIFoundation                  	0x0000000188560c4c _NSFastFillAllLayoutHolesForGlyphRange + 1504 (NSLayoutManager_Private.m:5401)
9   UIFoundation                  	0x0000000188597244 -[NSLayoutManager enumerateLineFragmentsForGlyphRange:usingBlock:] + 84 (NSLayoutManager.m:3041)
10  UIKit                         	0x00000001886fb7fc __38-[UITextView _rectForScrollToVisible:]_block_invoke + 156 (UITextView.m:2322)
11  UIFoundation                  	0x00000001885976f0 -[NSLayoutManager(TextLocking) coordinateAccess:] + 64 (NSLayoutManager.m:3251)
12  UIKit                         	0x00000001886fb614 -[UITextView _rectForScrollToVisible:] + 248 (UITextView.m:2319)
13  UIKit                         	0x0000000188f77e68 -[_UITextViewRestorableScrollPosition initWithTextView:] + 160 (UITextView.m:4044)
14  UIKit                         	0x0000000188f779dc +[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] + 68 (UITextView.m:3980)
15  UIKit                         	0x0000000188f6f81c -[UITextView setContentOffset:] + 84 (UITextView.m:1320)
16  AsyncDisplayKit               	0x0000000100960938 -[ASTextKitComponentsTextView setContentOffset:] + 60 (ASTextKitComponents.mm:67)
17  UIKit                         	0x000000018895a71c -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60 (UIScrollView.m:6273)
18  UIKit                         	0x000000018871432c -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 460 (UIScrollView.m:5484)
19  UIKit                         	0x0000000188714120 -[UIScrollView removeFromSuperview] + 40 (UIScrollView.m:1570)
20  UIKit                         	0x000000018862c924 -[UIView dealloc] + 952 (UIView.m:2803)
21  Foundation                    	0x0000000183e229d0 -[NSConcretePointerArray replacePointerAtIndex:withPointer:] + 192 (NSPointerArray.m:458)
22  AsyncDisplayKit               	0x0000000100947420 -[ASRunLoopQueue processQueue] + 536 (ASRunLoopQueue.mm:468)
23  CoreFoundation                	0x0000000183484728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1620)
24  CoreFoundation                	0x00000001834824cc __CFRunLoopDoObservers + 372 (CFRunLoop.c:1716)
25  CoreFoundation                	0x00000001834828fc __CFRunLoopRun + 928 (CFRunLoop.c:2558)
26  CoreFoundation                	0x00000001833acc50 CFRunLoopRunSpecific + 384 (CFRunLoop.c:2814)
27  GraphicsServices              	0x0000000184c94088 GSEventRunModal + 180 (GSEvent.c:2245)
28  UIKit                         	0x000000018869a088 UIApplicationMain + 204 (UIApplication.m:3772)
29  Artstel                       	0x00000001000a7f8c main + 56 (MessagesView.swift:19)
30  libdyld.dylib                 	0x0000000182f4a8b8 start + 4 (start_glue.s:78)

MessagesView.swift is our code, but I doubt it has any connection with the issue:

override init() {
        loader = ASDisplayNode { () -> UIView in
            let view = UIActivityIndicatorView(activityIndicatorStyle: .gray)
            view.startAnimating()
            return view
        }
        
        super.init()
        baseInit()
    }

@Shaninnik
Copy link

Seems like there was similar issue #860 that was already addressed by #915 but somehow it continues to crash.

@Labun
Copy link

Labun commented Aug 3, 2018

I've got exactly the same crash on iOS 9/10. I think it started after I've added ASEditableTextNode to the cell in ASTableNode. Any fix or workaround?

@nixzhu
Copy link
Contributor

nixzhu commented Aug 13, 2018

Same crash for iOS 10, with ASEditableTextNode in cell node in ASTableNode. If the table node's content height is large enough (maybe more than 5000 points), crash happened after pop the view controller.

@lamlv2305
Copy link

I don't know exactly the problem of setContentOffset , but I don't have any crashes after removed attributedPlaceholderText of ASEditableTextNode.

It can be a problem with ASEditableTextNode deallocate.

@huangxinyu1213
Copy link

huangxinyu1213 commented Nov 16, 2018

This problem is getting more and more worse in our recently releases in iOS9 and iOS10.

So I fork a version of 2.6(because of supporting iOS8), and revert the code of ASEditableTextNode and ASTextKitComponents to 2.5, and resolved this bug.

@maicki
Copy link
Contributor

maicki commented Nov 16, 2018

@huangxinyu1213 Hey, what code of ASEditableTextNode / ASTextKitComponents did you have to revert to resolve the bug?

@Shaninnik
Copy link

Can confirm that this is top 1 crash for our app. One of the deallocated view controllers has a lot of ASEditableTextNodes inside scroll view that is inside ASPagerNode

@huangxinyu1213
Copy link

@maicki I just replace all ASEditableTextNode and ASTextKitComponents code with v2.5, and everything is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants