2424 Commits

Author SHA1 Message Date
Nico Weber
3f1b84197b win: Include stddef.h for offsetof()
A future libc++ revision will stop providing this include transitively.

Bug: 376278210
Change-Id: I79460933ed915bc601278a6d75f2c2ced1130440
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6049220
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-11-25 19:22:36 +00:00
Mark Mentovai
3b0a429371 Fix #includes
- Where std::nullptr_t is used (in namespace std), #include <cstddef>,
   even if it appears alongside <stddef.h> because types like intptr_t
   are used (in the root namespace).
 - Where math library functions are used, #include <cmath> to get and
   use the versions of functions in namespace std which are overloaded
   by argument type, such as std::isinf and std::isnan.

third_party is excluded.

Change-Id: Ic9c143f407e5a9c5cff4098cf566ba5caf4bf6d8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6021439
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-11-14 17:06:54 +00:00
Peter Boström
65a45013d0 Replace CHECK(false) instances
In most cases NOTREACHED() is now a better option. Also performs
dead-code removal.

Bug: 40122554, 40580068
Change-Id: I2deffa59d375db7813ea6779b1d387718d5c62c7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6013409
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-11-13 18:21:54 +00:00
Nico Weber
02d094f3bb win: IWYU for __argc, __wargv
Bug: chromium:376296991
Change-Id: Iad1a2d59ceb444360f7dad407fdfe11f6f1aac69
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5991037
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
2024-11-05 16:26:33 +00:00
Takuto Ikuta
b8937c6cb4 tools: fix missing include for EXIT_{SUCCESS,FAILURE}
Bug: 375980422
Change-Id: Ia3afad0d2a8bf701f783720554ca8887a34b6fda
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5969699
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2024-10-28 12:18:32 +00:00
Peter Boström
6c57c083e6 Fix -Wsign-compare in CrashReportDatabaseTest
Bug: crashpad:42310127
Change-Id: I8a060afd6d976379064c4177a40b337942252087
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5951643
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-10-22 06:14:14 +00:00
Peter Boström
70ccb76751 Accept longer Settings::Data structs
This attempts to be somewhat forward-compatible with upcoming additions
to the Data struct, most importantly to not lose the client ID if we
ever need to downgrade / read data from a future crashpad version.

Bug: 42310127
Change-Id: Ic3914fdd8460f4f41e5bb523d5c52361767880dd
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5915193
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-10-22 02:23:41 +00:00
Brian Bosak
41c74f5622 [fuchsia] Remove duplicate LogSink routes
Routing LogSink manually is not needed, as this is done implicitly
through the client shard. Future CLs will update the routing used in
the shard, so it's necessary to cleanup these duplicate routes in
order to update the shards.

Bug: fuchsia:345827642
Change-Id: I529ab52412530382240d5c6276c1ef01ab349ecc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5941579
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Brian Bosak <bbosak@google.com>
2024-10-17 23:28:48 +00:00
Peter Boström
e05f665694 Roll cpp-httplib
This brings in https://github.com/yhirose/cpp-httplib/pull/1962 which
addresses -Wdeprecated-literal-operator.

Note that this contains v18.0 but is is 15 commits ahead as no release
has yet been made.

https://github.com/yhirose/cpp-httplib/compare/v0.18.0...0cc1ca9a8dcff402891582dda4da34a5d1687adc

Bug: chromium:373130005
Change-Id: Iada3259107e68d0eeabf20812df2d73e50daa750
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5932425
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-10-15 23:17:41 +00:00
Jinyoung
1f24e58fd6 Make the network use proxy settings by default for Windows
Bug: chromium:369900059
Change-Id: I0b39a72938b3dc591ab8b4894a7a23a3deb4604d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5920056
Commit-Queue: Jinyoung Hur <hur.ims@navercorp.com>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-10-11 04:28:32 +00:00
Nico Weber
032bcc92fb Mark CrashWithoutDumping() as [[noreturn]]
No behavior change.

