Skip to content

iPhone: fix tap crash (touch finger ids), 16 MB engine stack, named crash stacks, fading pad - #17

Merged
matthewcodergamer merged 1 commit into
masterfrom
render360/iphone-baseline-lowmem
Oct 9, 2026
Merged

matthewcodergamer merged 1 commit into
masterfrom
render360/iphone-baseline-lowmem

Conversation

@matthewcodergamer

Copy link
Copy Markdown
Owner
  • Tap crash: CInputSystem::FingerEvent used SDL's finger id directly as an array index and only checked the upper bound. In Safari the id is the DOM Touch.identifier, a large value that is often negative once truncated to int, so every tap wrote out of bounds. Fingers are now mapped to slots 0..9, and indices are bounds-checked.
  • Level load: STACK_SIZE raised to 16 MB for the engine thread, which handles deep level-load recursion.
  • Diagnostics: modules are linked with --profiling-funcs, so Safari's Wasm stacks name the failing function. That is how this crash was found. Worker crash stacks are kept whole.
  • Controller: fades to 16% opacity after 4 s without a touch, and any touch brings it back.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft


Generated by Claude Code

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

1 active deployment
portal-iphone-staging — 25879d90 Deployed Oct 9, 2026 by matthewcodergamer via Deploy iPhone staging page #314
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.

2 participants