VS Code creates a .vscode/ directory in the top level of the repo
to hold config files.
Adding it to .gitignore will make it easier to develop crashpad using
VS Code.
Change-Id: I7afbbbf8ed6c017edc0299a18bf7ad0c11407b93
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6013035
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
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>
- 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>
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>
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>
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>
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>
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>
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>
`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>
`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>
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>
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>
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>
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>
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=checks
→ https://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>
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>
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>
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>
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>
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>
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>