ios: Fix up concurrency in DumpWithoutCrashing and exception handling.

Change signal, uncaught NSExceptions and Mach exception handlers to
prevent re-entrancy with a first-exception-wins approach to prevent
concurrent exceptions from trying to use the same cached intermediate
dump writer.  Uses compare-and-swap to either return early for reentrant
signals or to wait indefinitely for anything after the first fatal
exception.

Change the NSException handler generated from the Objective-C exception
preprocessor to not used the cached intermediate dump writer and
not use the same first-exception-wins logic. This is useful because the
Objective-C exception preprocessor is imperfect and may generate
intermediate dumps that are not followed by process termination.

Simplify DumpWithoutCrashing's ownership of its intermediate dump writer
to be thread safe.

Set a handler for SIGPIPE for applications that haven't already
ignored or set a handler for SIGPIPE.

Bug: crashpad:391
Change-Id: Ia8ae61d50be81910fa0af40325300441d9dc01b6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3401563
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
12 files changed
tree: 23959a0768c247f65dab3392006e22aa3b84e09c
  1. build/
  2. client/
  3. compat/
  4. doc/
  5. handler/
  6. infra/
  7. minidump/
  8. snapshot/
  9. test/
  10. third_party/
  11. tools/
  12. util/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .style.yapf
  18. .vpython
  19. AUTHORS
  20. BUILD.gn
  21. codereview.settings
  22. CONTRIBUTORS
  23. DEPS
  24. LICENSE
  25. navbar.md
  26. package.h
  27. README.md
README.md

Crashpad

Crashpad is a crash-reporting system.

Documentation

Source Code

Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.

Other Links