2379 Commits

Author SHA1 Message Date
Thomas Gales
2cf938a41d [riscv][fuchsia] Add RISC-V Fuchsia support
Only RV64GC is supported.

RISC-V Fuchsia is not able to serve packages yet so unit testing is not
possible.

Bug: fuchsia:127655

Tested: `crasher` with crashpad added to crashsvc, ran minidump through
Breakpad stackwalker

Change-Id: I1b6d79128759281aee348e333ea15434ab397001
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4602412
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-06-12 21:13:43 +00:00
Thomas Gales
4f5dd67229 [riscv] Add RISC-V Linux support
Only RV64GC is supported.

Bug: fuchsia:127655

Tested: `python build/run_tests.py` on RISC-V emulator
Tested: Created minidump via self-induced crash on RISC-V emulator,
ran through Breakpad stackwalker

Change-Id: I713797cd623b0a758269048e01696cbce502ca6c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4581050
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-06-12 21:13:24 +00:00
Leonard Chan
656fc62589 [snapshot] Suppress function type mismatch UB
UBSan is detecting a function type mismatch in this test. This is
because TestModule_GetCrashpadInfo returns a TestCrashpadInfo* but the
function expectes to return a CrashpadInfo*. Structurally, the
TestCrashpadInfo struct is meant to replicate a CrashpadInfo
byte-for-byte, but there's no relationship between the types.

Bug: fxbug.dev/128274
Change-Id: I7b02ca802e55274116d46513b3aa6dc998f6d292
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4599482
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-06-08 21:06:32 +00:00
Thomas Gales
25f724d783 [fuchsia] Add fp registers to x86 context
This lays groundwork for floating point registers to also be included in
RISC-V CPU context.

Bug: fuchsia:5496

Tested: `fx test crashpad`
Change-Id: I6230f146f955ac27f053f670f7f45dfff3560d02
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4594586
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-06-07 15:54:57 +00:00
Eran Rom
788b72f922 Remove Mac OS X Server support
Mac OS X Server has been discontinued as a separate operating system
flavor since 10.6. Current minimal requirements for both Crashpad and
Chromium are above that.

Change-Id: Ia9063be2e55a48e45d9f9974ac2e51bac004f37d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4584570
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-06-02 19:12:29 +00:00
Justin Cohen
1fdbd3736c ios: More deflaking handler forbidden allocators.
- Stop overloading introspect (or implement this in the future)
- Store each overridden allocation zone and correctly direct calls to
  the requested zone.

Change-Id: I7294e476bb683149acc61419b095ec0e1098781b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4574037
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-31 01:13:35 +00:00
Thomas Gales
402d43192a Update mini_chromium
Update to a version of mini_chromium that supports RISCV64.

Bug: fuchsia:127655

Tested: `python build/run_tests.py` for Linux target
Change-Id: I872e5e79933eb8f9b9fe7f4ae243ee9bb04c14b0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4563254
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-24 18:29:14 +00:00
Justin Cohen
1103dfc65d ios: Add fallbacks to try_free_default and claimed_address in forbidden allocators.
This test only change should improve flake on iOS XCUITests. try_free_default can receive a pointer which doesn't belong to the
allocator and claimed_address may not be implemented in specified zone.
Add fallbacks for both.

This logic is identical to the Chromium equivalent shim in
base/allocator/partition_allocator/shim/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc

Bug:b/270620301
Change-Id: I4a788d4fbc7b324caff18e41618a5f999b4b8d4e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4549684
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-22 17:29:35 +00:00
Thomas Gales
8525d5384e Fix broken doc links
Links to/from run_with_crashpad.md were broken due to a location change.

Change-Id: I5bb6d1f945bd22d9e55affa60909aa3b58e532bc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4544457
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-17 15:47:06 +00:00
Thomas Gales
3307c7cefc Fix ASan failures for MinidumpCrashpadInfoWriter
Fuchsia AddressSanitizer tests were failing because of unaligned memory
access in several unit tests.

