commit | aed4e5d82c7082635a09bcc999760489e573b406 | [log] [tgz] |
---|---|---|
author | Raphael Kubo da Costa <kubo@igalia.com> | Tue May 13 22:09:30 2025 |
committer | Crashpad LUCI CQ <crashpad-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed May 14 18:35:44 2025 |
tree | 643a19fc20c644eef9b43260992b82a7f557cce9 | |
parent | 73eb9005339f63522224b25031e61869c8703a91 [diff] |
client: Add a tvOS version of CrashHandler, add tvOS support to tests tvOS as a platform is very similar to iOS, but one of significant difference is that Mach message passing (including mach_msg()) is not allowed. This means that it is completely impossible to handle Mach exceptions on tvOS. Consequently, we need a CrashHandler implementation that is entirely based on the POSIX signals API. Breakpad has had such an implementation for years [1], so some of the code was based on Breakpad's. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/breakpad/breakpad/src/client/ios/exception_handler_no_mach.cc In general terms: - GN: Most of the code in util/mach/ is not built on tvOS, and the mig calls are skipped altogether. The only allowed files at the moment are util/mach/mach_extensions.{cc,h}, which contain some constants and functions that are useful and allowed outside the Mach exception context. - CrashHandler: the code was split into multiple files for clarity. The user-visible API (i.e. the CrashpadClient calls) remains in crashpad_client_ios.cc, while the internal CrashHandler class was split into multiple files and classes. Namely, the common code handling NSExceptions and communication with InProcessHandler is part of CrashHandlerBase and the iOS and tvOS-specific implementations are in crash_handler_{ios,tvos}.{cc,h}. The tvOS CrashHandler code is basically a simplified version of the iOS one: we watch a lot of signals in Initialize() and call DumpExceptionFromSignal() when we get one (after which we call Signals::RestoreHandlerAndReraiseSignalOnReturn() and exit). - Tests: - Tests that checked for specific Mach exceptions needed a new tvOS-specific code path. We need to check for specific signal values where possible instead. - testRecursion() had to be skipped altogether. We cannot monitor Mach exceptions, and sigaltstack() is also forbidden on tvOS. This means there is no reliable way of monitoring a stack overflow as explained in the comment in code. Bug: 405140658, 351887716 Change-Id: I2f13a5788d8e5ac085b49716c43bb375d017ad35 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6421038 Reviewed-by: Justin Cohen <justincohen@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Raphael Kubo da Costa <kubo@igalia.com>
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.