Skip to content

Unable to attach to macOS process #1230

Open
@n8ta-msft

Description

@n8ta-msft

This code does not seem to work on a dotnet project out of the box.

using DataTarget dataTarget = DataTarget.AttachToProcess(Process.GetCurrentProcess().Id, true);

Fails with

Unhandled exception. Microsoft.Diagnostics.Runtime.ClrDiagnosticsException: Could not attach to process 55656, errno: 1
   at Microsoft.Diagnostics.Runtime.MacOS.MacOSProcessDataReader..ctor(Int32 processId, Boolean suspend)
   at Microsoft.Diagnostics.Runtime.DataTarget.AttachToProcess(Int32 processId, Boolean suspend)
   at Program.Main() in /Users/n8ta/SIG8/test_app/Program.cs:line 41

I have a repro project here https://github.com/n8ta-msft/clrmd-repro for arm64 macOS.
I suspect I need to sign with some specific entitlements but I have not been able to figure out which.

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