iOS 16 support - stalker-arm64: Refresh code_available after helper pass#1105
Closed
ignuslabs wants to merge 1 commit intofrida:mainfrom
Closed
iOS 16 support - stalker-arm64: Refresh code_available after helper pass#1105ignuslabs wants to merge 1 commit intofrida:mainfrom
ignuslabs wants to merge 1 commit intofrida:mainfrom
Conversation
gum_exec_ctx_ensure_inline_helpers_reachable can advance the code slab cursor, which leaves the caller's previously-computed code_available value stale. Refresh it from the slab so any subsequent budgeting reflects the true remaining space.
oleavr
requested changes
Apr 17, 2026
| /* Updating available code space matters if ensure_inline_helpers_reachable | ||
| * advances the code slab cursor/size but the caller reuses the previous | ||
| * code availability calculation. */ | ||
| code_available = gum_slab_available (&ctx->code_slab->slab); |
Member
There was a problem hiding this comment.
Hmm, given that gum_slab_available() has no side-effects, and code_available isn't used after this point in this function, I don't see how this patch helpers. Am I missing something?
Author
There was a problem hiding this comment.
Looks like AI slop from testing my bad
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.
@oleavr addressing the issue frida/frida#3719 part 1/2
Problem
gum_exec_block_maybe_create_new_code_slabsinvokesgum_exec_ctx_ensure_inline_helpers_reachableafter allocating new codeand slow slabs. That helper can advance the code slab cursor, but the
caller continues to use its previously-computed
code_availablevalue,which is now stale. Any subsequent logic that budgets against
code_availablewill operate on an out-of-date figure.Fix
Refresh
code_availablefromgum_slab_available(&ctx->code_slab->slab)immediately after the helper reachability pass, so downstream budgeting
reflects the true remaining space.
Testing
MACOS_CERTID=- makein the top-levelfrida tree, which drives the full gum + frida-core + gumjs build.
stalker-arm64test suite on arm64 hosts.