Bug: none
Change-Id: Ie838df830221a09d5401c6c73c8c889ea714940e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5905738
Reviewed-by: Peter Boström <pbos@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
2024-10-04 04:08:15 +00:00
Peter Boström
030fdeb26e Roll crashpad/third_party/mini_chromium/mini_chromium/ e04c707cb..c081fd005 (3 commits)
e04c707cb3..c081fd005b

$ git log e04c707cb..c081fd005 --date=short --no-merges --format='%ad %ae %s'
2024-10-03 pbos Reimplement LAZY_STREAM with a switch
2024-10-03 pbos Fix LOG(FATAL) compile errors
2024-10-03 pbos Make LOG(FATAL) [[noreturn]]

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:40254046
Change-Id: I78c16747fbc5fbba8c2d17c16fec47e467b00189
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5904404
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-10-04 02:18:17 +00:00
Josip Sokcevic
b39cca168f [DEPS] Rely on buildtools recursedep to fetch clang-format
buildtools has first party support to fetch clang-format so no longer
needed to use custom hooks.

Bug: chromium:336843583
Change-Id: I2c29ad9df579b605ff6e1d967da6502ffcd12faf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5586422
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-09-23 22:32:52 +00:00
Justin Cohen
6d37f81ace ios: Remove OS filter for iOS simulator tests.
Bug: 365974437
Change-Id: I9ada04b3602487513ff14ef1124feb43ddfb323a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5855599
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2024-09-11 22:29:44 +00:00
Hzj_jie
e3abe1ed44 [fuchsia] remove unnecessary build args
The gn-args have default values in fuchsia-gn-sdk and not necessary
to be repeated - api-level 18 is also removed and breaks crashpad.

Bug: crashpad:365889763
Change-Id: I2a5a573158db434dd578c92455d0af6c96408d74
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5854005
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2024-09-11 17:43:16 +00:00
Mark Mentovai
35e06fe736 Add Revision to xnu’s README.crashpad
Bug: 349528232
Change-Id: If5550f95a27655e1ad94830c6cd8b33dd2a068c4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5845908
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-09-09 15:45:19 +00:00
Peter Wen
915913bd5a Fix crashpad for PGO generation
This GN arg config repros the failure in the bug:
```
chrome_pgo_phase = 1
is_official_build = true
target_cpu = "arm64"
target_os = "android"
use_remoteexec = true
```

Commenting out either is_official_build or chrome_pgo_phase removes the
compile error, but since many bots build with is_official_build, the
culprit must be chrome_pgo_phase.

Bug: chromium:362787700
Change-Id: I536a098693b85ed93c22e38e639b393fcb480e79
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5826154
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-09-03 17:27:07 +00:00
Peter Kasting
f9fa2d112b [reland] Don't redefine macros from base/compiler_specific.h.
`DISABLE_CFI_ICALL` is already defined in that header; use it.

This is both simpler and less likely to trigger macro redefinition
errors.

This was previously landed in crrev.com/c/5805458, but reverted due to
crbug.com/362787700.

Bug: chromium:362787700
Change-Id: I1fc8d9dc0b099c67ea7d774034b7691691ff2a50
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5825328
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-08-28 22:57:49 +00:00
Mark Mentovai
50faaf111e Revert "Don't redefine macros from base/compiler_specific.h."
This reverts commit 458bdec9852280f091a72f9d90eb75f04d0af05f.

Reason for revert: Crashpad roll into Chrommium failed.

https://chromium-review.googlesource.com/c/5805903
https://ci.chromium.org/ui/p/chromium/builders/try/android-x64-rel/171929/
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8738938901079891665/+/u/compile__with_patch_/stdout

While linking libcrashpad_handler_trampoline.so:

