Repository navigation
iPhone: fix tap crash (touch finger ids), 16 MB engine stack, named crash stacks, fading pad - #17
Merged
Conversation
With function names in the build, the iPhone crash finally resolved to: CInputSystem::FingerEvent <- TouchSDLWatcher <- SDL_PushEvent <- SDL_SendTouch <- Emscripten_HandleTouch. The earlier "~30 s" out-of-bounds crashes had the same frame indices: they were the player's taps. FingerEvent used SDL's finger id directly as the index into m_touchAccumX/Y and only checked the upper bound. SDL ids are arbitrary 64-bit values; Android gives 0,1,2..., but in a browser they are the DOM Touch.identifier, which on iPhone Safari is large. Truncated to int it is often negative, so every tap wrote outside the arrays. TouchSDLWatcher now assigns each live finger a slot 0..9 on down/motion and frees it on up; FingerEvent and GetTouchAccumulators reject anything outside 0..TOUCH_FINGER_MAX_COUNT-1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft
This branch was successfully deployed
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.
CInputSystem::FingerEventused SDL's finger id directly as an array index and only checked the upper bound. In Safari the id is the DOMTouch.identifier, a large value that is often negative once truncated toint, so every tap wrote out of bounds. Fingers are now mapped to slots 0..9, and indices are bounds-checked.STACK_SIZEraised to 16 MB for the engine thread, which handles deep level-load recursion.--profiling-funcs, so Safari's Wasm stacks name the failing function. That is how this crash was found. Worker crash stacks are kept whole.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft
Generated by Claude Code