Fixed: fuchsia:125877
Change-Id: If577ea9b7be24ef40865a637d8f6b6d94daaeb67
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4510016
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-16 21:24:03 +00:00
Thomas Gales
a280d65971 Update linux-syscall-support (LSS) version
Newer versions of LSS include support for RISC-V.

Fixed: fuchsia:125946
Change-Id: Iab65174e9a5f2a7075faadd34dc54b0c23ce3da4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4510030
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-16 15:55:05 +00:00
Ho Cheung
07827d9807 Remove base/cxx17_backports.h from the code in third_patry/crashpad
Remove the reference to `base/cxx17_backports.h` from the code.

Bug: chromium:1373621
Change-Id: I84dd5fc1b069b168e4558316344c1f1c5377a68b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4471860
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-04-25 20:33:34 +00:00
Zequan Wu
3a6bc8c527 [tests] Disable clang optimization on the infinite recursion function.
In the recent llvm upstream change, https://reviews.llvm.org/D148269,
clang becomes smarter and will remove the infinite recursion function.
Use the clang attribute __attribute__((optnone)) to disable optimization
for it.

Bug: chromium:1435016
Change-Id: I74e823bf64d0b03d81c0bda7a8338e2fa67033aa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4456156
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Zequan Wu <zequanwu@google.com>
2023-04-21 17:58:33 +00:00
Stephan Hartmann
0e3758bef6 pac_helper: test for __has_feature macro
__has_feature is a clang extension. GCC errors out on the test.
Define a helper macro to make the code working with other compilers.

Bug: chromium:819294
Change-Id: I359150acd4700e65b4faf5f297b29664c18000d3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4418706
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Ben Hamilton <benhamilton@google.com>
2023-04-12 17:18:21 +00:00
Justin Cohen
ada8dfa4a7 ios: Always reset IOSIntermediateDumpWriter file descriptor on close.
Always reset the file descriptor to -1, even if FlushWriteBuffer or
RawLoggingCloseFile fails.

Bug: 1431760
Change-Id: I193f526d65f477bba002dd9faf68996020e48a3b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4406657
Reviewed-by: Ben Hamilton <benhamilton@google.com>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-04-10 20:44:16 +00:00
avvall
4773a37f0a Crashpad: Adding PAC bit stripping to stack sanitization.
Pointer Authentication works by adding a signature to the top bits of
an instruction or data pointer (only instruction pointers on the stack
are currently signed in Chromium). This can confuse range checks,
because they need to strip the top bits. Masking these bits during sanitization range checks prevents confusion.


Test: Testing was done manually on a device with pointer authentication enabled.
Bug: crashpad:364
Bug: 919548
Change-Id: I2e739cadb2844cfaf73a75596d664135aeb5faac
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4387271
Commit-Queue: Adam Walls <avvall@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Ben Hamilton <benhamilton@google.com>
2023-04-04 23:59:29 +00:00
Justin Cohen
c21292dd71 Fix iOS test with libc++ exception throw change.
After https://reviews.llvm.org/D141222 exceptions call into
__libcpp_verbose_abort, which Chromium sets to `brk 0` in release.

Bug: 1425429
Change-Id: Ie00d1317bb03fcb1f15fb5c41ab69640dfb564b7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4347775
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2023-03-20 19:12:25 +00:00
Bruce Dawson
fdf7b9e8e9 Skip tests that create symbol links when not allowed
Several tests in filesystem_test.cc create symbol links. The privilege
needed to do this is not enabled on all Windows systems so several of
the tests check for the privilege and are skipped if it is not
available.

However, two tests that created symbol links were not doing this check
and therefore failed on some Windows machines. This corrects those
failures by adding the checks.