```
ld.lld: error: undefined symbol: std::__Cr::__libcpp_verbose_abort(char const*, ...)
>>> referenced by ascii.cc
>>>               obj/third_party/abseil-cpp/absl/strings/strings/ascii.o:(std::__Cr::__throw_out_of_range(char const*))
>>> referenced by lightweight_quarantine.cc
>>>               allocator_core/lightweight_quarantine.o:(partition_alloc::internal::LightweightQuarantineBranch::~LightweightQuarantineBranch()) in archive obj/base/allocator/partition_allocator/src/partition_alloc/liballocator_core.a
>>> referenced by lightweight_quarantine.cc
>>>               allocator_core/lightweight_quarantine.o:(partition_alloc::internal::LightweightQuarantineBranch::Purge()) in archive obj/base/allocator/partition_allocator/src/partition_alloc/liballocator_core.a
>>> referenced 1 more times
[…]
ld.lld: error: undefined symbol: std::get_new_handler()
[…]
ld.lld: error: undefined symbol: _Unwind_Backtrace
[…]
ld.lld: error: undefined symbol: _Unwind_GetIP
[…]
ld.lld: error: undefined symbol: __cxa_guard_acquire
[…]
ld.lld: error: undefined symbol: __cxa_guard_release
[…]
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```

Original change's description:
> Don't redefine macros from base/compiler_specific.h.
>
> `DISABLE_CFI_ICALL` is already defined in that header; use it.
>
> This is both simpler and less likely to trigger macro redefinition
> errors.
>
> Bug: none
> Change-Id: I3ecfe9b6dc4ac42c6a69b3fd9c6d2c68fe8e62a2
> Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5805458
> Reviewed-by: Mark Mentovai <mark@chromium.org>

Bug: none
Change-Id: Ie225e03e07ab3d0a00933217b377cee14fcdb8b7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5806223
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-08-22 16:33:50 +00:00
Peter Kasting
756637881a Roll crashpad/third_party/mini_chromium/mini_chromium/ 7eca85315..e04c707cb (3 commits)
7eca853158..e04c707cb3

$ git log 7eca85315..e04c707cb --date=short --no-merges --format='%ad %ae %s'
2024-08-21 pkasting Remove `WPRINTF_FORMAT`.
2024-08-21 pkasting Move/remove macros in compiler_specific.h to match Chromium.
2024-08-13 pbos Remove NOTREACHED_IN_MIGRATION()

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: none
Change-Id: Ief091ad8f6f9a775ccf8b53fb5f884be6834b0f3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5805983
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-22 02:48:21 +00:00
Peter Kasting
458bdec985 Don't redefine macros from base/compiler_specific.h.
`DISABLE_CFI_ICALL` is already defined in that header; use it.

This is both simpler and less likely to trigger macro redefinition
errors.

Bug: none
Change-Id: I3ecfe9b6dc4ac42c6a69b3fd9c6d2c68fe8e62a2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5805458
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-22 02:47:50 +00:00
Peter Kasting
adb22c8169 Switch from ALIGNAS() to alignas().
There is no longer a need to use this macro; compilers have no problem
with `alignas()` nowadays.

Subsequent CLs will remove the macro entirely once it's unused in both
Crashpad and Chromium.

Bug: none
Change-Id: I94675f3f674f9bc32a213e972a017980dcd1c014
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5805982
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2024-08-22 00:55:59 +00:00
Peter Boström
6265674c98 Migrate to NOTREACHED()
This was tested locally by adding "-Wunreachable-code-aggressive" after
making NOTREACHED() [[noreturn]] in mini_chromium and then getting that
to compile.

Bug: chromium:40580068
Change-Id: I7ec1c72be1d73436d128660a621e9060eaebaee8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5780891
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-14 03:11:45 +00:00
Peter Boström
cc54fcc7f5 Fix trailing NOTREACHED_NORETURN()
This alias is not present in mini_chromium and disappearing from
chromium.

Bug: chromium:40580068
Change-Id: Ib6218d96df3bb8b2fe46af08ac51d6362c7db64e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5783604
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-14 01:57:47 +00:00
Peter Boström
ee8369ffb2 Roll crashpad/third_party/mini_chromium/mini_chromium/ bd56f6933..7eca85315 (1 commit)
bd56f6933f..7eca853158

