[Crashpad/iOS] Harden CrashHandler against crashes during intermediate dump processing

https://crrev.com/c/3399252 fixed a heap overrun in iOS intermediate
dump processing.

This is a follow-up to that change to harden `CrashHandler` against
similar crashes:

1) Ensure the destructor of `ScopedAlternateWriter` is invoked
   to restore `InProcessHandler::writer_` state before processing
   the intermediate dump (otherwise, a signal raised by the intermediate
   dump handler would dereference the empty `std::unique_ptr` in
   `InProcessHandler::writer_`).

2) Harden `InProcessHandler` to check if `writer_` is empty before
   handling signals or exceptions

Change-Id: I1e63a496395b26681632302e8915b4433897037a
Bug: 391
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3401766
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2 files changed
tree: 593674e428ce7915d799d43d1c7ddbf3d14a6f25
  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