Repository navigation
fix: find a fired timer again before the list is touched after its callback - #1484
Merged
roflmuffin merged 2 commits intoNov 8, 2026
Merged
Conversation
β¦llback RunFrame kept using the index it had before the callback, both to erase the timer and to continue the loop. A callback that kills another timer earlier in the list shifts the list: the erase dropped a different timer and left the fired one, already deleted, in the list, so the next frame read freed memory; two kills from one callback moved the index past the end; a repeating timer behind schedule ran twice in one frame.
roflmuffin
approved these changes
Nov 8, 2026
roflmuffin
enabled auto-merge (squash)
November 8, 2026 11:26
This was referenced Nov 12, 2026
This was referenced Nov 16, 2026
This was referenced Nov 23, 2026
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.
A timer callback that kills another timer sitting earlier in the list shifts the list, and
RunFramekept using the index it had before the callback: it erased the wrong entry and left the fired, already deleted timer in the list, so the next frame read freed memory; two kills from one callback moved the index past the end; a repeating timer behind schedule ran twice in one frame.The loop now finds the fired timer again when its index no longer points at it, then erases or reschedules it there and continues below it.
Four tests in Tests.Native cover the cases; on main three of them take the server down and the fourth sees a second run in the same frame.
Possibly the crash reported in #981.