Bug: chromium:1418165
Change-Id: I6621796b462b8db02271ad5a05e0c29ee047f648
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4348801
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
2023-03-18 05:36:06 +00:00
Bruce Dawson
eeb3cad132 Raise extra-memory cap in ProcessSnapshotTest.CrashpadInfoChild
The extra_memory cap in ProcessSnapshotTest.CrashpadInfoChild is not
high enough to avoid test failures on all machines. The actual amount
recorded has been seen to vary between 726,556 and 1,152,803. This
change rases the limit from 1,000,000 to 1,200,000 to avoid the
failures.

The highest amount was seen on a 64-GB gWindows ThinkPad laptop.

Instrumentation shows that the low and high cases both have 104 threads.
The low case has 304 ExtraMemory() blocks, whereas the high case has
409. In both cases the sizes range from 384 to 6,024.

Change-Id: I8873921fa913c31445384db34d4aa90200401a4a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4348802
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
2023-03-17 23:05:55 +00:00
David Benjamin
d5b2eea537 Fix another argument-dependent-lookup dependency
Missed this the first time around because it was Windows-only.

Bug: chromium:691162
Change-Id: Ic98a5943957f77fbf17d92a93409eaa35910ae0e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4297482
Commit-Queue: David Benjamin <davidben@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-03-15 16:54:50 +00:00
Justin Cohen
3cd7b5bf7f ios: Fix crash in ObjcExceptionPreprocessor.
ObjcExceptionPreprocessor is a 'reasonable effort' attempt to catch an
NSException minidump at time the exception is thrown as opposed to when the application terminates due to the exception. If multiple
exceptions are thrown at the same time, Crashpad should correctly
report the final uncaught exception, but the minidump may not
represent the full `caught-at-thrown` minidump.

 - Don't assume ObjcExceptionPreprocessor throws an NSException.
 - Don't retain/release the exception. Instead of calling isEqual,
   just use a simple pointer comparison.
 - Make last_exception atomic.

Bug: crashpad: 445, 446
Change-Id: I9f2f2041e96aa9818c63937025e507487ae9d03d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4317110
Reviewed-by: Ben Hamilton <benhamilton@google.com>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-03-15 00:49:36 +00:00
Peter Kasting
322eaa5850 Use thread_local instead of ThreadLocalStorage::Slot.
This also significantly simplifies the implementation, since we don't
really need the ThreadLogMessagesMaster class at all.

Bug: chromium:1416710
Change-Id: I85849230015f901dfbf084d140e639f14cb872a7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4313281
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
2023-03-07 02:40:30 +00:00
Joemer Ramos
3e54a2cd1b ios: Support minimum deployment targets of iOS15
The windows property of UIApplication is unavailable in iOS15.

Bug: 1406561 crashpad:
Change-Id: I19642067a13801142cd3f24586bab6958a81635d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4304398
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Joemer Ramos <joemerramos@chromium.org>
2023-03-03 19:56:37 +00:00
Miriam Zimmerman
707d0d4dac Restrict new crash_reporter flag to valid versions
Lacros can be up to 2 milestones ahead of ash (and consequently the
platform code), so until the crash_reporter change has been in for 2
milestones, we need to manually check version compatibility.

BUG=chromium:1420445
TEST=Build, deploy, check that flag is set only on right version

Change-Id: Ic99d5ac58840814f7eeecd47c628ea0e8107f675
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4308129
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-03-03 18:47:42 +00:00
David Benjamin
90bba04e22 Fix some accidental uses of argument-dependent lookup
StringToInt(string_piece) works because base::StringPiece is in
namespace base, but when it is switched to std::string_view, this won't
work anymore. Use the idiomatic spelling.

Bug: chromium:691162
Change-Id: Ic45e0d2729fa5fc7c3e7a56fe159957b1bdcdf94
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4298113
Commit-Queue: David Benjamin <davidben@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-02-28 22:02:28 +00:00
Justin Cohen
9830fbf3b4 ios: Suppress log-if-missing for kSourceVersion intermediate dump key.
It's not required that LC_SOURCE_VERSION be present in every module, and
common for it to be missing. Suppress recording its absence.

