This is necessary to roll Crashpad in Chromium. Fixes the following:
[5984/6587] CXX obj/third_party/crashpad/crashpad/client/client_test/crashpad_client_linux_test.o
FAILED: obj/third_party/crashpad/crashpad/client/client_test/crashpad_client_linux_test.o
python3 ../../build/toolchain/clang_code_coverage_wrapper.py --target-os=linux --files-to-instrument...(too long)
../../third_party/crashpad/crashpad/client/crashpad_client_linux_test.cc:522:20: error: code will never be executed [-Werror,-Wunreachable-code]
struct utsname uname_info;
^~~~~~~~~~
1 error generated.
Bug: chromium:1260217
Change-Id: Ie63881ed82faec84e8d45bb30dfc8ef10cfdbd6d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4028794
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
SA_EXPOSE_TAGBITS is a Linux >= 5.11 feature that allows si_addr to
contain the upper tag bits. This is a feature that allows signal
handlers to see the full upper address bits on aarch64, which consist of
TBI and MTE nibbles. For MTE, preserving these bits is of significant
importance, as it allows for precise use-after-free and buffer-overflow
diagnosis that's impossible without seeing these bits in the fault
address.
We unconditionally enable this feature on all kernels, as it's ignored
when unsupported (even on older kernels).
Tested on:
1. Linux x86 host, which is a no-op.
2. Android device with Linux 4.14, which is a no-op.
3. Android device with Linux 5.15, which passes. For posterity, my
config was:
| $ gn args out_arm64
| target_os = "android"
| android_ndk_root = "~/Android.sdk/ndk/21.4.7075529"
| android_api_level = 26
| target_cpu = "arm64"
| # NDK builds push libc++_shared.so, which is not present on newer Android
| # versions, so I hacked the runner to push the file. Maybe this should be
| # upstreamed at some point as well.
| $ git diff
| diff --git a/build/run_tests.py b/build/run_tests.py
| index 8ad19e34..64269c90 100755
| --- a/build/run_tests.py
| +++ b/build/run_tests.py
| @@ -273,7 +273,8 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
| _adb_shell(adb_mkdir_command)
|
| # Push the test binary and any other build output to the device.
| - local_test_build_artifacts = []
| + local_test_build_artifacts = [
| + '~/Android.sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so']
| for artifact in test_build_artifacts:
| local_test_build_artifacts.append(os.path.join(
| binary_dir, artifact))
| @@ -294,6 +295,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
| # The list of TERM values comes from Google Test’s
| # googletest/src/gtest.cc testing::internal::ShouldUseColor().
| env = {'CRASHPAD_TEST_DATA_ROOT': device_temp_dir}
| + env = {'LD_LIBRARY_PATH': device_out_dir}
| gtest_color = os.environ.get('GTEST_COLOR')
| if gtest_color in ('auto', None):
| if (sys.stdout.isatty() and
| $ ninja -C out_arm64 && python build/run_tests.py out_arm64/ \
| --gtest_filter=*StartHandlerForSelfTestSuite*
Change-Id: I293b36fcd08ffaca593dae8042299a39756defa0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4024204
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mitch Phillips <mitchp@google.com>
On gLinux, tests don't pass in the default configuration (empty GN
args), because the infinite recursion test doesn't crash
anymore. Locally, forcing the function to stay out of line is sufficient
to fix it. This is inherently brittle, and may need to be revisited at a
later point.
Change-Id: Ica88a0b3a2151af95c64c490b5afcdc05cf3be4e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4020321
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Benoit Lize <lizeb@chromium.org>
Fixes NOTREACHED not being available in client/settings.cc. This was
available when compiling Crashpad standalone, but not as part of
Chromium.
Bug: chromium:1358240
Change-Id: Ie61d3beabf9ab953369f8fd25556d6a602c0c043
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4009734
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Copy of crrev.com/c/3952963.
Fixes locking not working on some Android filesystems due to flock not
being available. Instead, we now use the same approach as Fuchsia with
a dedicated lock file. This is an issue when running tests on
non-rooted Android devices, as we need files to be written to a
location accessible without root, but the chosen location might not
have flock support.
Bug: chromium:1358240
Change-Id: Ie910481be472403a8b0e9e36100594b0618f85e6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3999273
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Previously, StartProcessingPendingReports() only started the prune and
upload threads if it thought the application was actively running in
the foreground.
However, some Crashpad clients would like to replicate Breakpad's
behavior of allowing uploads while the application is starting up
(before it moves to the foreground).
This CL introdues an optional UploadBehavior enum to
InProcessHandler::StartProcessingPendingReports(), defaulting to the
current behavior of only uploading processed crash reports while the
application is in the foreground.
If the enum is set to UploadBehavior::kUploadImmediately, then
InProcessHandler will start the prune and upload threads regardless
of the application state. (If the application state later transitions
to a non-active state, then InProcessHandler will stop the prune and
upload threads as normal.)
Change-Id: I4f13f3a3006d636dd3e511b21ccc23a90b2ea639
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3894230
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
sed -i '' -E -e 's/Copyright (.+) The Crashpad Authors\. All rights reserved\.$/Copyright \1 The Crashpad Authors/' $(git grep -El 'Copyright (.+) The Crashpad Authors\. All rights reserved\.$')
Bug: chromium:1098010
Change-Id: I8d6138469ddbe3d281a5d83f64cf918ec2491611
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3878262
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
handler_sock end of the socketpair is donated to the crashpad server
process which owns it. The client should not keep it open. Otherwise
if the crashpad server process crashes and the client is reading from
client_sock, the client will hang forever because the other end is still
open.
This happens when:
- /proc/sys/kernel/yama/ptrace_scope file is present.
- crashpad is invoked with missing required fields, like --database.
In this case, chrome hangs until timeout.
Change-Id: I1776432d6d9fd44dc1c24e874a15fd6d2a376003
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3786896
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Ayush Ranjan <ayushranjan@google.com>
Adds a 4K buffer to the intermediate dump writer. Aside from the final
flush, only write in multiples of 4K. This saves between 30ms and 50ms
on an iPhone 12 Pro.
Change-Id: Icc4b222477bd91fd6952c7cf43b105e1f7a50adb
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3764243
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Rather than vm_reading each individual module load_command, load all of
the commands at once. This saves nearly 200ms on an iPhone 12 Pro.
Change-Id: I06f56c3ecbdf74f78759648ea62bcccd027f304c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3764242
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
On iOS, holding a lock during a slow upload can lead to watchdog kills
if the app is suspended mid-upload. Instead, if the client can obtain
the lock, the database sets a lock-time file attribute and releases the
flock. The file attribute is cleared when the upload is completed. The
lock-time attribute can be used to prevent file access from other
processes, or to discard reports that likely were terminated mid-upload.
Bug:chromium:1342051
Change-Id: Ib878f6ade8eae467ee39acb52288296759c84582
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3739019
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Adds a new IOSIntermediateDumpWriter::AddPropertyCString method which
takes an address to a cstring of unknown length and page-by-page
searches for a NUL-byte terminator.
This is necessary because currently WriteModuleInfo calls strlen
directly on the dyld and module filePath without first using vm_read.
On iOS14 this occasionally crashes, and is generally unwise. Instead,
use AddPropertyCString.
This patch also removes WriteDyldErrorStringAnnotation, as it's no
longer used going forward with iOS 15.
Bug: 1332862
Change-Id: I3801693bc39259a0127e5175dccf286a1cd97ba7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3689516
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This adds a runtime exception helper (& test module) for Windows and
plumbing to allow the module to be registered by the crashpad client,
and to trigger the crashpad handler. Embedders can build their own
module to control which exceptions are passed to the handler.
See: go/chrome-windows-runtime-exception-helper for motivation.
When registered (which is the responsibility of the embedding
application), the helper is loaded by WerFault.exe when Windows
Error Reporting receives crashes that are not caught by crashpad's
normal handlers - for instance a control-flow violation when a
module is compiled with /guard:cf.
Registration:
The embedder must arrange for the full path to the helper to
be added in the appropriate Windows Error Reporting\
RuntimeExceptionHelperModules registry key.
Once an embedder's crashpad client is connected to a crashpad
handler (e.g. through SetIpcPipeName()) the embedder calls
RegisterWerModule. Internally, this registration includes handles
used to trigger the crashpad handler, an area reserved to hold an
exception and context, and structures needed by the crashpad handler.
Following a crash:
WerFault.exe handles the crash then validates and loads the helper
module. WER hands the helper module a handle to the crashing target
process and copies of the exception and context for the faulting thread.
The helper then copies out the client's registration data and
duplicates handles to the crashpad handler, then fills back the various structures in the paused client that the crashpad handler will need.
The helper then signals the crashpad handler, which collects a dump then
notifies the helper that it is done.
Support:
WerRegisterExceptionHelperModule has been availble since at least
Windows 7 but WerFault would not pass on the exceptions that crashpad
could not already handle. This changed in Windows 10 20H1 (19041),
which supports HKCU and HKLM registrations, and passes in more types of
crashes. It is harmless to register the module for earlier versions
of Windows as it simply won't be loaded by WerFault.exe.
Tests:
snapshot/win/end_to_end_test.py has been refactored slightly to
group crash generation and output validation in main() by breaking
up RunTests into smaller functions.
As the module works by being loaded in WerFault.exe it is tested
in end_to_end_test.py.
Bug: crashpad:133, 866033, 865632
Change-Id: Id668bd15a510a24c79753e1bb03e9456f41a9780
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3677284
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
This is a reland of 460943dd9a71dc76f68182a8ede766d5543e5341
Original change's description:
> The DoubleForkAndExec() function was taking over 622 milliseconds to run
> on macOS 11 (BigSur) on Intel i5-1038NG7. I did some debugging by adding
> some custom traces and found that the fork() syscall is the bottleneck
> here, i.e., the first fork() takes around 359 milliseconds and the
> nested fork() takes around 263 milliseconds. Replacing the nested fork()
> and exec() with posix_spawn() reduces the time consumption to 257
> milliseconds!
>
> See https://github.com/libuv/libuv/pull/3064 to know why fork() is so
> slow on macOS and why posix_spawn() is a better replacement.
>
> Another point to note is that even base::LaunchProcess() from Chromium
> calls posix_spawnp() on macOS -
> 8f8d82dea0:base/process/launch_mac.cc;l=295-296
The reland isolates the change to non-Android POSIX systems because
posix_spawn and posix_spawnp are available in Android NDK 28, but
Chromium is building with version 23.
Change-Id: If44629f5445bb0e3d0a1d3698b85f047d1cbf04f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3721655
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This reverts commit 460943dd9a71dc76f68182a8ede766d5543e5341.
Reason for revert: This fails to compile in Chromium Android.
posix_spawn and posix_spawnp are available in Android NDK 28, but
Chromium is building with version 23.
https://ci.chromium.org/ui/p/chromium/builders/try/android_compile_dbg/1179765/overview
Original change's description:
> posix: Replace DoubleForkAndExec() with ForkAndSpawn()
>
> The DoubleForkAndExec() function was taking over 622 milliseconds to run
> on macOS 11 (BigSur) on Intel i5-1038NG7. I did some debugging by adding
> some custom traces and found that the fork() syscall is the bottleneck
> here, i.e., the first fork() takes around 359 milliseconds and the
> nested fork() takes around 263 milliseconds. Replacing the nested fork()
> and exec() with posix_spawn() reduces the time consumption to 257
> milliseconds!
>
> See https://github.com/libuv/libuv/pull/3064 to know why fork() is so
> slow on macOS and why posix_spawn() is a better replacement.
>
> Another point to note is that even base::LaunchProcess() from Chromium
> calls posix_spawnp() on macOS -
> 8f8d82dea0:base/process/launch_mac.cc;l=295-296
>
> Change-Id: I25c6ee9629a1ae5d0c32b361b56a1ce0b4b0fd26
> Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386
> Reviewed-by: Mark Mentovai <mark@chromium.org>
> Commit-Queue: Mark Mentovai <mark@chromium.org>
Change-Id: I7f6161bc4734c50308438cdde1e193023ee9bfb8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3719439
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This fixes a test case that accesses settings for the first time in
multiple threads simultaneously.
Fixed: crashpad:417
Change-Id: I6539682f171563f8ff5a1203fdd550ab92afc276
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3711807
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
The DoubleForkAndExec() function was taking over 622 milliseconds to run
on macOS 11 (BigSur) on Intel i5-1038NG7. I did some debugging by adding
some custom traces and found that the fork() syscall is the bottleneck
here, i.e., the first fork() takes around 359 milliseconds and the
nested fork() takes around 263 milliseconds. Replacing the nested fork()
and exec() with posix_spawn() reduces the time consumption to 257
milliseconds!
See https://github.com/libuv/libuv/pull/3064 to know why fork() is so
slow on macOS and why posix_spawn() is a better replacement.
Another point to note is that even base::LaunchProcess() from Chromium
calls posix_spawnp() on macOS -
8f8d82dea0:base/process/launch_mac.cc;l=295-296
Change-Id: I25c6ee9629a1ae5d0c32b361b56a1ce0b4b0fd26
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This CL adds a new method ThreadSnapshot::ThreadName(), implements
it in each snapshot implementation, and adds tests for iOS, macOS,
Linux, Windows, and Fuchsia.
Bug: crashpad:327
Change-Id: I35031975223854c19d977e057dd026a40d33fd41
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3671776
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Ben Hamilton <benhamilton@google.com>
Fuchsia's Crashpad roller was failing due to 'std::size' not being found
and struct fields not being initialized (detected by
-Wmissing-field-initializers)
- Fix 'std::size' issue by using a std::array instead of a plain C array
- Fix missing initializers with default values
Bug: fxbug.dev/101498
Change-Id: I75fa54d5c1730772b1af1be31c64b0cc58886a90
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3687239
Commit-Queue: Alex Pankhurst <pankhurst@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
There were two shutdown races in the iOS Crashpad client:
1) MachMessageServer::Run can return either MACH_RCV_PORT_CHANGED *or*
MACH_RCV_INVALID_NAME based on the timing of when the port is
closed, for example:
c21f7bab5c/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift (L131)
2) The iOS crashpad::CrashHandler thread could read from its member
variable mach_handler_running_ while another thread wrote to it
Change-Id: I696ece8575d9b88cbd0593e7c479bd4c7f863f45
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3651395
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
* ATOMIC_FLAG_INIT is deprecated.
* Compound ops on volatiles are deprecated.
Bug: chromium:1284275
Change-Id: I2235662c00e4be8c5eba2aaf565663faf8d9576a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3658639
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Crashpad annotation names are currently limited to 64 bytes.
Breakpad supports up to 256 bytes, so for compatibility with existing
clients, this increases the maximum annotation name size from 64 to
256 and adds new tests to confirm the maximum name and value sizes.
Change-Id: Ib7954bea96046b6b7e18ed9743fe2a15dd3dabac
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3655975
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
IOSIntermediateDumpWriter::Close() is intended to close the FD opened
by the in-process handler.
Currently, InProcessHandler::ScopedLockedWriter::~ScopedLockedWriter() does invoke IOSIntermediateDumpWriter::Close().
However, InProcessHandler::Initialize() invokes the utility CreateWriterWithPath() which directly creates an IOSIntermediateDumpWriter. It neither uses ScopedLockedWriter nor invokes Close().
This fixes the issue by:
1) Making IOSIntermediateDumpWriter::~IOSIntermediateDumpWriter() DCHECK() that it's closed
2) Calling IOSIntermediateDumpWriter::Close() from InProcessHandler::~InProcessHandler() and from test files
Change-Id: Ibfede0a3d2aeac948c7ff3d56445e13d1a4028b5
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3648710
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
It seems on iOS 14, sometimes this path can be empty. Passing nullptr
to strlen will crash. Also fixes an incorrect file path length for
the dyldPath.
Bug: 1323905
Change-Id: Idf1ef9e0165853a5d57d272896a40bf0b30a3368
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3637717
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This brings Crashpad in line with what Breakpad captures.
Change-Id: I8ce2d81fc9cb150dc9817034fac3516f27f5661b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3611069
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
It is not safe to start the upload thread when in the background (due
to the potential for flocked files in shared containers).
Bug: 1317812
Change-Id: Ie476c2ccbc7232bc9e1a30a7a497128a4248c39e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3595621
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Followup to crrev.com/c/3573184, which did not honor destructor order,
leading to the background task releasing before the lock.
Bug: 1313555
Change-Id: Ifbd3902964552458b83cfc550f50058067021499
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3591012
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
In a later CL, in some cases these structs were not zero-initialized
which caused some iOS tests to fail.
We now zero-initialize these structs which should be harmless now,
and useful later.
Bug: 1250098
Change-Id: I933e80e56714a1d8988deae3aa56ec36ed98ef03
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3538665
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Because the upload thread uses synchronous upload, calling Stop() on
that thread from the main thread will lock, and trigger a terminate
when transitioning from foreground to background.
Additionally, background assertions now only last 30 seconds, so
shorten the timeout to 20 seconds.
This is a followup to https://crrev.com/c/3517967.
Bug: crashpad:1315441
Change-Id: Ic6886607805667ffce5ecf41716fc63333a341b8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3577820
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Use ScopedBackgroundTask to prevent file lock termination from happening
when holding locked files in a shared AppGroup.
Bug: 1313555
Change-Id: Idc0105f8ecdb65c26214a7265a216b9d480ed01d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3573184
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Change the ObjExceptionProcessor to write intermediate dumps to a
temporary location until they are confirmed by the
UncaughtExceptionHandler. Because the exception preprocessor uses
heuristics to detect iOS sinkholes, it's possible for an exception to
be identified as fatal, but not actual trigger the uncaught exception
handler. If the processor detects more than one fatal exception, it will
unregister itself and indicate this in the second dump with the key
'MultipleHandledUncaughtNSException'.
This changes also consolidates and simplifies some methods in the
InProcessHandler.
Change-Id: Ifc457e974d25f533b77cfd18b702129fdfb10a75
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3529968
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Some sinkholes use objc_exception_throw instead of rethrow, which gives
the preprocessor a second, incorrect, attempt to process the
NSException. This also means if the processor misses the first sinkhole,
on the second attempt the original throwing stack will be missing.
Instead, track the original NSException and ignore any followup calls
to the ObjcExceptionPreprocessor with the same NSException.
Also creates a ExceptionPreprocessorState class to manage the complex
types. This will be used in a followup CL to finalize caught
NSExceptions using the uncaught handler.
Bug: 1300171
Change-Id: I1f9f2c7ee79c7a16585103f04831217979e9332b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3530246
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Stop the prune thread and the upload thread when moving to the
inactive/background state. This will reduce the number of 0xdead10cc
system kills from having a file lock during iOS suspend.
Wait to start the prune thread when the application is active.
Otherwise, for iOS prewarmed applications, the prune thread will
regularly start when the application is foregrounded for the first
time when the user intentionally runs the app.
It's still possible for either the prune thread or the upload thread to
have a file lock during iOS suspend, such as when a task started in the
foreground and does not complete in time for suspension. Future work
should include considering BackgroundTasks and/or NSURLSessions, which
can more safely run in the background.
Bug: crashpad: 400
Change-Id: Ic7d4687eb795fe585327f128aa84a5928141f4a9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3517967
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
https://crrev.com/c/3401563 introduced logic to guard the cached
intermediate dump writer from concurrent exceptions with a first
exception wins approach. To prevent the losing exception from returning
immediately and terminating the app before the dump is written, the
losing thread sleeps indefinitely. In the case where the losing
exception is from a call to abort() and the winning exception is a Mach
exception, the process will never terminate because abort() will first
block all signals on all other threads with a sigprocmask. This prevents
the kernel from delivering the signal converted from the Mach exception
and will never terminate. This effectively deadlocks the app.
Instead, unblock all signals corresponding to all Mach exceptions
Crashpad registers for before returning KERN_FAILURE.
Bug: crashpad:391
Change-Id: I96c357e98f09e65e70c67125a45b9b04075c2c06
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3518186
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
in_process_intermediate_dump_handler_test was mixing CPU
architecture (x86_64 vs arm64) and iOS device type (iphoneos vs
iphonesimulator).
Bug: 1306589
Change-Id: Ie43a7f1916d69888e992320d999010071b2575b3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3527034
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
iOS applications may be terminated with the exception code 0xdead10cc
when holding on to file locks in the shared container during suspension.
One approach to minimize this is to request additional background
execution time to complete the locking operation (in this case the
CrashReportUpload thread and the PruneIntermediateDumpsAndCrashReports
thread).
Bug: crashpad:400
Change-Id: I4192ae1a92646ea337a09ac071e49761ab2d3860
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3517966
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
The IOSSystemDataCollector was previously owned by the iOS CrashHandler
and passed in to the iOS InProcessHandler in each method. Move
ownership to iOS InProcessHandler to simplify.
Change-Id: Ifa41304cb1e3e3825a211e6cce5aa730d0edcc95
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3517965
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Override malloc_default_zone and malloc_default_purgeable_zone
with allocators that exit when called from the signal or Mach exception
threads in XCUITests, to verify the allocator is not used by the
InProcessHandler. Check stderr for error messages to confirm failures.
Change-Id: I1bb92e57504d71bbf6c6eaad3571c814e8a6934c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3488826
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
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>
Crashpad currently has a circular dependency: client->snapshot->client.
The dependency from snapshot -> client only exists to pull in a single
constant for Windows (CrashpadClient::kTriggeredExceptionCode), so this
change breaks the dependency by splitting the constant out into a new
file util/win/exception_codes.h.
Change-Id: I6b74b367df716e097758e63a44c53cb92ea5e04d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3450763
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
When trying to update Chromium's copy of crashpad I got this error
message:
Banned functions were used.
third_party\crashpad\crashpad\client\crashpad_client_ios_test.mm:33:
testing::Test should not be used in Objective-C++ code as it does
not drain the autorelease pool at the end of the test. Use
PlatformTest instead.
So, I'm fixing the code as requested.
The change was introduced in crrev.com/c/3418581
Change-Id: I4888febbd41b6365d9bde5ad062565770496243f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3459403
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
When updating Chromium's copy of crashpad I received this very
reasonable warning:
client\ios_handler\exception_processor.h: Includes STL header(s) but does not reference std::
So, this change removes the #include of vector.
Change-Id: I22f05b542fd4e0b582351072a3e3bb4af402b836
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3459402
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This patch adds optional support for Arm Pointer Authentication Codes.
X30/LR is not stored to stack at any place and restored for usage.
Therefore only adding PAC flag to .note.gnu.property section.
Change-Id: I9581059dfa1eed88af5a73df15b6a0d299caea13
Bug: crashpad: 1145581
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3440070
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
xnu turns hardware faults into Mach exceptions, so the only signal left
to register is SIGABRT, which never starts off as a hardware fault.
Installing a handler for other signals would lead to recording
exceptions twice. As a consequence, Crashpad will not generate
intermediate dumps for anything manually calling raise(SIG*). In
practice, this doesn’t actually happen for crash signals that originate
as hardware faults.
Change-Id: I1be669d10e89b8e8ebcc69cfdf79c1ee20c96f76
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3403042
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
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>
Handle multiple simultaneous crashes among threads by having
the first crashing thread set an atomic flag and subsequently crashing
threads check the flag before requesting a dump. If a dump has already
been requested, the threads pause on a futex with a timeout in case the
crashing thread crashes again or otherwise fails to WakeThreads().
The thread_local disabled_for_thread_ is removed and combined with this
flag because accessing thread_locals produces undefined behavior in
signal handlers.
Bug:crashpad:384, chromium:861730
Change-Id: I83bce36e1010d0635ba8aeac937e150c43a4166f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3403017
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Both running first chance handlers and checking for disabled signal
handlers should no longer interact with DumpWithoutCrashing().
First-chance-handlers should also run even with disabled crashpad
signal handlers or else those signals would be reported by the next
chained signal handlers as crashes.
Change-Id: I64b3da42c400a1c431c6228d4da181ed56bfda89
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3403413
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Use BUILDFLAG(IS_*) instead of defined(OS_*).
This was generated mostly mechnically by performing the following steps:
- sed -i '' -E -e 's/defined\(OS_/BUILDFLAG(IS_/g' \
-e 's%([ !])OS_([A-Z]+)%\1BUILDFLAG(IS_\2)%g' \
$(git grep -l 'OS_'
'**/*.c' '**/*.cc' '**/*.h' '**/*.m' '**/*.mm')
- sed -i '' -e 's/#ifdef BUILDFLAG(/#if BUILDFLAG(/' \
$(git grep -l '#ifdef BUILDFLAG('
'**/*.c' '**/*.cc' '**/*.h' '**/*.m' '**/*.mm')
- gsed -i -z -E -e \
's%(.*)#include "%\1#include "build/buildflag.h"\n#include "%' \
$(git grep -l 'BUILDFLAG(IS_'
'**/*.c' '**/*.cc' '**/*.h' '**/*.m' '**/*.mm')
- Spot checks to move #include "build/buildflag.h" to the correct parts
of files.
- sed -i '' -E -e \
's%^(#include "build/buildflag.h")$%#include "build/build_config.h"\n\1%' \
$(grep -L '^#include "build/build_config.h"$'
$(git grep -l 'BUILDFLAG(IS_'
'**/*.c' '**/*.cc' '**/*.h' '**/*.m' '**/*.mm'))
- Add “clang-format off” around tool usage messages.
- git cl format
- Update mini_chromium to 85ba51f98278 (intermediate step).
TESTING ONLY).
- for f in $(git grep -l '^#include "build/buildflag.h"$'
'**/*.c' '**/*.cc' '**/*.h' '**/*.m' '**/*.mm'); do \
grep -v '^#include "build/buildflag.h"$' "${f}" > /tmp/z; \
cp /tmp/z "${f}"; done
- git cl format
- Update mini_chromium to 735143774c5f (intermediate step).
- Update mini_chromium to f41420eb45fa (as checked in).
- Update mini_chromium to 6e2f204b4ae1 (as checked in).
For ease of review and inspection, each of these steps is uploaded as a
new patch set in a review series.
This includes an update of mini_chromium to 6e2f204b4ae1:
f41420eb45fa Use BUILDFLAG for OS checking
6e2f204b4ae1 Include what you use: string_util.h uses build_config.h
Bug: chromium:1234043
Change-Id: Ieef86186f094c64e59b853729737e36982f8cf69
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3400258
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is needed to bring
back std::unexpected, which is removed in C++17, but still needed
for libc++abi for backward compatibility.
Bug: 1274565
Change-Id: I5b5687ef7a49e90bf6937ade8b02ff4484690e09
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3307905
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
iOS 15.1 reordered private APIs before public APIs when looking at the
unw_get_proc_info() frame_info.start_ip, so doing a min/max within
UIGestureEnvironment would fail on devices. However, this API is always
called by UIWindow sendEvent, which is not a private API. Do the same
check, but instead look back 2 frames, and check to see if we are
within UIWindow.
Both APIs are still marked <redacted>, but the detection should still
work.
Also cleans up some tests fixtures when running in release.
Change-Id: I762615e9cb44389800cf3291af52a7568c3825d5
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3299008
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Testing in beta has shown a few examples of a cropped intermediate dump
still providing useful information, but due to the order intermediate
dump data is written, could be improved.
- Change the order of writing data to the intermediate dump by
increasing the priority of the Exception block from:
Header / Process / System / Threads/ Modules / Exception
to
Header / Process / System / Exception / Threads / Modules
- Annotate minidump reports generated from incomplete intermediate
dumps with the key 'crashpad_intermediate_dump_incomplete'.
- Handle partial exception contexts rather than throwing them away.
Change-Id: I543c1d3135c42e5b8e339e498ea0c86002f37ea3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3294862
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Change IOSIntermediateDumpReader to take a new interface that can be
backed by a FilePath (as it is now) or a StringFile byte array, which
can be useful for tests, especially with fuzzing.
Change-Id: I02a25cfb7cd204975d1bcce80201bd10944f3f2e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3270755
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
And implement ExtraMemory() for ProcessSnapshotMinidump for this purpose.
Bug: crashpad:10,crashpad:30
Change-Id: I889c42c7e91358336671ae8d00154af820725e7b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3279301
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
This pulls in "base/ignore_result.h" from mini_chromium through DEPS and
updates existing uses of "base/macros.h" to use "base/ignore_result.h".
Bug: chromium:1010217
Change-Id: I283e2bcfb2775de420d7e767b3b4a639dbba9e20
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3286105
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Because the intermediate dump directory is expected to be shared,
mitigate any spamming by limiting this to 20. Prioritize our
bundle id intermediate dumps first.
Bug: crashpad: 31
Change-Id: I2888431b8bd2d94f481d2f4ec6e032882dad9698
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3261747
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Another set of iOS redacted sinkholes appear in CoreAutoLayout.
However, this is often called by our code, so it's unsafe to simply
handle an uncaught nsexception here. Instead, skip the frame and
continue searching for either a handler that belongs to us, or another
sinkhole.
Bug: crashpad: 31
Change-Id: I20be2acef96f5ee6b7521144548e920e635f0dc7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3261270
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
The iOS crashpad client was mistakenly setting the process annotations
(typically things like version and product name) when converting the
intermediate dump into a minidump. This is incorrect, as those
annotations are determined at intermediate dump creation time.
Instead, correctly write those annotations during intermediate dump
creation. Passing extra annotations during intermediate dump to
minidump is still supported.
Bug: crashpad: 31
Change-Id: Ic5e29debdc123011d130f75a48345071575466d9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3266127
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Add another annotation similar to name and reason for the NSException
userInfo string value.
Bug: crashpad:31
Change-Id: Ifeda599d7855c1061e5c0f1fb5fe45d568af65f7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3238128
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This will prune the database on a daily basis, in accordance with the
specified condition. This will also unlock any leftover intermediate
dump files.
Bug: crashpad:31
Change-Id: I229f8b8006b44d31062fbf73bb9d316d69ab2dcf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3231618
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Instead use a custom mechanism based on the filename. Rather than a
filename of <uuid>, instead name the file <bundle-id>|<uuid>[.locked].
A locked file will have the optional .locked extension. Files can be
unlocked after writing an intermediate dump, or during initialization by
looking for matching bundle-ids.
Clients that call ProcessIntermediateDumps() will clean up any leftover
locked intermediate dumps. Clients that never call
ProcessIntermediateDumps, such as extensions that leave this up to the
main application, will be cleaned up in a followup change.
Bug: crashpad:31
Change-Id: Icd4aaa3b79351870fbe9b8463cfbdf7cff7d5f87
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3229429
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Manage the intermediate minidump generation, and own the crash report
upload thread and database.
Change-Id: I272d790a827cd13f6872e56f4675f366d13719c5
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3087721
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This change was partially scripted and partially done manually with vim
regex + manually placing the deleted constructors.
The script change looked for destructors in the public: section of a
class, if that existed the deleted constructors would go before the
destructor.
For manual placement I looked for any constructor in the public: section
of the corresponding class. If there wasn't one, then it would ideally
have gone as the first entry except below enums, classes and typedefs.
This may not have been perfect, but is hopefully good enough. Fingers
crossed.
#include "base/macros.h" is removed from files that don't use
ignore_result, which is the only other thing defined in base/macros.h.
Bug: chromium:1010217
Change-Id: I099526255a40b1ac1264904b4ece2f3f503c9418
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3171034
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
This migrates all the logic that used to live in ios/snapshots that
gathers all the various information during an exception.
Everything in InProcessIntermediateDumpHandler is considered
`RUNS-DURING-CRASH`.
Change-Id: Icc47c9de0f66be2b14a46a13d1038176082a3218
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2920547
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
More cleanly integration the ObjExceptionPreprocessor with the
Crashpad client and in process handler, to record bought
'caught' and 'uncaught' NSExceptions.
Bug: crashpad: 31
Change-Id: I77a77ca6d893cdc74da476c1888d9bcb338339d8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2920851
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This will accommodate moving third_party/mini_chromium around.
The default location is unchanged for now.
There are GN variables that may need to be updated when Fuchsia's source
re-organizes its layout:
* mini_chromium_source_parent : this contains a BUILD.gn with groups and
encloses the mini_chromium_source_root. This is controlled by the
structure of the project that depends on this project.
* _mini_chromium_source_root : this is what is normally checked out from
git, the upstream source directory
* mini_chromium_import_root : points inside source_root to make GN files
accessible.
This first step breaks out case logic for "if (crashpad_is_in_fuchsia)"
even if the value is unchanged for now. This will faciliate a smaller
change when Fuchsia re-structures third_party sources.
Change-Id: I09e5362f4be8fdb440e3891422881b1053052341
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3062424
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
These macros were introduced in 2018. See
https://github.com/google/googletest/commit/c5f08bf.
Mark mocks "override" where needed and move
"-Wno-inconsistent-missing-override" to gmock_all_test since
googletest/googlemock/test/gmock-function-mocker_test.cc doesn't always
specify "override" on mocks.
Change-Id: Icdc0a0ac986ab8d8d904173d093096c8f666ec04
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3079439
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Standalone Crashpad for Android can now be built with gn.
Change-Id: I0ee7f8e1af8c2bc0edb88e93b345abd7d739f33c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3034984
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
DumpWithoutCrashAndDeferProcessingAtPath(path) generate an intermediate
dump that can only be processed if ProcessIntermediateDump(file)
is called. This means the client retains ownership of cleaning up the
intermediate dump if for whatever reason it is no longer needed.
This is useful for Chromium hang reports, which are speculatively
generated during a hang, but are later deleted if a hang recovers or if
the hang leads to an actual crash.
Bug: crashpad: 31
Change-Id: Ie424b375ceae3f5c0da320e766c990ea10df2f52
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3021668
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Remove unneeded base/strings/stringprintf.h includes.
ARCH_CPU_X86_64 macro is used without including build/build_config.h
Missing base/check.h
Change-Id: Ib7864ab7b30ef8fc37649783f7b90b618d0d6a0b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2920552
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Chromium moved base::size() to base/cxx17_backports.h, so do the same in
mini_chromium and update the users in Crashpad.
Roll mini_chromium to 2f06f83f to make the new base header available.
Bug: chromium:1210983
Change-Id: Ie3dc4c189dcdfcac030b95fe285f94abb29a27bf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2917779
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Fixes a minor detail in the CrashReportDatabaseTest.CleanBrokenDatabase
test wherein a ScopedFD is explicitly closed before being released.
Despite being technically safe in this instance, an impending upstream
Chromium change to track and enforce ScopedFD ownership will catch this
as a potential bug and intentionally crash the test.
Change-Id: Ie5c2c84d7501036d16f990bb6093fcd406fa598d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2898048
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Move some common files out of client and handler for iOS usage.
Bug: crashpad: 31
Change-Id: I1933eaaa7580a81017c52b77dfb636a8fa31ee78
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2851059
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>