FFFF Darwin resolver fails to resolve _exit through nested reexports on iOS · Issue #3800 · frida/frida · GitHub
[go: up one dir, main page]

Skip to content

Darwin resolver fails to resolve _exit through nested reexports on iOS #3800

Open

Description

@tlyndou

Environment

  • Frida 17.23.3
  • macOS 27.0.1 (Apple Silicon)
  • Xcode 27.0
  • iOS 18.6 (arm64)

Issue

Attaching to a Simulator process crashes with EXC_BAD_ACCESS before user scripts execute.

Failed to attach: unexpected early end-of-stream

The crash occurs in ExitMonitor when Interceptor.attach() receives a NULL address for _exit.

Root cause

gum_darwin_module_resolver_find_export_by_mangled_name() fails to traverse nested dylib reexports:

libSystem.B → libsystem_sim_kernel → libsystem_sim_kernel_host → libsystem_kernel

Verified in the same process:

Symbol Frida resolver dlsym
exit Valid Valid
_exit NULL Valid (executable)
abort Valid Valid

Fix

Implemented recursive reexport resolution with cycle detection using an active (module, symbol) path.

Validated with 12 test cases, ASan/UBSan, and a patched Frida Gadget 17.23.3.

Result

Patched Gadget initializes successfully, resolves _exit correctly, executes JavaScript, and survives repeated attach/detach cycles.

Patch available for review. The standard CLI agent has not yet been tested.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0