Fix stack overflow crash on inline bot GIF results - #5
Open
fabwa wants to merge 1 commit into
Open
Conversation
Queue.async runs inline when already on the queue, so a synchronously emitted data part re-enters processFetchResult and overflows the stack (SIGBUS "excessive recursion" on the MediaBox-Data queue when opening inline bot GIF results, e.g. @tenorbot). Use justDispatch so each part is enqueued instead of nested.
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.
overtake/TelegramSwift#1437
Inline bot GIF results (e.g. @tenorbot) crash with SIGBUS "excessive recursion" on MediaBox-Data.
Queue.async runs inline on the queue, so processFetchResult -> updateRequests -> ranges.set emits the next part synchronously and re-enters processFetchResult through the next handler. Each chunk nests a frame instead of queueing.
Use justDispatch for the fetch next/error handlers so each part is a real queue hop.