Skip to content

Exception stack traces on macOS/iOS are in a bad state #4895

Open
@s-ludwig

Description

@s-ludwig

At least since the change to use "atos" for resolving stack frames, the state of printing call stacks is pretty disastrous on macOS, regardless of the -g switch:

  1. Printing an exception stack trace will freeze the calling thread for an extended period of time (can be a few hundred ms), which means that a process that logs/prints a larger number of exceptions can easily become unusable or would be a very easy DDoS target.

  2. For x86-64 builds in particular, the stack unwinding functionality appears to be broken and only the topmost stack frame is being displayed.

  3. Resolving file names and line numbers doesn't seem to work at all.

  4. Stack traces generated for system crash reports usually stop at the first extern (D) function (I'm not sure whether this might be a simple issue of --frame-pointer, I'll have to check whether that makes a difference)

  5. On some systems atos isn't available at all

In comparison, dmd appears to work fine (stack traces with symbols working regardless and file/line number working correctly when passing -g.

This has been an issue that wanted to dig deeper into for a while now, but never really got to it, so I just wanted to at least get this written down to maybe start a discussion.

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