The swift-backtrace binary is an external helper program invoked by the Swift runtime when a crash occurs.
Why an external binary?
When a program crashes, it is in an unstable state. Running an external process ensures:
- The crash process is not interfered with (allowing system-wide crash reporters to work).
- The backtracer can safely perform complex tasks like memory allocation and file I/O required for symbolication.
Usage Note:
You should not attempt to run swift-backtrace manually. It has platform-specific requirements and is designed to be triggered automatically by the Swift runtime. If you need to specify a custom version, use the swift-backtrace key in the SWIFT_BACKTRACE environment variable.