Skip to content

Incompatibility with Dopamine's "Spinlock Panic Fix" #1137

@opa334

Description

@opa334

First of all, as I explained here, the logic for finding the dyld header is sort of wrong, and on Dopamine 2.4 - 2.4.1 it finds the wrong header. I have added a workaround for this in Dopamine 2.4.2 by removing the magic values of the wrong mach headers, but even with this fixed, I'm still seeing the process crash afterwards.

Basically I fix a stock issue with a race condition by making a private mapping of all dyld_shared_cache __TEXT on top of the (originally shared) mapping inside dyld before anything ever accesses the dyld_shared_cache. For some reason this causes the process that Frida attempts attach to, to crash. I have tried debugging this for a while now, but haven't been able to figure out what causes this, it is unlikely this issue is caused by Dopamine, since what it does is "simple" and mandatory to have the system be stable.

Dopamine logic that triggers this crash: https://github.com/opa334/Dopamine/blob/2.x/BaseBin/dyldhook/src/spinlock_fix.c

Crash log: https://pastebin.com/HcbRKiKV

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