$ git log bd56f6933..7eca85315 --date=short --no-merges --format='%ad %ae %s'
2024-08-13 pbos Use abort() for NOTREACHED()

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:40580068
Change-Id: Ia731e0fb3e5e4a50f61abf14d646089582cd1a50
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5784235
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-13 01:19:28 +00:00
Mark Mentovai
6159a43ff1 Update cpp-httplib to c5c54b31e2bf (0.16.2)
This includes an upstreamed version of the Crashpad-local 1a62a0182557
(https://chromium-review.googlesource.com/c/5769752) for BoringSSL
compatibility.

50fce538c685 threadsafe CLOEXEC on platforms that support it
fb739dbaecf3 threadsafe accept on windows, linux
ed0719f2bcb5 Code format
521529d24d38 Fix #1481 (with content provider) (#1527)
e00fd06355e8 Release v0.16.1
ff038f98b701 Merge branch 'thread-safe-cloexec' of
             github.com:kdombroski/cpp-httplib into kdombroski-thread-
             safe-cloexec
ae63b89cbf70 Use SOCK_CLOEXEC instead of __linux__
69c84c9597c3 BoringSSL compatibility fixes (#1892)
c5c54b31e2bf Release v0.16.2

Change-Id: I01485010de53ae599e22c8ce3c9d6af046d47c24
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5769660
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-08-08 16:22:48 +00:00
Mark Mentovai
1a62a01825 BoringSSL compatibility fixes for cpp-httplib
This fixes errors observed while building
util/http_transport_test_server/http_transport_test_server.cc, shown
below.

The fixes include:
 - Library version check: tolerate BoringSSL as an alternative to
   OpenSSL 3.
 - Don’t call `OPENSSL_thread_stop`, which is not in BoringSSL.
 - Use `SSL_get_peer_certificate` (deprecated in OpenSSL 3), the old
   name for `SSL_get1_peer_certificate`, because the new name is not in
   BoringSSL.
 - Call `SSL_set_tlsext_host_name` directly instead of making a quirky
   `SSL_ctrl` call that BoringSSL does not support. The feared
   -Wold-style-cast warning that occurs when buidling with OpenSSL is
   not triggered in BoringSSL.

Compilation errors from
https://chromium-review.googlesource.com/c/5766975?checksPatchset=1&tab=checkshttps://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1909715/
→ “10. compilator steps (with patch)” → “31. compile (with patch)” →
stdout
(https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8740323272553670737/+/u/compile__with_patch_/stdout):

```
In file included from util/net/http_transport_test_server.cc:42:
third_party/cpp-httplib/cpp-httplib/httplib.h:275:2: error: Sorry, OpenSSL versions prior to 3.0.0 are not supported
  275 | #error Sorry, OpenSSL versions prior to 3.0.0 are not supported
      |  ^
In file included from util/net/http_transport_test_server.cc:42:
third_party/cpp-httplib/cpp-httplib/httplib.h:733:7: error: use of undeclared identifier 'OPENSSL_thread_stop'
  733 |       OPENSSL_thread_stop ();
      |       ^
third_party/cpp-httplib/cpp-httplib/httplib.h:9062:30: error: use of undeclared identifier 'SSL_get1_peer_certificate'; did you mean 'SSL_get_peer_certificate'?
 9062 |           auto server_cert = SSL_get1_peer_certificate(ssl2);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                              SSL_get_peer_certificate
…/boringssl/src/include/openssl/ssl.h:1784:22: note: 'SSL_get_peer_certificate' declared here
 1784 | OPENSSL_EXPORT X509 *SSL_get_peer_certificate(const SSL *ssl);
      |                      ^
In file included from util/net/http_transport_test_server.cc:42:
third_party/cpp-httplib/cpp-httplib/httplib.h:9083:24: error: use of undeclared identifier 'doesnt_exist'
 9083 |         SSL_ctrl(ssl2, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name,
      |                        ^
…/boringssl/src/include/openssl/ssl.h:5699:38: note: expanded from macro 'SSL_CTRL_SET_TLSEXT_HOSTNAME'
 5699 | #define SSL_CTRL_SET_TLSEXT_HOSTNAME doesnt_exist
      |                                      ^
4 errors generated.
```

Change-Id: I5798f17323672d70f75335cea61094457b54466e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5769752
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-08-07 17:57:22 +00:00
Mark Mentovai
b8658f3806 Use Python shlex instead of the deprecated pipes
pipes is deprecated since Python 3.11 and is scheduled for removal in
Python 3.13 (https://peps.python.org/pep-0594/#deprecated-modules), with
shlex.quote being available since Python 3.3.

This was already implemented downstream in Chromium at
https://chromium.googlesource.com/chromium/src/+/8dc44aaeff04 without
following the instructions in third_party/crashpad/README.chromium, and
collided during the update at
https://chromium-review.googlesource.com/c/5766975.

Bug: 1453653
Change-Id: If54bd260e6f571c58f44568e79adafade5b1987e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5767512
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-08-06 20:30:30 +00:00
Justin Cohen
9b3ff691e9 Upgrade simulator tests to iPhone 15 running iOS 17.4
Bug: 356640476
Change-Id: Ic715b20d7e8263854b1301d1bc74152a3becb206
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5758238
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-08-01 21:27:47 +00:00
Mark Mentovai
d380daf704 Update cpp-httplib to 6a848b1a1643
Most significantly, this includes:

6a848b1a1643 Require a minimum of TLS 1.2 (#1889)

Although Crashpad only uses cpp-httplib in tests, there’s no reason to
taunt fate with this tempting juicy morsel. TLS 1.1 is deprecated
(https://datatracker.ietf.org/doc/html/rfc8996, 2021-03).

This includes a change to util/net/http_transport_test_server.cc to
ensure that the test server, which runs in a child process, continues to
return the full multipart request body as it had in the past. Since
cpp-httplib 7e420aeed361 introduced multipart handling, the raw
multipart wrapper no longer appears in Request::body, but is instead
made available at Request::files. With this change, the test server will
reconstitute the original request body to match the test’s expectations.
Note that this isn’t the only way to serialize the request to be
conveyed back to the test, but it’s the most expedient because it’s what
the test already expects, and because the existing framing already takes
the form of the raw HTTP request.

Change-Id: Ia4adaedff0873976f7cc5be138d78f931165fe4e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5753782
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2024-07-31 17:46:48 +00:00
Daniel Cheng
aef7de4e93 [MSan] "Fix" use-after-dtor in InitializationState.InitializationState
Since the test is specifically trying to exercise UB by testing the
state of an object it is already destroyed, unpoison the memory to
suppress MSan errors.

Bug: 40222690
Change-Id: I840e944f5e8b39668ac05d8d641fdd5f2e3db5ac
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5716150
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-07-17 17:08:24 +00:00
Takuto Ikuta
a1fc5d728b Revert "DEPS: fix version of fuchsia/sdk/core to avoid build error"
This reverts commit a63adda6278e9caa75361051cb23fd914e533151.

Reason for revert:
This is not necessary after https://crrev.com/c/5585353.

Original change's description:
> DEPS: fix version of fuchsia/sdk/core to avoid build error
>
> This is a temporary workaround to avoid error like
> https://ci.chromium.org/ui/p/crashpad/builders/try/crashpad_fuchsia_arm64_dbg/1299/overview
>
> Bug:  41489832
> Change-Id: Ia5404b5d7a2f01f53211fba7b8d602b9236ccbd3
> Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5599904
> Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
> Reviewed-by: Mark Mentovai <mark@chromium.org>

Bug: 41489832
Change-Id: I2c6d3c3008047a6f79fb3bfddd8240a758ee645a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5599914
Reviewed-by: Mark Mentovai <mark@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2024-06-06 03:01:20 +00:00
Takuto Ikuta
c09de98737 remove references to goma
goma is not maintained anymore.

Bug: 41489832
Change-Id: Ic82524205c7593ddba041c253e7d6283f9c89f33
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5599864
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2024-06-06 01:46:46 +00:00
Takuto Ikuta
a63adda627 DEPS: fix version of fuchsia/sdk/core to avoid build error
This is a temporary workaround to avoid error like
https://ci.chromium.org/ui/p/crashpad/builders/try/crashpad_fuchsia_arm64_dbg/1299/overview

Bug:  41489832
Change-Id: Ia5404b5d7a2f01f53211fba7b8d602b9236ccbd3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5599904
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-06-06 01:46:12 +00:00
Hzj_jie
25c079d731 [Fuchsia] Run fuchsia-gn-sdk from chromium
The latest build rules have the ffuchsia-api-level.
Need https://crrev.com/c/5586319.

Bug: fuchsia:42085580, fuchsia:327691011
Change-Id: I21383e02f9fff3db9405c0dbe42051122a325003
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5585353
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-06-05 23:10:01 +00:00
Justin Cohen
0bebda66a8 ios: Remove duplicate implementations of ReadStringSysctlByName
Bug: crashpad: 480
Change-Id: Ie37c557d2170f6d96968ec4922ec52bfc6ad8136
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5580854
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-06-04 18:25:16 +00:00
Ben Pastene
cd0b7c2cd4 infra: Move crashpad ci/try builds from Ubuntu-18.04 to Ubuntu-22.04
These are the last remaining jobs on the last remaining bionic pools.
Moving these over should let the bionic flex pool finally be decommed.

All of chrome/chromium has been on Ubuntu-22.04 for months now. So
hopefully this is transparent for crashpad.

Bug: chromium:40255350
Change-Id: I82828c0ae0c6efc8868b33779d7ebf5fb9b16116
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5550958
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-05-21 15:55:36 +00:00
Peter Boström
6af42bc0b2 Use NOTREACHED_IN_MIGRATION()
This was generated by replacing "  NOTREACHED()" with
"  NOTREACHED_IN_MIGRATION()" and running git cl format.

This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.

Bug: chromium:40580068
Change-Id: Idb68e2fc8adba180350b0595fd494cf0f206bded
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5548246
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2024-05-17 16:30:52 +00:00
Peter Boström
efd29a76c9 Roll crashpad/third_party/mini_chromium/mini_chromium/ a6607b1fd..5856e1ea6 (2 commits)
a6607b1fd7..5856e1ea61

$ git log a6607b1fd..5856e1ea6 --date=short --no-merges --format='%ad %ae %s'
2024-05-16 pbos Add NOTREACHED_IN_MIGRATION()
2024-05-11 pwjworks Remove workaround for missing std::atomic_thread_fence

Created with:
  roll-dep crashpad/third_party/mini_chromium/mini_chromium

Bug: chromium:40580068
Change-Id: I6d1385739042fa5b826bfa91c50b914eebaaf8fd
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5544927
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-05-17 00:10:03 +00:00
Ben Hamilton
d588c50b16 [ScopedSpinGuard] Use std::atomic::compare_exchange_strong() for spinlock
Previously, ScopedSpinGuard used std::atomic::compare_exchange_weak()
in a loop to implement a spinlock. After looping for the specified
number of nanoseconds, it would give up and return an error.

A few bugs have come in on ARM platforms (https://crbug.com/340980960,
http://b/296082201) which indicate that this can fail even in
single-threaded cases where nothing else has the spinlock.

From https://cbloomrants.blogspot.com/2011/07/07-14-11-compareexchangestrong-vs.html :

> compare_exchange_weak exists for LL-SC (load linked/store
> conditional) type architectures (Power, ARM, basically everything
> except x86), because on them compare_exchange_strong must be
> implemented as a loop, while compare_exchange_weak can be
> non-looping.

and:

https://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange#Notes

> compare_exchange_weak is allowed to fail spuriously, that is, acts
> as if *this != expected even if they are equal. When a
> compare-and-exchange is in a loop, compare_exchange_weak will yield
> better performance on some platforms.
>
> When compare_exchange_weak would require a loop and
> compare_exchange_strong would not, compare_exchange_strong is
> preferable [...]

My conclusion is that this logic needs to use
`compare_exchange_strong` to avoid spurious failures on ARM in the
common case when there's no other thread holding the spinlock.

Change-Id: I2a08031db6b219d7d14a5cd02b3634985f81ab06

Bug: b:340980960
Change-Id: I2a08031db6b219d7d14a5cd02b3634985f81ab06
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5545257
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
2024-05-16 22:16:59 +00:00
Joshua Peraza
0e043ccf70 Add guard pages to test stacks
Bug: b:340659332
Change-Id: I4c2c82a1868d7a4f4a062a4e7a64258deedfb794
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5542248
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2024-05-16 16:28:52 +00:00
Arthur Wang
aef8303371 Fix format issue
Change-Id: I9756fa76f94cfcb9edc9f8df8ecfa5ff33918c22
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5542412
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
2024-05-15 19:43:28 +00:00
Arthur Wang
4f99326c2e Replace std::unique_ptr with base::HeapArray in process_memory.cc
Bug: crashpad:326459219
Change-Id: Ic5e252285ed1fb1769eef67ddaea00a830d0ee6a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5535006
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
2024-05-14 00:07:05 +00:00
Arthur Wang
1174aa4fc3 Add build/build_config.h in capture_memory.cc
Change-Id: I486e7bcdb205de5b24846a8e782a6163c2ce8829
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5531439
Commit-Queue: Arthur Wang <wuwang@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-05-10 19:34:20 +00:00
Arthur Wang
9032284170 Pull latest Fuchsia toolchain
Change-Id: Ia328c6defc59fc06fcf69a2875a0eed335c8dd78
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5532142
Commit-Queue: Arthur Wang <wuwang@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2024-05-10 18:19:20 +00:00
Arthur Wang
981d4189aa Replace std::unique_ptr<T> with HeapArray
Bug: crashpad: 326459659,326458942,326459376,326459390,326459417,326458979,326459333,326459016,326458338,326458738,326459156,326459512,326458694
Change-Id: I04724530cbef50a8d3c18f306d16c0bbf3b0815b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5512394
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Arthur Wang <wuwang@chromium.org>
2024-05-09 22:16:58 +00:00
Justin Cohen
371083179b ios: Use correct address when storing register memory.
The memory region data saved in the intermediate dump is an address
offset by 128 bytes. However, the MemorySnapshot generated was using the
original address and not the offset address.  The same data is being
captured in the minidump.

Change-Id: Ia34912c035319e79cf446a130e662084f4ab51ea
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5529059
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
2024-05-09 18:56:10 +00:00
danakj
8e60a935d9 Roll mini_chromium to remove the pointer-based overload of RandBytes()
R=mark@chromium.org

Bug: 40284755
Change-Id: I2f491cc3f630767e607ea1df7d21791be522b4de
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5518909
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
2024-05-07 18:02:45 +00:00
danakj
5c09c9a701 Include build_config.h before checking COMPILER_MSVC
This is caught by chromium presubmit when rolling crashpad.

R=mark@chromium.org

Change-Id: Ida9ff07e7b2bd27808c092afbc5a1345fa29a4f3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5515300
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
2024-05-06 14:47:42 +00:00
danakj
84c87739e8 Use the span version of RandBytes
Some unique_ptr<T[]> are also changed to HeapArray in order to
facilitate the change.

Bug: chromuim: 40284755
Change-Id: I30b9d55ff81f23c63ad4958786740f67ee612024
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/5512569
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
2024-05-06 14:12:00 +00:00