Skip to content

Commit 2b3040f

Browse files
authored
fix(native): add another crashpad benefit on macOS to the backend tradeoffs (#13535)
fixes getsentry/sentry-native#1213 Also cleaned up the remaining text a bit
1 parent ffed3d6 commit 2b3040f

File tree

1 file changed

+9
-8
lines changed
  • docs/platforms/native/advanced-usage/backend-tradeoffs

1 file changed

+9
-8
lines changed

docs/platforms/native/advanced-usage/backend-tradeoffs/index.mdx

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Currently, `crashpad` is the default on all desktop platforms because it
1414
* has an external `handler` process that allows for external snapshots and sending crash reports immediately (instead of on the next successful start of your application)
1515
* further, snapshotting, report management, and uploading outside the crashed process are safer because the `crashpad_handler` is not affected by any corruptions that led to a crash
1616
* supports more error types on [Linux](/platforms/native/advanced-usage/signal-handling/#signals-of-interest) and Windows (`abort()` and other `fast-fail` crashes, handling of heap corruptions)
17+
* on macOS, the `crashpad_handler` will receive `EXC_CRASH` Mach exceptions, which the kernel generates during process exit if a terminal POSIX signal hasn't been handled. None of the two other backends will catch this exception.
1718
* is more maintained upstream (although most changes affect new platforms like Fuchsia)
1819
* is the primary target for Sentry-developed extensions to the upstream implementation of backend handlers (most of which aren't a particular upside vs. the other backends, but changes to reach parity), including
1920
* client-side stack traces (this is currently not available on `breakpad`)
@@ -22,12 +23,12 @@ Currently, `crashpad` is the default on all desktop platforms because it
2223
* HTTP proxy support
2324
* GCC and MinGW support
2425
* `FirstChanceHandler` on Windows and extension of its synchronization to support Sentry hooks
25-
* cooperation with Epic's Easy Anti Cheat
26+
* cooperation with Epic's Easy Anti-Cheat
2627
* CMake build scripts (some users use our backend handler forks solely because of this reason)
2728

2829
### When shouldn't I use the `crashpad` backend?
2930

30-
Sentry decided on `crashpad` as the default on all platforms because there are a lot of upsides. However, there are use cases where `crashpad` cannot be used or makes distribution or deployment much harder. We provide other backends for situations when
31+
Sentry decided on `crashpad` as the default on all platforms because it offers numerous advantages. However, there are use cases where `crashpad` cannot be used or makes distribution or deployment much harder. We provide other backends for situations when
3132

3233
* you cannot package or deploy an additional executable (the `crashpad_handler`)
3334
* you cannot allow a secondary process to connect via `ptrace` to your application (AWS Lambda, Flatpak-, Snap-Sandboxes)
@@ -44,15 +45,15 @@ When your deployment scenario should wait for the `crashpad_handler` to finish i
4445
Both backends are comparable in how they differ from `crashpad`. However, there are also considerable differences between the two:
4546

4647
* `inproc` only provides the backtrace of the crashing thread. `breakpad` records all threads in the minidump.
47-
* similar to `crashpad`, `breakpad` uses the lowest level error handling mechanism on each platform (macOS: mach exception ports, Windows: `UnhandledExceptionFilter`, Linux: signal handlers), it does cover a smaller range of errors, though as mentioned above.
48-
* `inproc` uses signal handling on macOS, meaning you only get a `POSIX` compatibility layer over mach exception ports. It relies on the same mechanisms as `breakpad` on Windows and Linux.
48+
* similar to `crashpad`, `breakpad` uses the lowest level error handling mechanism on each platform (macOS: mach exception ports, Windows: `UnhandledExceptionFilter`, Linux: signal handlers), it does cover a smaller range of errors, though, as mentioned above.
49+
* `inproc` uses signal handling on macOS, meaning you only get a `POSIX` compatibility layer over Mach exception ports. It relies on the same mechanisms as `breakpad` on Windows and Linux.
4950
* as a result of choosing signal handling on macOS, `inproc` is currently broken on macOS since Apple eliminated unwinding from signal handlers
5051
* `inproc` is exceptionally lightweight and written entirely in C, meaning it does not rely on a weighty C++ runtime library, which is also more often affected by ABI incompatibilities
51-
* `breakpad` generates minidumps (like `crashpad` does), whereas `inproc` follows the Sentry event structure and primarily defers to the OS-provided unwinder and symbolication capabilities. Sentry processing infrastructure can - potentially - extract more information from the provided minidump than from only a stack trace and registers. However, it also means that the crash context inside the minidump will be opaque until processed in the backend. In contrast, if required, a local `relay` instance (or another application-level proxy) could process an entire `inproc` event with only JSON parsing capabilities.
52+
* `breakpad` generates minidumps (like `crashpad` does), whereas `inproc` follows the Sentry event structure and primarily defers to the OS-provided unwinder and symbolication capabilities. Sentry processing infrastructure can extract more information from the provided minidump than from just a stack trace and registers. However, it also means that the crash context inside the minidump will remain opaque until it is processed in the backend. In contrast, if required, a local `relay` instance (or another application-level proxy) could process an entire `inproc` event with only JSON parsing capabilities.
5253

5354
### So when do I choose `inproc`?
5455

55-
`inproc` is currently the backend of choice for `Android` because it allows us to bundle it with our fork of the platform unwinder `libunwindstack` that provides a complete interface for unwinding and symbolication (rather than relying on the minimal user-space interface). This enables us to support a broad range of Android versions. In addition, stack walking on-device on Android is preferred since we don't have all system symbols available for server-side symbolication. A [best-effort symbol collection exists](https://github.com/getsentry/symbol-collector), but that'll never be as reliable as stackwalking on-device.
56+
`inproc` is currently the backend of choice for Android because it allows us to bundle it with our fork of the platform unwinder, `libunwindstack`, which provides a complete interface for unwinding and symbolication (rather than relying on the minimal user-space interface). This enables us to support a broad range of Android versions. Additionally, stack walking on-device on Android is preferred since we do not have access to all system symbols for server-side symbolication. A [best-effort symbol collection exists](https://github.com/getsentry/symbol-collector), but that'll never be as reliable as stackwalking on-device.
5657

5758
`inproc` is the right choice if you
5859

@@ -63,12 +64,12 @@ Both backends are comparable in how they differ from `crashpad`. However, there
6364

6465
### Summary
6566

66-
If you dive into the details, you will find many trade-offs in the selection of backends. The above merely provides a first overview. Further, the above is only a snapshot of the current capabilities, where some trade-offs are incidental and do not follow a particular strategy or technological necessity. The primary reason for providing multiple backends is to cover as many user scenarios as possible, which requires a bit of insight if you decide to deviate from the defaults.
67+
If you dive into the details, you will find many trade-offs in the selection of backends. The above provides only a preliminary overview. Further, the above is only a snapshot of the current capabilities, where some trade-offs are incidental and do not follow a particular strategy or technological necessity. The primary reason for providing multiple backends is to cover as many user scenarios as possible, which requires some insight if you decide to deviate from the defaults.
6768

6869
Sentry suggests the following sequence for your backend evaluations:
6970

7071
* `crashpad` (default)
7172
* `breakpad`
7273
* `inproc`
7374

74-
from most feature-complete to least, where a step down should only be triggered by environmental inhibitors. With the above, you now have exemplary decision points that can help you before you start the evaluation of your error reporting scenario.
75+
from most feature-complete to least, where a step down should only be triggered by environmental inhibitors. With the above, you now have exemplary decision points to help guide you before you start evaluating your error reporting scenario.

0 commit comments

Comments
 (0)