fix: ignore invalid table row height updates - #1425
Open
banteg wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
During rapid
sendMessageDraftupdates, a live-draft row can be detached before a queued animated height update runs. The callback then reachesTableView.noteHeightOfRow(-1, true).In Telegram 12.8 build 282011, the faulting register is
x22 = -1, and the crash PC is the negative-indexbrk #1immediately beforeself.list[row]. The containing function resolves through these Objective-C selectors:currentContextsetDuration:setTimingFunction:noteHeightOfRowsWithIndexesChanged:That sequence uniquely matches
TableView.noteHeightOfRow(_:_:).The same four-frame signature appears in #1419: the three caller offsets move by
+0x170in build 282011, while the in-function trap moves by+0x208. That report is another instance of this bounds trap rather thanRadialProgressContainerView.init(frame:).Centralizing the guard here also covers direct callers that do not go through
TableRowItem.noteHeightOfRow(), which already rejects an index of-1.Fixes #1375.
Addresses #1419.
Validation
git diff --checkxcrun swiftc -parse packages/TGUIKit/Sources/TableView.swiftThe standalone TGUIKit build requires the repository's unpopulated
telegram-ios/SSignalKitsubmodule, so a full package build was not available in this checkout.