Skip to content

cargo flamegraph fails on macOS with "Unpaired tag: frame" #476

Backlog

Description

@h3xOo

Reproduction

cargo init foo
cd foo
echo "[profile.release]\ndebug = true" >> Cargo.toml
cargo flamegraph

Actual output

Starting recording with the Time Profiler template. Launching process: foo.
Ctrl-C to stop the recording
Hello, world!
Target app exited, ending recording...
Recording completed. Saving output file...
Output file saved as: cargo-flamegraph.trace
Error: unable to collapse generated profile data

Caused by:
    Unpaired tag: frame

Meta

Affected versions:

  • 0.6.15 installed via cargo install --git https://github.com/flamegraph-rs/flamegraph.git
  • 0.6.15 installed via cargo binstall flamegraph

OS:

  • macOS Arm 27.2.1,
  • cargo 1.100.0 (3acc79c0c 2026-11-05)
  • xctrace version 27.2 (27B52)

Activity

  1. djc commented on Nov 24, 2026

    @djc
    Contributor

    I won't have time to look into this soon, but happy to review a PR.

  2. ScaredStorm commented on Nov 27, 2026

    @ScaredStorm

    I ran into the same issue. Since flamegraph is using xctrace I also went to check it into Instruments, which obviously also failed.

    After some digging it looks like Apple made some changes that requires binaries to have a get-task-allow entitlement in order to properly attach.

    I tried the following:

    cat > /tmp/debug-entitlements.plist <<'EOF'
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
     "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
    <plist version="1.0">
    <dict>
        <key>com.apple.security.get-task-allow</key>
        <true/>
    </dict>
    </plist>
    EOF
    

    and

    codesign --force --sign - --entitlements /tmp/debug-entitlements.plist ./target/release/binary
    

    which seems to work.

  3. pedantic79 commented on Nov 28, 2026

    @pedantic79

    Flamegraph works for me when I built it with jonhoo/inferno#377 for the inferno dependency.

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