Fixed: crashpad:443
Change-Id: Iae10c38c78514e78af6c3176cc809d95a3ae3811
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4294861
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2023-02-27 21:08:24 +00:00
Miriam Zimmerman
7a997fb253 Report exception number in metadata on CrOS.
In order to determine in crash_reporter whether a crash was fatal, we
need the exception number (-1 is not an actual crash).

BUG=b:269159625
TEST=deploy to DUT; chrome://crashdump; verify metadata present.

Change-Id: I83d3c9cc839a685af2f50d143d627cf9fcfaf3ac
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4265253
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Miriam Zimmerman <mutexlox@chromium.org>
2023-02-27 15:57:05 +00:00
bsheedy
448d2d90da Add dump_minidump_annotations
Adds the dump_minidump_annotations tool (modified from jperaza's WIP
code). This works similarly to Breakpad's minidump_dump tool, but:

1. Is available on Windows
2. Only dumps simple/vectored annotations and annotation objects instead
   of the entire minidump contents.

Current use case for this is to be able to get a minidump's process
type on Windows without having to go through symbolization, but there
may be other use cases in the future.

Bug: chromium:1006331
Change-Id: I392024e230c10ea18673b3cf0d0ad4793d21f5eb
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4287994
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
2023-02-24 22:38:24 +00:00
Robert Sesek
3e8727238b win: Only process up to EXCEPTION_MAXIMUM_PARAMETERS in an EXCEPTION_RECORD
The EXCEPTION_RECORD contains a NumberParameters field, which could
store a value that exceeds the amount of space allocated for the
ExceptionInformation array.

Bug: chromium:1412658
Change-Id: Ibfed8eb6317e28d3addf9215cda7fffc32e1030d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4284559
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
2023-02-23 00:47:44 +00:00
Justin
70e0f92153 Fix StringPiece compile issue in Chromium.
Change-Id: I5a29f690a4512252d0d5730492f7fd4cec16ffaa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4262547
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-02-16 20:19:10 +00:00
Elly Fong-Jones
04b2ab5bba port: fix non-glibc desktop linux build
This is the only change needed to build crashpad against musl, yay! The
reason this change is needed is that user_vfp is bionic-specific, and
does not exist in glibc, dietlibc, uclibc, or musl.

I have not (yet) tried running the tests against another libc.

Bug: chromium:1380656
Change-Id: I2247352e1611a300dff995156d393508c8257039
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4255370
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
2023-02-15 22:41:03 +00:00
Ben Hamilton
485805c6fe Fix test that relied on NDEBUG always disabling DCHECK
The test BaseAnnotationShouldNotSupportSpinGuard assumed NDEBUG builds
always disabled DCHECK()s, but DCHECK_ALWAYS_ON overrides this.

This CL fixes the test for NDEDBUG + DCHECK_ALWAYS_ON builds by using
the DCHECK_IS_ON() macro to skip the test when DCHECKs are enabled.

Change-Id: I7b64729568c5d3139ca777e27462d81eba931834
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4255429
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2023-02-15 20:42:52 +00:00
Justin Cohen
0adab59836 ios: Validate exception code buffer size before read.
Bug: 1415371
Change-Id: I9e1bd902494a664d4f07829e686803712fa8e7a8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4255568
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2023-02-15 18:13:45 +00:00
Ben Hamilton
c7d9c710f2 [ios] Support guarding concurrent reads and writes to Annotations
Since iOS reads Annotations in-process, this CL updates the iOS
intermediate dump handler to check each Annotation to see if it supports
guarding concurrent reads and writes using ScopedSpinGuard.

For any such Annotation, the in-process dump handler now tries (without
spinning) to obtain the ScopedSpinGuard for the Annotation before
reading its memory.

