{"action":"created","issue":{"url":"https://api.github.com/repos/TextureGroup/Texture/issues/860","repository_url":"https://api.github.com/repos/TextureGroup/Texture","labels_url":"https://api.github.com/repos/TextureGroup/Texture/issues/860/labels{/name}","comments_url":"https://api.github.com/repos/TextureGroup/Texture/issues/860/comments","events_url":"https://api.github.com/repos/TextureGroup/Texture/issues/860/events","html_url":"https://github.com/TextureGroup/Texture/issues/860","id":309349214,"number":860,"title":"Occasional crashing in iOS10","user":{"login":"carlos-saraiva","id":10595362,"avatar_url":"https://avatars0.githubusercontent.com/u/10595362?v=4","gravatar_id":"","url":"https://api.github.com/users/carlos-saraiva","html_url":"https://github.com/carlos-saraiva","followers_url":"https://api.github.com/users/carlos-saraiva/followers","following_url":"https://api.github.com/users/carlos-saraiva/following{/other_user}","gists_url":"https://api.github.com/users/carlos-saraiva/gists{/gist_id}","starred_url":"https://api.github.com/users/carlos-saraiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlos-saraiva/subscriptions","organizations_url":"https://api.github.com/users/carlos-saraiva/orgs","repos_url":"https://api.github.com/users/carlos-saraiva/repos","events_url":"https://api.github.com/users/carlos-saraiva/events{/privacy}","received_events_url":"https://api.github.com/users/carlos-saraiva/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-28T12:39:27Z","updated_at":"2018-03-28T17:33:18Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nWe currently have an app in production that has an \"infinite\" scrollable video feed (with a paged scroller so there's only one video per page). Due to some performance issues when scrolling (because of AVPlayer playback starting) we have recently migrated that feed to use Texture (version 2.6 which is the latest CocoaPods version at the time of writing).\r\nIt consists of an ASTableNode with paging enabled, where each cell occupies one screen size. Each cell has various subnodes (like an ASVideoNode for video playback, an ASEditableTextNode to show the video description, but nothing I can see out of the ordinary).\r\n\r\nIt passed our internal testing so we've launched it to production, but once we did we noticed that some iOS 10 devices started having crashes (that we haven't yet been able to reproduce), with the following callstack:\r\n\r\nCrashed: com.apple.main-thread\r\n0  libobjc.A.dylib                0x18ca32f30 objc_msgSend + 16\r\n1  UIFoundation                   0x193d64a1c -[NSATSTypesetter actionForControlCharacterAtIndex:] + 116\r\n2  UIFoundation                   0x193d66fec -[NSATSGlyphStorage setGlyphRange:characterRange:] + 3128\r\n3  UIFoundation                   0x193d6294c -[NSATSTypesetter _ctTypesetter] + 276\r\n4  UIFoundation                   0x193d6bb14 -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 128\r\n5  UIFoundation                   0x193d63534 -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2316\r\n6  UIFoundation                   0x193d64af8 -[NSATSTypesetter layoutParagraphAtPoint:] + 160\r\n7  UIFoundation                   0x193dbaf08 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 3012\r\n8  UIFoundation                   0x193dbbda4 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 244\r\n9  UIFoundation                   0x193d65558 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 448\r\n10 UIFoundation                   0x193d5168c -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1116\r\n11 UIFoundation                   0x193d57d54 _NSFastFillAllLayoutHolesForGlyphRange + 1416\r\n12 UIFoundation                   0x193d887c0 -[NSLayoutManager ensureLayoutForBoundingRect:inTextContainer:] + 220\r\n13 UIKit                          0x194858918 __38-[UITextView _visibleRangeWithLayout:]_block_invoke + 112\r\n14 UIFoundation                   0x193d8e62c -[NSLayoutManager(TextLocking) coordinateAccess:] + 64\r\n15 UIKit                          0x19485885c -[UITextView _visibleRangeWithLayout:] + 144\r\n16 UIKit                          0x19485f49c -[_UITextViewRestorableScrollPosition initWithTextView:] + 100\r\n17 UIKit                          0x19485f04c +[_UITextViewRestorableScrollPosition restorableScrollPositionForTextView:] + 68\r\n18 UIKit                          0x194855704 -[UITextView setContentOffset:] + 80\r\n19 UIKit                          0x194144168 -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60\r\n20 UIKit                          0x193f0cd60 -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 448\r\n21 UIKit                          0x193f0cb60 -[UIScrollView removeFromSuperview] + 40\r\n22 UIKit                          0x193e2e14c -[UIView dealloc] + 1176\r\n23 Foundation                     0x18ea35a58 -[NSConcretePointerArray replacePointerAtIndex:withPointer:] + 176\r\n24 OurApp                        0x1007ce11c -[ASRunLoopQueue processQueue] (ASRunLoopQueue.mm:379)\r\n25 CoreFoundation                 0x18df957dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32\r\n26 CoreFoundation                 0x18df9340c __CFRunLoopDoObservers + 372\r\n27 CoreFoundation                 0x18df9389c __CFRunLoopRun + 1024\r\n28 CoreFoundation                 0x18dec2048 CFRunLoopRunSpecific + 444\r\n29 GraphicsServices               0x18f945198 GSEventRunModal + 180\r\n30 UIKit                          0x193e9b818 -[UIApplication _run] + 684\r\n31 UIKit                          0x193e96550 UIApplicationMain + 208\r\n32 OurApp                        0x10030b3bc main (main.m:16)\r\n\r\nThe callstack suggests that a scrollview with text (maybe the ASEditableTextNode) is disappearing and yet doing some layout calculations. However I don't really understand why this is happening, why it's crashing or why it's limited to iOS10 (and only occurs rarely). Since I can't reproduce it, I can't give a crashing example, but was hoping for some pointers to figure out what is going wrong.\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/TextureGroup/Texture/issues/comments/376970702","html_url":"https://github.com/TextureGroup/Texture/issues/860#issuecomment-376970702","issue_url":"https://api.github.com/repos/TextureGroup/Texture/issues/860","id":376970702,"user":{"login":"Adlai-Holler","id":2466893,"avatar_url":"https://avatars2.githubusercontent.com/u/2466893?v=4","gravatar_id":"","url":"https://api.github.com/users/Adlai-Holler","html_url":"https://github.com/Adlai-Holler","followers_url":"https://api.github.com/users/Adlai-Holler/followers","following_url":"https://api.github.com/users/Adlai-Holler/following{/other_user}","gists_url":"https://api.github.com/users/Adlai-Holler/gists{/gist_id}","starred_url":"https://api.github.com/users/Adlai-Holler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adlai-Holler/subscriptions","organizations_url":"https://api.github.com/users/Adlai-Holler/orgs","repos_url":"https://api.github.com/users/Adlai-Holler/repos","events_url":"https://api.github.com/users/Adlai-Holler/events{/privacy}","received_events_url":"https://api.github.com/users/Adlai-Holler/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T17:33:18Z","updated_at":"2018-03-28T17:33:18Z","author_association":"MEMBER","body":"Interesting! I don't believe we've seen this one before. Could you show the other threads as well `bt all`? \r\n\r\nFirst guess is that the typesetter is trying to retain the text view, which is illegal since it's deallocating.\r\n\r\nIn any case, iOS 10 seems to be doing something very silly during text view dealloc, and the workaround could be to set a `_deallocating` flag in the text view's `-dealloc`, and then override `-setContentOffset:` and `if (_deallocating) { return; }` under iOS 10 to avoid going into that text stuff."}}
{"actor":{"display_login":"Adlai-Holler"}}