Skip to content

Fix stack overflow crash on inline bot GIF results - #5

Open
fabwa wants to merge 1 commit into
overtake:macos-11.14-releasefrom
fabwa:fix-mediabox-gif-recursion
Open

Fix stack overflow crash on inline bot GIF results#5
fabwa wants to merge 1 commit into
overtake:macos-11.14-releasefrom
fabwa:fix-mediabox-gif-recursion

Conversation

@fabwa

@fabwa fabwa commented Aug 19, 2026

Copy link
Copy Markdown

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.

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.
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

Successfully merging this pull request may close these issues.

1 participant