If the ScopedSpinGuard cannot immediately be obtained, the in-process
dump handler just skips writing the memory of the Annotation to the
intermediate dump. (I'd like to follow up and thread down a Params
object so we can experiment with adding an optional timeout to make
this more reliable.)

Change-Id: Ie6c9849fac94ab89b36364b07aea62326cabe552
Bug: crashpad:437
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4031730
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-02-01 19:27:26 +00:00
Ben Hamilton
212b8f6b8c [client] New RingBufferAnnotation
This CL integrates the new ScopedSpinGuard with the new
LengthDelimitedRingBuffer into a new class, RingBufferAnnotation.

RingBufferAnnotation is thread-safe both for reading and writing, and is
suitable for streaming logs, trace events, and other high-throughput
data streams.

I included a load test (ring_buffer_annotation_load_test) which launches
two threads which simultaneously write to and read from the
RingBufferAnnotation.

By default, reads and writes are serialized using ScopedSpinGuard, but
passing the flag "--disable_spin_guard" to the test disables the spin
guard on the reading side (which is expected to make the test fail).

Change-Id: Ic8e28866d085d57e778c4f86bcb7492ef0638ab9
Bug: crashpad:437
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4023619
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2023-02-01 19:23:51 +00:00
Ben Hamilton
3215ed9086 [client] Optionally support ScopedSpinGuard in Annotation
This CL optionally integrates ScopedSpinGuard (an atomic boolean) with
crashpad::Annotation.

Subclasses of Annotation can choose to integrate ScopedSpinGuard into
their Set(...) methods to ensure reads and writes are serialized.

I didn't integrate this into StringAnnotation in this CL, but it'd be
pretty trivial to do in a follow-up.

Change-Id: I1c5b8982576b03f9780a57acb7627c9194f8f0ff
Bug: crashpad:437
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4022484
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-01-31 22:37:44 +00:00
Vaibhav Nagarnaik
9158eb7caa handle num_handled_exceptions == 0 case
from documentation of `ProcessException` in `crashpad_wer.h`:

```
//! \param[in] handled_exceptions is an array of exception codes that the helper
//!     should pass on to crashpad handler (if possible). Pass nullptr and set
//!     num_handled_exceptions to 0 to pass every exception on to the crashpad
//!     handler.
```

fix the check to handle `num_handled_exceptions == 0` case to not filter
out any exceptions.

Bug: crashpad:439
Change-Id: Ic4559a730a26e37c7a8f13e6bcae7595d743924a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4206503
Commit-Queue: Alex Gough <ajgo@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
2023-01-31 04:56:47 +00:00
Ben Hamilton
28354d11c3 [ios] New class ScopedVMMap
This CL introduces a new class ScopedVMMap, a fork of ScopedVMRead
which maps the memory using vm_remap() instead of reading it.

This is useful for Annotations which use ScopedSpinGuard to
protect reads from simultaneous writes; the in-process intermediate
dump handler can try to take the spin guard when reading such
an Annotation and skip reading it if it the spin guard could not
be obtained.

Change-Id: I60d7a48d1ba4e5d2dfdb44307b78b4d9ffb73560
Bug: crashpad:437
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4114550
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2023-01-30 22:19:37 +00:00
Ben Hamilton
8071d3019e [client] Clean up types and code style in LengthDelimitedRingBuffer
This CL cleans up types and code style comments from post-submit code
review comments on https://crrev.com/c/4023618 .

I also added fixes for potential overflows in varint length decoding
and included new tests.

Bug: crashpad:437
Change-Id: I0a3585036028d81f42d0d36e87cce4264f4ed9ad
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4199705
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-01-30 21:18:59 +00:00
Justin Cohen
c11d49db88 Add a mask to MinidumpCrashpadInfo to indicate valid pointer addresses.
ARM64 supports storing pointer authentication codes in the upper bits of
a pointer. This mask can be used by LLDB to mimic ptrauth_strip and
strip the pointer authentication codes. To recover an address from
pointer with an authentication code, `AND` this mask with the pointer.

