Closed sentry-io[bot] closed 3 years ago
Based on https://github.com/wordpress-mobile/WordPress-iOS/issues/6341#issuecomment-267699447 I'm thinking this could be related to #6341. Just a hunch but this crash is not specifically related to notifications so probably not the case here.
42-day impact: 346 (new crash) Users affected in the last 42 days: 75 First seen in: 13.2 Limited to: iOS 13.0 and above https://sentry.io/share/issue/a1dc6687b074453a97779c636624a438/
Sentry issue: WORDPRESS-IOS-1TEK
Sentry issue: WORDPRESS-IOS-1TBF
Sentry issue: WORDPRESS-IOS-1MG2
54-day impact: ~10 per day Users affected in the last 54 days: 473 First seen in: 13.2.0.3.11 (1 report), then 13.2.3.1 Limited to: iOS 13.0 and above https://sentry.io/share/issue/a1dc6687b074453a97779c636624a438/
25-day impact: ~3 per day Users affected in the last 25 days: 37 First seen in: 13.2.3.1 Limited to: iOS 13.0 and above https://sentry.io/share/issue/eae9828e39b8434a9b90ed0197d39c6c/
26-day impact: ~14 per day Users affected in the last 26 days: 206 First seen in: 13.2.3.1 Limited to: iOS 13.0 and above https://sentry.io/share/issue/433fa5a96e6d49f8a25b1e15ab6600f3/
42-day impact: ~10 per day Users affected in the last 42 days: 265 First seen in: 13.2.0.6 Limited to: iOS 13.0 and above https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
@aerych can you help narrow this one down? Do you think it's related to #6341? I tried to figure out from the crash reports I could see how to trigger it and I thought of publishing posts and interacting with the post-publish view screen and everything worked well for me there (PostPostViewController
is the most common transaction recorded for this crash). I tried viewing posts different ways in the Reader and interacting with posts there. I tried opening notifications, backgrounding the app, then changing the system date and reopening notifications. No crashes for me.
This is the most popular result in a search for that error: https://stackoverflow.com/q/21870680, is it helpful?
@aerych can you help narrow this one down?
I'll give it a shot! :)
Do you think it's related to #6341?
π€ I'm thinking its a different issue.
(PostPostViewController is the most common transaction recorded for this crash)
Hmm. How can I see this. Just scrolling through several of the reports I'm not seeing it but I do see PostListViewController in the breadcrumbs for every one.
What follows is a stream of thought as I explored the issue:
I've looked through some of there reports and many are showing <redacted>
for WordPress calls in the stack traces. At the top, Sentry says There was 1 error encountered while processing this event
and if you expand for details it says A required debug information file was missing
. Examples # # #. (cc @jkmassel in case somethings off with our sentry config that we need to sort). However, I have found a few like this one that point to something related to -[WPTableViewHandler controllerDidChangeContent:]
.
I'm thinking its probably similar to the glitch we see in https://github.com/wordpress-mobile/WordPress-iOS/issues/11384 which has been a long standing and very tricky glitch to squash. :(
WPTableViewHandler is used by the Reader in:
ReaderSiteSearchViewController.swift
ReaderSearchSuggestionsViewController.swift
ReaderTableContent.swift
ReaderStreamViewController.swift
ReaderFollowedSitesViewController.swift
ReaderSavedPostsViewController.swift
ReaderCommentsViewController.m
In Comments:
CommentsViewController.m
In Posts and Pages
PostListViewController.swift
AbstractPostListViewController.swift
RevisionsTableViewController.swift
PageListTableViewHandler.swift
PageListViewController.swift
And in Notifications
NotificationsViewController.swift
So there's a lot of potential triggers to test for and unfortunately the stacktrace doesn't make it clear. The breadcrumbs are interesting in that PostListViewController
seems to be accessed within a few seconds of the crash, at least in the couple of dozen crash reports I've looked through.
What we know from the stacktrace, is that we have saved something to core data that is changing the number of rows in a table view, the table view is trying to animate the change, and for some reason when the cell animation finishes the number of rows in the tableview does not match the number that is expected.
Assuming that something happening with the post list is the trigger, what would be the options? Since we know its due to a changing row count we know we're changing data. So this could be related to syncing, publishing or trashing a post--activities that would change the row count. Based on the breadcrumbs we can see that the crash can happen some time after visiting and even leaving the post list, so maybe there is some network latency? The interesting thing about this, is if a user leaves the post list, the PostListViewController should be deallocated, so it seems like there would need to be something going on that would keep it in memory longer than expected.
Theories:
I'm liking multiple conflicting API results as a potential trigger. I'm not sure about a reference to the post list being stuck in memory. I took a quick look and it looks like we're properly deallocating if leaving the list while syncing, but there could be something hidden elsewhere yet to be found.
I'll poke at it a bit more. For now this is my best guess.
Hmm. How can I see this. Just scrolling through several of the reports I'm not seeing it but I do see PostListViewController in the breadcrumbs for every one.
Go to https://sentry.io/share/issue/a1dc6687b074453a97779c636624a438/ > Details (top right) > Tags (in the menu near top middle of the page), then look for the transaction
box.
Ah! Looks like there are several related issue threads and I was just looking in different ones. Thanks!
Looking through the breadcrumbs in that thread, I still see the post list recently accessed. It looks like at least some of the behavior is that the user has visited the post list, then changed tabs. Then opened the editor via the edit button. The only way to view the post post is to publish a new post, which is an action that would change the row count in the post list, so this is at least consistent with the theory above... something is wonky with the counts in the postlistviewcontroller.
I've spent a little more time digging through the PostListViewController and AbstractPostListViewController code, focusing on syncing and refreshing logic, anything that directly referenced the TableViewHandler's NSFechtedResultsController, and anywhere an NSManagedObjectContext was saved. So far nothing has stood out to me as a possible candidate for the glitch. :(
This came up in beta testing for 13.5.
Adding some notes from another discussion:
I think this is related to the placeholder loading indicators that flash while the posts are loading. When those are visible and you insert a new post, the results controller learns about the newly created post and wants to show the extra row. But since the table is using the βghostβ handler instead of a real data source, it will always show the 10 mock items, causing the crash.
(internal reference: p5T066-136-p2#comment-3736, @koke)
I took a crack at this today starting from the assumption that we are modifying the tableView
rows outside of WPTableViewHandler
. I could not find anything that does that in AbstractPostListController
and NotificationsViewController
.
I agree with Eric's conclusion in https://github.com/wordpress-mobile/WordPress-iOS/issues/12671#issuecomment-545205778. I just failed to find the cause.
In the case of NotificationsViewController
, the WPTableViewHandler.resultsController
is initialized in:
I theorized that this could have caused the crash because the table view is in the middle of updating itself and we're also about to fetch and update the data in WPTableViewHandler.resultsController()
. I couldn't prove the crash so I concluded that I was wrong here.
In WPTableViewHandler.controller:didChangeObject
, we have this:
I thought that this may be the cause of the wrong row counts. It seems to be doing things right after a few minutes of staring at it. I think these are old code that can be removed though.
@shiki do you think we could close this one with #12974 ?
@aerych We're not sure yet as we found others that do not fit the pattern (i.e. same row counts). But they were tricky to fix. We were hoping to fix most of them with #12974. And then someone (or we) can investigate later when there is less noise in Sentry.
It seems that the fix @shiki and I worked has produced some good results for the crash related to the ghost cells.
However, there are still some occurrences related to other parts of the app crashing due to similar issues. I wonder how we should procceed: keep this issue open and investigating the other occurences? Open a new one?
I vote for a new issue to investigate the hangers-on. π
I take that back, let's keep this issue open for context unless we find an easy way to separate out the occurrences still happening.
NSInternalInconsistencyException attempt to insert row 0 into section 0, but there are only 0 sections after the update
Events in the last 90 days: 20,000 Users affected in the last 90 days: 4,700 https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
NSInternalInconsistencyException Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (40) must be equal to the number of rows contained in that section before the update (39), plus or minus the number of rows inserted or deleted from that section (1 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).
Events in the last 90 days: 1,500 Users affected in the last 90 days: 593 https://sentry.io/share/issue/afaa0dc78bdc43a9a936bacd4a915da7/
Past issues which also mention extremely similar error messages: #3966, #5089.
Raising in priority due to the frequency of crashes (20k+).
I searched Sentry for "Invalid update: invalid number of rows in section 0."
and found 489 crashes recorded for that error in 14.3.0.3 since it was released 17d ago on 2020-03-09.
WORDPRESS-IOS-1MG2 Events in 14.3.0.3 since it was released 18d ago on Mar 9: 950 Total events in the last 90 days: 20000 Users affected in the last 90 days: 4700 First seen: Jul 30, 2019 1:05:32 PM UTC in 13.2.0.6
Note: about 92% of the crashes recorded in the last 90d have been in iOS 13+.
Events in the last 90d: 29,000 Events in the last 11d for 14.9: 355 in 14.9 since it was released on 2020-06-01 Users affected in the last 90d: 6,100 https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
I ran into a verrrrrry similar crash to this one while beta testing with WPiOS 15.2.0.0 logged in as testuser0313 and the crash happened right after I tapped "Log Out" (although I'm not sure whether logging out is relative). Other things I did prior to logging out were I unfollowed a site in the Reader and I viewed a post in the editor and left without making changes.
The crash I saw was recorded in https://sentry.io/share/issue/514b17f7aaba415ab85e18ba60bdfb21/ and has a super similar error message except the various numbers in it are a little different.
NSInternalInconsistencyException Invalid update: invalid number of rows in section 1. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (11), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).
(entity: ReaderPost; id: 0x9a292de5da71b21a Here is my entry into Basil Rene LCPP (The Life Captured Photo Prompt) with the topic of";
crossPostMeta = nil;
dateSynced = nil;
"date_created_gmt" = "2020-06-30 16:46:17 +0000";
featuredImage = "https://ceenphotography.files.wordpress.com/2020/06/050717tree.jpg";
feedID = 14846827;
feedItemID = 2784434960;
globalID = 7de0f10ba1b903811f11835a608b1700;
inUse = 0;
isBlogAtomic = 0;
isBlogPrivate = 0;
isExternal = 0;
isFollowing = 0;
isJetpack = 0;
isLiked = 0;
isLikesEnabled = 1;
isReblogged = 0;
isSavedForLater = 0;
isSharingEnabled = 1;
isSiteBlocked = 0;
isWPCom = 1;
likeCount = 38;
"mt_excerpt" = nil;
password = nil;
pathForDisplayImage = nil;
permaLink = "http://ceenphotography.com/2020/06/30/lcpp-the-life-captured-photo-prompt-unusual-toppings/";
postAvatar = nil;
postID = 45926;
postTitle = "LCPP (The Life Captured Photo Prompt): Unusual Toppings";
primaryTag = "cee-neuner";
primaryTagSlug = "cee-neuner";
railcar = nil;
readingTime = 0;
remoteStatusNumber = 0;
score = nil;
siteID = 59080076;
siteIconURL = "https://secure.gravatar.com/blavatar/7c12deab9a9892885129f1dac901ef58";
sortDate = "2020-06-30 16:46:17 +0000";
sortRank = 615228377;
sourceAttribution = nil;
status = publish;
"suggested_slug" = nil;
summary = "Here is my entry into Basil Rene LCPP (The Life Captured Photo Prompt) with the topic of\U00a0 Unusual Toppings. I\U2019ve put together a list of challenges \U2026";
tags = "blue, colorful, tree, building, photography, green, posts, saddles, wind turbine top, Cee Neuner, sloped roof, LCPP (The Life Captured Photo Prompt) - Basil Rene, photo, white";
topic = "0x9a292de5d451b262
Events in the last 90d: 34,000 Users affected in the last 90d: 5,700 Events in the latest release: 9,037 (15.3 released 13d ago on 2020-07-24) https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
This one's looking strong and steady. It's worth investigating again.
This crash came up in beta tester feedback:
Started the app and it immediately crashed.
Crash Feedback (Aug 7, 2020 at 11:38 PM) Jim Grey - WPiOS 15.4.0.0 iPhone 6S iOS 13.6
(internal reference: 3220643-zen)
Meta: the Platform9 team investigated how some NSInternalInconsistencyException crashes were being grouped in Sentry and made some updates. It should only affect new crashes but I thought it was worth a mention.
(internal reference: paaHJt-1jm-p2)
Events in the last 90d: 8,800 Users affected in the last 90d: 5,500 WORDPRESS-IOS-1MG2: https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
We're seeing an uptick in this issue so we should investigate it again even though the issue may have some different crashes tracking in one issue in Sentry. If you investigate and find that, the recommendation is to pick anything that seems like it will fix any of the crashes being tracked in this issue.
Events in the last 90d: 11,000 Users affected in the last 90d: 6,100 WORDPRESS-IOS-1MG2: https://sentry.io/share/issue/63cec30b4c7a49ff8271b6e61cfa44a2/
Note: actually, it looks like these issue didn't stop but instead they've been moved to different Sentry issues. See internal reference paaHJt-1jm-p2#comment-3488.
Now I'm not sure whether I should have closed this one. @aerych could you help me confirm? A search for Invalid update: invalid number of rows in section 0. The number of rows contained in an existing
actually pulls up two other issues (https://github.com/wordpress-mobile/WordPress-iOS/issues/6341 and https://github.com/wordpress-mobile/WordPress-iOS/issues/3070) and I'm wondering if I should escalate those instead of re-opening this one. π€
I think this moved to https://github.com/wordpress-mobile/WordPress-iOS/issues/15367.
Sentry Issue: WORDPRESS-IOS-1FZ2
NSInternalInconsistencyException: Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (10) must be equal to the number of rows contained in that section before the update (10), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). ?, in <redacted> ?, in <redacted> ... (26 additional frame(s) were not displayed)