When code raises an Objective-C exception, unwind the stack looking for
any exception handlers. If an exception handler is encountered, test to
see if it is a function known to be a catch-and-rethrow 'sinkhole'
exception handler. Various routines in UIKit and elsewhere do this, and
they obscure the exception stack, since the original throw location is
no longer present on the stack (just the re-throw) when Crashpad
captures the crash report. In the case of sinkholes, trigger an
immediate exception to capture the original stack.
The is an improvement over the alternative,
NSSetUncaughtExceptionHandler, which passes along the stack frames, but
not the stack memory contents and full exception context itself.
The details of what happens after a fatal exception is triggered are
unresolved in this CL. For now, simply call std::terminate.
This code was inspired by chromium/src/chrome/browser/mac/
exception_processor.mm.
Bug: crashpad:31
Change-Id: Ieebc6476a0507c466c8219c10f790ec0a624e58c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2125254
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
"library zx" used to be built in to fidlc, but is now a standalone file
(this is an SDK change). Update the build rules to adapt to this.
ref: https://logs.chromium.org/logs/crashpad/buildbucket/cr-buildbucket.appspot.com/8883567878548782112/+/steps/compile_with_ninja/0/stdout
FAILED: gen/fidl/include/fuchsia/sysinfo/c/client.cc gen/fidl/include/fuchsia/sysinfo/c/fidl.h gen/third_party/fuchsia/fidl/fuchsia.sysinfo/tables.c gen/third_party/fuchsia/fidl/fuchsia.sysinfo/intermediary_representation.json
python ../../third_party/fuchsia/runner.py ../../third_party/fuchsia/sdk/linux-amd64/tools/fidlc --c-header gen/fidl/include/fuchsia/sysinfo/c/fidl.h --c-client gen/fidl/include/fuchsia/sysinfo/c/client.cc --tables gen/third_party/fuchsia/fidl/fuchsia.sysinfo/tables.c --json gen/third_party/fuchsia/fidl/fuchsia.sysinfo/intermediary_representation.json --name fuchsia.sysinfo --files ../../third_party/fuchsia/sdk/linux-amd64/fidl/fuchsia.sysinfo/sysinfo.fidl
../../third_party/fuchsia/sdk/linux-amd64/fidl/fuchsia.sysinfo/sysinfo.fidl:7:7: error: Could not find library named zx. Did you include its sources with --files?
using zx;
^~
Bug: fuchsia:7802
Change-Id: I10c0109fd9621a19d72deb21a489c2041caeeeca
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2141019
Commit-Queue: Scott Graham <scottmg@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Bionic installs signal handlers which request crash
dumps from Android's debuggerd, but there are errors
in how signals which aren't automatically re-raised
are handled on Marshmallow (API 23).
Before requesting a dump, Bionic acquires a lock to
communicate with debuggerd and expecting imminent
death, never releases it.
While handling the dump request, debuggerd allows
the dying process to continue before
ptrace-detaching it. So, when Bionic manually
re-raises a signal, it is intercepted by debuggerd
and the dying process is allowed to live.
Bionic restores SIG_DFL for the signal it's just
handled, but if a different crash signal is later
recieved, Bionic attempts to reacquire the lock to
communicate with debuggerd and blocks forever.
Disable Bionic's signal handlers for these signals
on Marshmallow.
Bug: chromium:1050178
Change-Id: Ia1fc5a24161a95931684d092ba8fee2f0dfbbdbb
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2134513
Reviewed-by: Mark Mentovai <mark@chromium.org>
From cl/304219049:
Optimize C++11 range-based for loops where the variable is copied in
each iteration but it would suffice to obtain it by const reference.
This is only applied to loop variables of types that are expensive to
copy which means they are not trivially copyable or have a non-trivial
copy constructor or destructor.
To ensure that it is safe to replace the copy with a const reference,
the following heuristic is employed:
- The loop variable is const qualified.
- The loop variable is not const, but only const methods or operators
are invoked on it, or it is used as const reference or value argument
in constructors or function calls.
Change-Id: I5755eb523f60744079b0eb50424395079dcb0f02
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2132844
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This updates the comment from d3859d91fde0, which referred to 10.14.4 as
the OS version where kern.nx stoppoed working. Testing indicates that
kern.nx works in 10.13.6 17G12034 and 10.14.4 18E226. It does not work
in 10.14.5 18F132 or 10.15.4 19E266.
Bug: crashpad:295
Change-Id: Id2f222700fb626de707d60980fedbd79e62990e6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2127566
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Fixes the chromium presubmit error for UTF8String:
The use of -[NSString UTF8String] is dangerous as it can return null
even if |canBeConvertedToEncoding:NSUTF8StringEncoding| returns YES.
Please use |SysNSStringToUTF8| instead.
Bug: crashpad:31
Change-Id: Iaf939012ea9d342f6a01af58119cef962319aefe
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2119613
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Gather most of the necessary information for the exceptions snapshot.
Note that:
- The 'capture' portion of this CL will be moved out of the snapshot
interface and into a separate in-process dump to disk location.
- All of the pointer dereferences need to be wrapped in vm_read.
- The read-fast-and-dump logic in thread_snapshot may end up in a
different file completely, but until we pick a
serialization/deserialization method, keep it as-is.
Bug: crashpad:31
Change-Id: Iae4af436cddabd2302689b76c8a4574eb8e48c0e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2098744
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Gather most of the necessary information for the system snapshot.
Note that:
- The 'capture' portion of this CL will be moved out of the snapshot
interface and into a separate in-process dump to disk location.
- All of the pointer dereferences need to be wrapped in vm_read.
- The read-fast-and-dump logic in thread_snapshot may end up in a
different file completely, but until we pick a
serialization/deserialization method, keep it as-is.
Bug: crashpad:31
Change-Id: Iac82491fdb4a823163f02149f52a1e18e26fa9de
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2090173
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Most Android tests in Chromium's infrastructure are
launched from an APK, but that's not appropriate for
Crashpad where many things expect to be run in a
plain executable.
Bug: chromium:1050178
Change-Id: I6eeb3f5e4889193e5bbe2a3bad2cd99a18e970ba
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2112342
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Gather most of the necessary information for the thread snapshot.
Note that:
- The 'capture' portion of this CL will be moved out of the snapshot
interface and into a separate in-process dump to disk location.
- All of the pointer dereferences need to be wrapped in vm_read.
- The read-fast-and-dump logic in thread_snapshot may end up in a
different file completely, but until we pick a
serialization/deserialization method, keep it as-is.
Change-Id: I80ba323cb6a59ac0dd1bba9150d047ba83cc4dad
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2085572
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
This may help us debug some issues where the thread is failing to
suspend.
Bug: b/151318587
Change-Id: I0d2d539f769ebb1cdd71606e1d23d8fa66673879
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2103411
Commit-Queue: John Bauman <jbauman@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
afc5b798c7..4164a30562
$ git log afc5b798c..4164a3056 --date=short --no-merges --format='%ad %ae %s'
2020-03-12 agrieve Roll GN from fd3d768b..9499562d
2020-03-10 thakis roll gn 4166e9fbc1f..fd3d768bcfd4
2020-02-29 xiaohuic Clean up buildtools repo migration code
2020-02-24 thakis Revert "Roll libunwind 43bb9f8722..d999d54f4b"
2020-02-21 thakis Roll libunwind 43bb9f8722..d999d54f4b
2020-02-21 seblalancette Roll GN from 97cc440d..4166e9fb
2020-02-21 bpastene Reland: Pull libunwind, libcxx, libcxxabi from a different mirror.
2020-02-19 bpastene Revert "Pull libunwind, libcxx, libcxxabi from a different mirror."
2020-02-19 thakis Pull libunwind, libcxx, libcxxabi from a different mirror.
Created with:
roll-dep buildtools
Change-Id: Iedee7c3de93c08999b6da8ed8c31cc2c651c5c54
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2102907
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Gather most of the necessary information for the module snapshot.
Note that:
- The 'capture' portion of this CL will be moved out of the snapshot
interface and into a separate in-process dump to disk location.
- All of the pointer dereferences need to be wrapped in vm_read.
- The read-fast-and-dump logic in module_snapshot may end up in a
different file completely, but until we pick a
serialization/deserialization method, keep it in module_snapshot_ios.
Change-Id: Ie80c739c167634520d13ec920a29a80116aa3bfe
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2079196
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
f8f1182adb..c426ff98e1
$ git log f8f1182ad..c426ff98e --date=short --no-merges --format='%ad %ae %s'
2020-03-05 martin fix build issue with objc flags
2020-03-05 martin add extra flags to gn
2020-03-02 mark Don’t use the disappearing MSVC_PUSH_DISABLE_WARNING() macro
Created with:
roll-dep crashpad/third_party/mini_chromium/mini_chromium
Change-Id: I5d49cfe778e31c47b9e153107dc79abe2a726070
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2087554
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
The iPhone 8 simulator should be available in both Xcode 10.2 and Xcode 11.3.
BUG=None
Change-Id: I26570eb2406f67b3663ac9ecb7e7440c0f9fa70d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2085353
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
These should be the remaining instances of UB errors we see.
Bug: fuchsia:46805
Change-Id: Id8285386fd6cb52518f6076ddb79ac60025f9f87
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2067754
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
UBSan was reporting reference binding to a misaligned address in Fuchsia.
Disable UBSan for this target for now just to silence the runtime
warnings, then come back and fix them.
Bug: fuchsia:46805
Change-Id: Ic5d9b35161b6d998f1ff50eb8e978c44aff9b4ef
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2068051
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Leak sanitizer detected bugs on the above tests. We suppress
the leak sanitizer on the leaky targets for now, and these leaks
need to be fixed to fully enable leak detector.
Bug: fuchsia:46559
Change-Id: I0bd7a43cfefc0d4ac213651de6dceea4404c243b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2067412
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
The new API replaces zx_system_get_version and is simpler.
Bug: fuchsia:45640
Change-Id: Ibc47703aba0e87e55265608b517e5953eada182f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2063908
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
First steps at bringing up the crashpad_client on iOS. Also updates
the XCUITest to trigger various crashes, with some swizzling
necessary to allow crashes.
Change-Id: I87dd36bed1c052b509d14bfa29679ed81e58a377
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2039470
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
- Also fix the command line issue
Bug: crashpad:308
Change-Id: I2cace85f472acd049c1916b894c6ec36fe7fcc56
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2048267
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Tao Bai <michaelbai@chromium.org>
Removes a failing DCHECK in process_reader_win.cc caused by a race
condition with a thread being injected into a process whose existing
threads are already suspended.
Bug: chromium:1007013
Change-Id: Ifa569220b28e8e2e5dfa6c32b2be4c57f61076b3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2047803
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
lld wants to remove bl/blx substitution for non-function symbols
(https://reviews.llvm.org/D73542). GNU ld apparently already doesn't
do it.
Since _ZN8crashpad14CaptureContextEP10ucontext_t wasn't marked as a function,
chromium's thumb code would then branch without mode transition into
crashpads non-thumb assembly (in arm32).
So mark the symbol as function, so that things work even if that patch
relands. This should also make things work with GNU ld, though I haven't
verified that it was broken before and works now.
I also did this for aarch64 since it seems like The Right Thing To Do
(assuming the assembler accepts it, which I also haven't checked --
the CQ will hopefully check that).
Bug: chromium:1049649
Change-Id: I3452c16f0d52a2dc0397fd3d60d06b5c39a4b524
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2044144
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Note that upload consent is ignored if --use-cros-crash-reporter is
present, which it will be if invoked by Chrome on ChromeOS.
BUG=chromium:1037656
TEST=None
Change-Id: I2dcea736de40a082b477f21d46c3ed01f1d91699
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2042317
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Ian Barkley-Yeung <iby@chromium.org>
6b3e658d6f..afc5b798c7
$ git log 6b3e658d6..afc5b798c --date=short --no-merges --format='%ad %ae %s'
2020-01-28 thakis Roll GN 83dad00a:97cc440d
2020-01-28 thakis Reformat remaining gn files.
2020-01-21 sdefresne Roll GN 0c5557d173..83dad00afb
2020-01-16 thakis Reformat all gn files in /buildtools/third_party/libc++.
2020-01-16 felipesalazar Include cxa_thread_atexit on linux targets.
2020-01-13 thakis Roll GN a5bcbd726a..0c5557d17
2020-01-08 bpastene Update //buildtools/README.txt after it was merged into chromium.
2019-12-31 agable Roll GN from 6feb5599..a5bcbd72
2019-12-13 chouinard Roll GN from ad9e442d..6feb5599
Created with:
roll-dep buildtools
Change-Id: Ifdfa2dae072115c18ce859620ed01743cac312f9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2036509
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
eda23acabd..6b3e658d6f
$ git log eda23acab..6b3e658d6 --date=short --no-merges --format='%ad %ae %s'
2019-11-18 xiaohuic Reland: Roll src/buildtools/third_party/libc++/trunk/ 5938e0582..78d6a7767 (333 commits)
2019-10-28 xiaohuic Revert "Roll src/buildtools/third_party/libc++/trunk/ 5938e0582..78d6a7767 (333 commits)"
2019-09-13 hnakashima Add exception for libassistant to import checker.
2019-09-10 dpranke Add a COMPONENT entry (Build) for //buildtools.
2019-09-10 dpranke Roll GN from 152c5144..ad9e442d
2019-07-25 thomasanderson List natvis files as inputs
2019-07-23 tikuta Roll GN from 972ed755 to 152c5144
2019-07-19 tsniatowski ensure_gn_version.py: don't die if existing gn is very old
2019-07-16 bratell Before trying to overwrite the gn binary, make it writable
2019-07-12 vapier ensure_gn_version.py: reinstall if tool is missing
2019-07-11 vapier ensure_gn_version.py: fix exception printing
2019-06-24 brettw Roll GN from 8c7f4910 to 972ed755
2019-06-21 thomasanderson Reland "Roll GN from 81ee1967 to 8c7f4910"
2019-06-17 sdy Revert "Roll GN from 81ee1967 to 8c7f4910"
2019-06-16 thomasanderson Roll GN from 81ee1967 to 8c7f4910
2019-06-14 mstensho Revert "Roll src/buildtools/third_party/libc++/trunk/ 5938e0582..ad464887b (53 commits)"
2019-06-13 mstensho Revert "Roll src/buildtools/third_party/libc++/trunk/ 5938e0582..78822a685 (48 commits)"
2019-06-07 oysteine Tracing: Moved the tracing sampling profiler to the tracing service
2019-05-23 wychen Exclude AndroidStudioDefault folder in Java import checking
2019-05-19 rsesek Roll GN from 64b846c9 to 81ee1967.
2019-05-13 jbudorick checkdeps: encode input to os.walk as utf-8.
2019-04-03 tikuta Roll GN from r1496 (0790d304) to r1555 (64b846c9)
2019-03-29 dpranke Revert "Roll GN from r1496 (0790d304) to r1546 (b85982b3)"
Created with:
roll-dep buildtools
Change-Id: I9d0c41177307af404768d3c4e8909364f7fa6a3e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2036534
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
62f9eb0d64..eda23acabd
$ git log 62f9eb0d6..eda23acab --date=short --no-merges --format='%ad %ae %s'
2019-03-28 dpranke Roll GN from r1496 (0790d304) to r1546 (b85982b3)
2019-03-27 thomasanderson Enable in-tree libc++ builds on iOS
2019-03-27 raul Support Python 3 in //buildtools/ensure_gn_version.py
2019-03-22 dpranke Add ensure_gn_version.py and DEPS hook.
2019-03-20 thomasanderson Roll libc++ to r356574
2019-03-19 tikuta [buildtools] update .gitignore for CIPD
2019-03-18 olivierrobin Fetch gn based on the host OS.
2019-03-15 thomasanderson Set WINVER to WIN7 for libc++
2019-03-15 dpranke Use CIPD packages for GN instead of GCS.
Created with:
roll-dep buildtools
This rolls buildtools to a commit that pulls GN via CIPD and updates
DEPS to stop downloading GN from GCS.
Change-Id: Ic148c5ef380168ced0f8390668dcbf0a610304ba
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2036530
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
3e50219fc4..62f9eb0d64
$ git log 3e50219fc..62f9eb0d6 --date=short --no-merges --format='%ad %ae %s'
2019-03-15 dpranke Add presubmit checks for //buildtools/DEPS entries.
2019-03-14 thomasanderson Clean up visibility for lib{c++,c++abi,unwind} and common_deps targets
2019-03-13 wez Revert "Move fuchsia libunwind dependency to common_deps"
2019-03-13 dpranke Reformat DEPS files to use single-quotes consistently.
2019-03-13 thomasanderson Correct libcxx{abi} revision in buildtools/DEPS
2019-03-13 thomasanderson Move fuchsia libunwind dependency to common_deps
2019-03-11 thomasanderson Roll libc++ to 355829
2019-03-06 thomasanderson Roll libc++ to 22d3f6dd
Created with:
roll-dep buildtools
This rolls buildtools to the commit just before GN switched from GCS to
CIPD. In a followup, I'll roll one more commit and switch crashpad to
pulling GN via CIPD.
Change-Id: I11081716d76cb18df5f1475ddcb8e58dc069a7f4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2033607
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Tests are run by creating an xctestrun file in a temp directory and then
invoking "xcodebuild test-without-building". Tests run on the latest
OS version (the default for the running version of Xcode) on iPhone X.
Bug: crashpad:317
Change-Id: If9f34f8798fd4c2a02fecca180913e8f86011304
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2033606
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Using XCTest allows us to drive tests from the commandline via
xcodebuild, and it also simplifies running tests on physical devices.
Tests put themselves into "XCTest-mode" if the
"XCTestConfigurationFilePath" environment variable is present. This
variable is only set when XCTests are running.
Change-Id: If55199a7470f0479f107097eef1dfb1a705015e9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2033427
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>