If the platform does not support pointer authentication, or the range of
valid addressees for a pointer was unaccessible, this field will be 0
and should be ignored.

Change-Id: Ie5cef90802dd1e892d456195ab8874223eac6a1b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2773358
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-01-30 18:27:02 +00:00
Leonard Grey
85b7d3dd6f Mac: more robust __crash_info on 13+
It looks like macOS 13 only *sometimes* puts __crash_info in
__DATA_DIRTY. Instead of splitting by version check, let's just look
in __DATA_DIRTY if we can't find it in __DATA.

Bug: chromium:1372165
Change-Id: I99d2e759c66841d982039449e83f8658259d7ed1
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4197706
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
2023-01-27 20:02:14 +00:00
Leonard Grey
ad2e043288 Mac: Look for crash annotations in __DATA_DIRTY on macOS 13+
Bug: chromium:1373664
Change-Id: I948eac3a46e8ad0d6fe70413111641e77c7ae57c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4196074
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
2023-01-26 15:36:34 +00:00
Leonard Chan
84627e1ac7 [fuchsia] Temporarily disable hwasan from crashpad tests
Much of crashpad's unittests propagate tagged pointers to fuchsia
syscalls which do not accept tagged values. Rather than fixing them all
right now, just ensure that the tests do not build with the hwasan
variant if enabled.

Bug: fxbug.dev/108368
Change-Id: Ib32eb95ba671a6b55694075b68c7fbbb733cf501
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4175438
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2023-01-18 00:33:10 +00:00
Avi Drissman
1e10a2370e Update header includes for /base/functional in Crashpad
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: chromium:1364441
Change-Id: I23aaa16644c10ac5b607ea29d25799fbb08dfaca
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4163072
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
2023-01-13 19:47:47 +00:00
Jay Zhuang
43eac93aef [fuchsia] Import buildconfig from fuchsia
... when build is targeting Fuchsia

Change-Id: I03fab9368bd5e8687899a2efeb51736707bce81e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4137733
Commit-Queue: Jay Zhuang <jayzhuang@google.com>
Reviewed-by: Francois Rousseau <frousseau@google.com>
2023-01-09 22:58:19 +00:00
Jay Zhuang
a0b4e88a9f [snapshot] Use Fuchsia specific header
... when compile target is Fuchsia

Change-Id: Id77babbd3dffff26c75a52296ac91101780e4c33
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4132464
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Jay Zhuang <jayzhuang@google.com>
2023-01-04 22:55:45 +00:00
Mark Mentovai
21035861b5 mac: Don’t cater to gcc-4.2 libstdc++ brokenness
The try and catch macros were conditionally defined by libstdc++ pre-gcc
4.4 (2009-04-21), fixed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25191. Surely none of this
code would build with such an old libstdc++ any more, since Crashpas has
adopted modern C++ (C++11 and later). Remove this obsolete nod to
history.

Change-Id: Ie3cea1ecc1cfd358f27ea48f8111791e7f08bfa5
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4136890
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2023-01-04 17:48:55 +00:00
Jay Zhuang
a41e599f33 [fuchsia] Update crashpad location
... as we move crashpad from //third_party/crashpad to
//third_party/crashpad/src

Change-Id: I081520ad44334cc83397234e5d16535d0db4806d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4132465
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Jay Zhuang <jayzhuang@google.com>
2023-01-04 01:39:33 +00:00
Ben Hamilton
bd479a1202 [ios] Fix --gtest_filter for non-xcuitest targets
Change-Id: I477919feec68d317ca3cb8a0d07022e9405156dd
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4118347
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2022-12-21 16:20:05 +00:00
Ben Hamilton
62a0099c0e [ios] Support --gtest_filter for iOS tests
Change-Id: I5511911110b58b7accd0f78cc1094924bfbda71e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4114702
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2022-12-20 20:22:39 +00:00