49 Commits

Author SHA1 Message Date
Mark Mentovai
6278690abe Update copyright boilerplate, 2022 edition (Crashpad)
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>
2022-09-06 23:54:07 +00:00
Alex Pankhurst
6c6c2ae563 [fuchsia] migrate test to CFv2
Fuchsia is undergoing a change to how programs are run and the Crashpad
tests must be migrated to the new system.

Bug: fuchsia:102371

TESTED=`fx test crashpad-test` (540 passing, 1 skipped)

Change-Id: I4daf7d160045b28b876a5f1aa93b0bd596461e0d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3817783
Commit-Queue: Alex Pankhurst <pankhurst@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2022-08-08 19:03:20 +00:00
Joshua Peraza
f882d2af82 Add root_gen_dir to crashpad_config
Follows up on discussion in:
https://groups.google.com/a/chromium.org/g/crashpad-dev/c/1-QgplOJnw8

Change-Id: I6def168182f5d3219db4691d4b81ea508fd08a85
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3577803
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2022-04-08 20:13:16 +00:00
Amanda Tait
ec7a457e86 [fuchsia] Inject components from test pkg
Make the `crashpad-test` package hermetic and describe a correct build
graph by explicitly expressing dependency edges to components. Inject
component dependencies from the hermetic package in integration tests.

Bug: fuchsia:84248
Change-Id: I20915acf6171b532b2c94941f33dc8eb90fb6776
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3197800
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2021-10-15 16:27:47 +00:00
Mark Mentovai
883a64e8ee mac/arm64: recognize “Apple M1” as a valid CPU vendor
The DTK reported “Apple processor” in this spot, but shipping hardware
now seems to use “Apple M1”. The DTK is no longer relevant, but for some
degree of future-proofing, look for “Apple ” as prefix in the test.

Test: snapshot_test SystemSnapshotMacTest.CPUVendor
Bug: chromium:1222625
Change-Id: I6ead87ebe9aa078ef9a95e5bcc6a9e5ca8c3b55a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2976787
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2021-06-22 15:28:16 +00:00
Francois Rousseau
21313fad9a fuchsia: allow FATAL log messages in tests
* Crashpash has a few DEATH tests that will FATAL

Fixed: fuchsia:77967
Change-Id: Ifa4326e265d752efaedd6df91f1b6ee61a1e36c1
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2937542
Commit-Queue: Francois Rousseau <frousseau@google.com>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2021-06-03 20:36:02 +00:00
Francois Rousseau
7ad54b8831 fuchsia: allow ERROR log messages in tests
Fixed: fuchsia:77967
Change-Id: Id19a0de3c04630c99c36dea8d52d1ea638214239
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2936513
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2021-06-03 18:23:56 +00:00
Justin Cohen
7f6f917aac ios: Migrate ios/snapshot to reading intermediate dumps.
Change-Id: Ib7715e642fa685a5f607239d07dcb68868cacb09
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2883523
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-05-26 19:36:05 +00:00
Shai Barack
db9863a217 [components] src/sys/build -> build/components
Change-Id: I79c9fcee887b75956c405bf5632d6616c82bd8b8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2826039
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2021-04-17 05:06:03 +00:00
Prashanth Swaminathan
6b55b8adba [crashpad] Migrate to new component templates
Bug: fuchsia:65068
Test: Ran crashpad-test on device.
Test: fx shell crashpad_database_util
Change-Id: I4192030623fc85da9215039424e0bbec7eef8e30
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2758252
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2021-03-17 23:58:11 +00:00
Braden Kell
44de18ca37 Fix instances of undefined behavior
This change removes several unaligned accesses, as well a null pointer
offset and an out of bounds array access.

Bug: fuchsia:46805
Change-Id: I0110d0b7faf672655d978894b868760eee7b2988
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2583025
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2020-12-11 19:18:19 +00:00
Nico Weber
0e03f8e7fa Remove now-no-op set_sources_assignment_filter calls
After https://chromium-review.googlesource.com/c/chromium/src/+/2426564,
not having a sources assignments filter is the default.

No behavior change.

Bug: chromium:1018739
Change-Id: Ia2e6af0d613d3cbdfe6595bfe1f688c1efd55f39
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2446269
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-10-02 17:43:39 +00:00
Tamir Duberstein
f9549d1ffe [fuchsia] Avoid underscores in package names
Bug: fuchsia:22679
Change-Id: I11de95cd91b23bd496d17246a448bcf1995a2814
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2315004
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2020-07-23 17:08:02 +00:00
Tamir Duberstein
13fd1561dc [fuchsia] Mark tests group testonly
Bug: fuchsia:22679
Change-Id: Ief6171ef8b00997edfc36e6fb6214c582a1b3f11
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2315007
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-07-23 02:15:11 +00:00
Tamir Duberstein
1a64e1cdc6 [fuchsia] Add tests group
We'll indirect through this group while we rename crashpad{_,-}tests.

Bug: fuchsia:22679
Change-Id: Ic4ca73ecbd6d3e2776a7b7ee8bbbd5012459be52
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2315003
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Commit-Queue: Tamir Duberstein <tamird@google.com>
2020-07-22 23:46:12 +00:00
Mark Mentovai
fd001f792e build: Make crashpad_dependencies="external" work in the GN build
…for macOS, at least.

Change-Id: Iba45328d957de17198180d171677a45468c9adc2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2290842
Reviewed-by: Eric Astor <epastor@google.com>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-07-11 03:33:33 +00:00
Mark Mentovai
828095ac32 Clear the gn sources_assignment_filter when building in Chromium
Chromium relies on a global gn sources assignment filter, even though
it’s kind of discouraged. Crashpad doesn’t use this, instead selecting
which files to build entirely with the logic in its .gn files. In some
cases, Chromium’s filters prevent _linux files from building on Android,
and _mac files from building on iOS, even though Crashpad’s build has
explicitly requested these inclusions. To overcome this problem,
clear the gn sources_assignment_filter in all of Crashpad’s own .gn
files when building in Chromium.

Change-Id: Iab0af29f4e5aff4be8eec2ee12b2e3f991c0a86d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2285959
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
2020-07-08 04:29:24 +00:00
Mark Mentovai
7cf66d83e6 Restore util tests to crashpad_tests used by Chromium
This was indvertently removed in ea4af71c2ac7, which should have enabled
util tests on iOS, the only platform they had been disabled on.

Change-Id: Id0d618c7268d5db21c2fd32a5f49c1770958d6d7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2286509
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-07-08 04:13:54 +00:00
Mark Mentovai
a45eea40fc Update gtest to e3f0319d89f4cbf32993de595d984183b1a9fc57
I’m most interested in picking up 1b3eb6ef3462, “Explicitly define copy
constructors used in googletest tests.”

This also reorganizes files and rewrites text to refer to this project
as Google Test and googletest (and Google Mock and googlemock), as it
prefers to be known. Some filenames are left at gtest_* following the
precedent set by gtest itself. For example, #include "gtest/gtest.h" is
still used, so #include "test/gtest_death.h" is retained too.
gtest_all_test OutputFileHelpersTest.GetCurrentExecutableName hard-codes
the expected executable name as gtest_all_test among other options that
do not include googletest_all_test, so test executables retain their
names as well.

fb19f57880f6 Add GTEST_BRIEF option
3549237957a1 Ensure that gtest/gmock pkgconfig requirements specify
             version
189299e957bb Merge branch 'master' into quiet-flag
5504ded3ab5c Fix a typo in .travis.yml
6ed4e7168f54 Replace the last instance of `throw()` with `noexcept`. NFC
879fd9b45299 Remove duplicate codes existed in get-nprocessors.sh
644f3a992c28 gtest-unittest-api_test - fix warning in clang build
0b6d567619fe Remove redundant .c_str()
be3ac45cf673 fix signed/unsigned comparison issue (on OpenBSD)
b51a49e0cb82 Merge pull request #2773 from Quuxplusone:replace-noexcept
c2032090f373 Merge pull request #2772 from Quuxplusone:travis
4fe5ac53337e Merge pull request #2756 from Conan-Kudo:fix-pkgconfig-reqs
373d72b6986f Googletest export
4c8e6a9fe1c8 Merge pull request #2810 from ptahmose:master
71d5df6c6b67 Merge pull request #2802 from e-i-n-s:fix_clang_warning
dcc92d0ab6c4 Merge pull request #2805 from pepsiman:patch-1
4f002f1e236c VariadicMatcher needs a non-defaulted move constructor for
             compile-time performance
9d580ea80592 Enable protobuf printing for open-source proto messages
766ac2e1a413 Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_
11b3cec177b1 Fix a -Wdeprecated warning
01c0ff5e2373 Fix a -Wdeprecated warning
c7d8ec72cc4b Fix a -Wdeprecated warning
1b066f4edfd5 Add -Wdeprecated to the build configuration
4bab55dc54b4 Removed a typo in README.md
a67701056425 Googletest export
fb5d9b66c5b0 Googletest export
1b3eb6ef3462 Googletest export
b0e53e2d64db Merge pull request #2797 from Jyun-Neng:master
d7ca9af0049e Googletest export
955552518b4e Googletest export
ef25d27d4604 Merge pull request #2815 from Quuxplusone:simple
129329787429 Googletest export
b99b421d8d68 Merge pull request #2818 from inazarenko:master
472cd8fd8b1c Merge pull request #2818 from inazarenko:master
3cfb4117f7e5 Googletest export
0eea2e9fc634 Googletest export
a9f6c1ed1401 Googletest export
1a9c3e441407 Merge pull request #2830 from keshavgbpecdelhi:patch-1
e589a3371705 Merge pull request #2751 from calumr:quiet-flag

Change-Id: Id788a27aa884ef68a21bae6c178cd456f5f6f2b0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2186009
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-05-07 14:56:07 +00:00
Francois Rousseau
6d8b196150 [fuchsia] remove handler
* Fuchsia only uses Crashpad for minidump generation, report database
  and report upload, not for the actual exception handling so it does
  not need a handler class
* the current handler class didn't have tests anyway
* Chromium on Fuchsia relies on the platform exception handling instead
  of rolling its own Crashpad exception handler
* this avoids us having to maintain an exception handler in another repo
* this removes the last FIDL dependency in Crashpad

TESTED=`fx test crashpad_test`

Change-Id: Ie3998f709e7cc4252dd551882a23b337864da85e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2165638
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2020-04-24 23:20:08 +00:00
Mark Mentovai
64c65b5757 ios: Build and test the minidump library
Bug: crashpad:31
Change-Id: I7c3974907114430a9674c3baae3ae359d5ed596e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2156965
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-04-20 15:46:14 +00:00
Justin Cohen
ea4af71c2a Add another iOS library path sinkhole.
Add another sinkhole for _UIGestureEnvironmentUpdate.

Bug: crashpad:31
Change-Id: Ic4a424da034249295b6e45f8fe0860a4d4696b93
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2145017
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2020-04-16 15:25:57 +00:00
Joshua Peraza
af2be80bdb android: configure a native test suite
Most Android tests in Chromium's infrastructure are
launched from an APK, but that's not appropriate for
Crashpad where many things expect to be run in a
plain executable.

Bug: chromium:1050178
Change-Id: I6eeb3f5e4889193e5bbe2a3bad2cd99a18e970ba
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2112342
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2020-03-23 21:54:41 +00:00
Justin Cohen
b109e4ce38 [ios] Bring up first draft process and module snapshot.
Gather most of the necessary information for the module snapshot.

Note that:
 - The 'capture' portion of this CL will be moved out of the snapshot
   interface and into a separate in-process dump to disk location.
 - All of the pointer dereferences need to be wrapped in vm_read.
 - The read-fast-and-dump logic in module_snapshot may end up in a
   different file completely, but until we pick a
   serialization/deserialization method, keep it in module_snapshot_ios.

Change-Id: Ie80c739c167634520d13ec920a29a80116aa3bfe
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2079196
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2020-03-05 15:42:35 +00:00
Leonard Chan
8bad6f140e [UBSan] Temporarily disable UBSan for gtest and file
These should be the remaining instances of UB errors we see.

Bug: fuchsia:46805
Change-Id: Id8285386fd6cb52518f6076ddb79ac60025f9f87
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2067754
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2020-02-24 17:26:35 +00:00
Leonard Chan
0c20aeabd3 [UBSan] Temporarily disable UBSan for snapshot and minidump
UBSan was reporting reference binding to a misaligned address in Fuchsia.
Disable UBSan for this target for now just to silence the runtime
warnings, then come back and fix them.

Bug: fuchsia:46805
Change-Id: Ic5d9b35161b6d998f1ff50eb8e978c44aff9b4ef
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2068051
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2020-02-21 21:20:59 +00:00
Yilong Li
f79cba47ba [lsan][crashpad] Suppress leak sanitizer on crashpad_test.
Leak sanitizer detected bugs on the above tests. We suppress
the leak sanitizer on the leaky targets for now, and these leaks
need to be fixed to fully enable leak detector.

Bug: fuchsia:46559
Change-Id: I0bd7a43cfefc0d4ac213651de6dceea4404c243b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2067412
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2020-02-21 06:36:08 +00:00
Justin Cohen
75ea787a80 Adds plumbing for xcuitests with a placeholder test.
Also adds basic integration for EDO.

Change-Id: If3d193a4967a566b55d6d446585e2988dacad6e6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2028183
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-31 03:39:51 +00:00
Nico Weber
2fd16e3392 Reformat all gn files
Port of chromium-side
https://chromium-review.googlesource.com/c/chromium/src/+/1997899

Bug: chromium:1041419
Change-Id: Ic7afefa0dea024da37fe4bb0f965840a160e2166
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2015428
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-23 13:59:00 +00:00
Rohit Rao
bd1aa246ca Starts compiling the crashpad_test_test target on iOS.
Brings up the subset of tests that pass on iOS without any modifications.
Additional tests will be added later as they are updated to pass on iOS.

Excludes non-compiling targets from the iOS build so that the default target
compiles cleanly.

Rolls mini_chromium to cdab1e6263ec7f3f61763efc1dac863f8dc07c80.
  2019-11-01 rohitrao Adds GN support for XCTest on iOS.
  2019-10-29 rohitrao Fixes for iOS compilation and running on iOS devices.

BUG=crashpad:31

Change-Id: I918f10fc941b37fa89b08ce87828dd4299437096
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1895905
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
2019-11-07 16:55:37 +00:00
Joshua Peraza
1b60c8172c commit test ssl certificate to testdata
Chromium requires build artifacts to be generated deterministically so
commit a long-lived (10 years) test certificate to the repository.

Change-Id: I7a6e2441f506196ca58fbbf757648fa0ac70bc9a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1872188
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-11-05 17:47:01 +00:00
Mark Mentovai
3332ae3546 compat: Provide <elf.h> and <mach-o/loader.h> for everyone
I’m working on something that I’m not ready to share, but maintaining
these compat headers in my local branch is becoming annoying because
“git cl format” keeps reformatting them since they were added since my
local branch point.

Because these headers are non-trivial, they’re brought nearly unmodified
from upstream into third_party, with forwarding from the appropriate
locations in compat.

<elf.h> comes from glibc 2.29 (2019-01-31) and was modified to remove
the #include of <features.h> and to replace the use of __BEGIN_DECLS and
__END_DECLS with the proper conditional extern "C" construct.

<mach-o/loader.h> comes from xnu 4903.221.2 (macOS 10.14.1, 2018-10-30)
and was modified to remove the unused #includes of
<mach/machine/thread_status.h> and <architecture/byte_order.h>. Rather
than taking <mach/machine.h> and <mach/vm_prot.h> with a spider web of
other dependencies from xnu, compat has cut-back versions of these
headers that provide only the required typedefs.

This also includes an update of apple_cf to 1153.18 (OS X 10.10.3,
2015-04-08), the last public release of CF-Lite. The change doesn’t do
much for our purposes, but it restores the file to an Apple-shipped
state, trailing whitespace and all.

This also canonically formats BUILD.gn. 48ee086ca4c4c didn’t format it.

Change-Id: Ib4f28ad53d9757bd0eed838e148c51172bfe30b1
Reviewed-on: https://chromium-review.googlesource.com/c/1489795
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-26 22:48:14 +00:00
Scott Graham
48ee086ca4 fuchsia: Update to run crashpad_test as package rather than from /system
In the Fuchsia tree, tests can now be run via `fx run-test crashpad_test`.

Bug: crashpad:196

Change-Id: I427cde7090b00b46c9d6a948664701f98b014e9d
Reviewed-on: https://chromium-review.googlesource.com/c/1481811
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Francois Rousseau <frousseau@google.com>
2019-02-25 22:03:47 +00:00
Joshua Seaton
21edfd3c3a [fuchsia] Move non-tests out of tests in the crashpad_tests package
Test: /system/test/crashpad_tests successfully ran locally
Change-Id: Iefefc1728444205efee5d22cbbd63a19869609df
Reviewed-on: https://chromium-review.googlesource.com/c/1259447
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2018-10-03 22:36:59 +00:00
Mark Mentovai
f8b0538406 fuchsia: Don’t require test certificate setup for disabled TLS tests
This is a follow-up to e6f26587e435.

Bug: DX-382
Change-Id: I3116ea5dd2eca33961465d62c9200aa8dd1baf5d
Reviewed-on: https://chromium-review.googlesource.com/1173339
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-08-13 23:35:08 +00:00
Scott Graham
2771ebf805 fuchsia: Package test cert and key when running in Fuchsia tree
Bug: crashpad:196
Change-Id: I18f7686a9b5127143501c2b21663d80aae3d1f54
Reviewed-on: https://chromium-review.googlesource.com/1100494
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2018-06-14 03:25:28 +00:00
Roland McGrath
9839ef5605 Clean up Fuchsia package()
The libraries key is deprecated.  The new loadable_modules key is the right
thing to use.  The dependencies should not specify the toolchain.

Change-Id: I2f218adce96b7161a5a0097f84c7ed6b0c87e3bd
Reviewed-on: https://chromium-review.googlesource.com/1071067
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-24 03:01:21 +00:00
Scott Graham
dea8fa51d0 fuchsia: Changes to allow analyzer-style exception handling
The integration into the Fuchsia tree is still being negotiated, but
I've added crashsvc on that side
https://fuchsia.googlesource.com/zircon/+/HEAD/system/core/crashsvc/crashsvc.cpp,
which handles exceptions and spawns something to actually deal with the
crashed process. This means that there's no resident thing, so it seems
simplest to use handler/crash_report_exception_handler directly, rather
than add another wrapper binary. At some point it may make sense to roll
this functionality back into Crashpad upstream, we'll see how it
evolves.

Additionally, the "normal" crashpad_handler model may still be necessary
if Chrome wants to use a copy locally (rather than the system handler).

To accomplish this:
- Split crashpad_handler and crashpad_database_util packages so
  crashpad_database_util can still be included into the system image for
  debugging.
- Add handle-based version of HandleException() to
  CrashReportExceptionHandler (and also remove the "type" argument because
  I've come around to realizing there's no point to it, finally. :)

Bug: crashpad:196
Change-Id: I38872183ee3691c0938c5b761e6b73c80019f355
Reviewed-on: https://chromium-review.googlesource.com/1057833
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-14 21:54:34 +00:00
Scott Graham
95a052dc0d fuchsia: When in Fuchsia, move helper binaries to subdir
In my ongoing quest to break the Fuchsia tree in as many ways as
possible...

All binaries found in /system/test are automatically run. So when
http_transport_test_server and
crashpad_test_test_multiprocess_exec_test_child are unexpectedly run
they just hang, breaking the overall test run. To avoid this, package
them into a subdirectory which is the preferred solution.

Bug: crashpad:196
Change-Id: If79c2c8c5493214fddbb2fa6de6f69ee0c78d9bd
Reviewed-on: https://chromium-review.googlesource.com/1054782
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-11 00:26:57 +00:00
Scott Graham
e2b934cc40 fuchsia: Don't depend explicitly on the x64 toolchain
Not surprisingly, x64-shared did not work in the arm64 build. 9_9

I've asked the Fuchsia toolchain team if this is the correct way to use
the toolchain definition as it seems a bit awkward, but for now it seems
like the only way to depend on the .so files in packages.

Bug: crashpad:196
Change-Id: I998bf4feffd9499276bfc29229e5aadc1ae976f2
Reviewed-on: https://chromium-review.googlesource.com/1054487
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-10 21:34:22 +00:00
Scott Graham
f55a8d4ff3 fuchsia: Work around lack of packaging in Fuchsia tree build
Packaged test running seems to be a ways off, but with a bit of path
fiddling in test_paths.cc we can actually use the paths where the tests
are copied, so do that instead to get all the tests re-enabled. The
setup in BUILD.gn should be mostly-useful once packaging is working as
all helper/data files will need to specified there anyway.

Also, attempted fix to flaky behaviour in
ProcessReaderFuchsia.ChildThreads exposed because the tests are now
being run. zx_object_wait_many() waits on *any* of the objects, not
*all* of them. Derp!

And finally, for the same test, work around some unintuitive behaviour
in zx_task_suspend(), in particular that the thread will not be
suspended for the purpose of reading registers right away, but instead
only "sometime later", which appears in pratice to be after the next
context switch. Have ScopedTaskSuspend block for a while to try to
ensure the registers become readble, and if they don't, at least fail
noisily at that point.

Bug: crashpad:196
Change-Id: I01fb3590ede96301c941c2a88eba47fdbfe74ea7
Reviewed-on: https://chromium-review.googlesource.com/1053797
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-10 19:28:10 +00:00
Scott Graham
f115659a67 fuchsia: Include crashpad_database_util in package
Also, add both crashpad_handler and crashpad_database_util to "binaries"
which causes them to be included in the final system image.

Bug: crashpad:196
Change-Id: Iaf1bf7bbc0a5370695372fd01d7c3da35906dfc3
Reviewed-on: https://chromium-review.googlesource.com/1050576
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-08 20:10:00 +00:00
Scott Graham
7274c9823f fuchsia: Various build fixes for building in Fuchsia tree
- Use "deprecated_system_image" (merging from downstream)
- Add package for crashpad_handler
- Depend on launchpad target instead of a lib when in tree, as launchpad
  is no longer in the sysroot.
- Don't try to remove the -Wexit_time_destructors unless building
  standalone, when it's added by mini_chromiums BUILDCONFIG.gn

Bug: crashpad:196
Change-Id: I08e0faaa989346b078a41896eb4ace69e7b1bcdc
Reviewed-on: https://chromium-review.googlesource.com/1026514
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-04-24 22:34:20 +00:00
Scott Graham
970ac5a636 fuchsia: Package setup for crashpad_test for in-Fuchsia build
third_party/googletest has been added to the Fuchsia manifest now (which
is a recent copy of googletest that includes googlemock). The BUILD.gn
file isn't there yet, but is in progress.

With these changes, all targets build in-Fuchsia once the googletest
BUILD.gn file lands.

Bug: crashpad:196
Change-Id: I34d2d7046dd2762b4d1f4873be97258df32adddf
Reviewed-on: https://chromium-review.googlesource.com/861242
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-01-16 22:35:41 +00:00
Scott Graham
ab153f7e1b gn: Avoid depending on BUILDCONFIG.gn globals
Goes with https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/834648.

Includes mini_chromium DEPS roll to pull in edfe51ce81

Bug: crashpad:79, crashpad:196
Change-Id: Ib45cc738aecf9ae727f8faeff81f3b71e2dc9de8
Reviewed-on: https://chromium-review.googlesource.com/834543
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-19 23:38:36 +00:00
Scott Graham
457cc6a34f gn: Refactor build files to avoid build/secondary
In doing standalone bringup of Crashpad targeting Fuchsia, it seemed
tidy to keep the same literal paths to the dependencies that Chromium
needed and add stubs/forwarding to build/secondary in the Crashpad tree
as required to make those work.

However, when trying to build Crashpad in the Fuchsia tree itself, that
would require adding forwarding files to the Fuchsia tree to match the
Chromium directory structure, which would be awkward. Instead, have
explicit dependencies in the Crashpad tree that select the locations
for various dependencies.

Bug: crashpad:79, crashpad:196
Change-Id: Ib506839f9c97d8ef823663cdc733cbdcfa126139
Reviewed-on: https://chromium-review.googlesource.com/826025
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-12-18 22:53:58 +00:00
Scott Graham
3f5c939c84 gn: Next step in getting compilation working
- Correctly sets target_cpu and current_cpu so correct toolchain
  can be used on Fuchsia.
- Introduces GN argument "crashpad_in_chromium" which defaults to
  false. Used to set CRASHPAD_IN_CHROMIUM define, determine which
  zlib path to use, and how to package the test targets into
  binaries (one big one in Chromium, separate in Crashpad).

Bug: crashpad:79, crashpad:196
Change-Id: If6560dc064308ed6f8bf7c75cf74f684a3522e8b
Reviewed-on: https://chromium-review.googlesource.com/797354
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2017-11-29 19:46:08 +00:00
Scott Graham
2bb56fafe3 Rework GN files to start to support building standalone, and also in Chromium
- Adds a .gn and a build/BUILDCONFIG.gn that uses mini_chromium's
  build/BUILD.gn.
- Adds some stub BUILD.gn files in locations where Chromium expects them
  (in //build, //testing, //third_party) containing empty targets/configs.
  These are no-ops in standalone builds, but add functionality when
  building in Chromium.  This is in preference to having a global bool
  that conditionally does Chromium-y things in the Crashpad build files.
  These stub files are all contained in a secondary source root in
  build/chromium_compatibility, referred to by //.gn.
- Adds //base/BUILD.gn which forwards to mini_chromium/base. This is
  only used when building standalone so that both Chromium and Crashpad
  can refer to it as "//base".
- Changes references to other Crashpad targets to be relatively
  specified so that they work when the root of the project is //, and also
  when it's //third_party/crashpad/crashpad as it is in Chromium.
- Moves any error-causing Mac/Win-specific files into explicit if (is_mac)
  or if (is_win) blocks as part of removing the dependency on
  set_sources_assignment_filter().

As yet unresolved:
- CRASHPAD_IN_CHROMIUM needs to be removed when standalone; to be tackled
  in a follow up.
- Not sure what to do with zlib yet, the build file currently assumes
  "in Chromium" too, and similarly having Crashpad //third_party/zlib:zlib
  pointing at itself doesn't work.

Bug: crashpad:79
Change-Id: I6a7dda214e4b3b14a60c1ed285267ab97432a1a8
Reviewed-on: https://chromium-review.googlesource.com/777410
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2017-11-28 20:29:35 +00:00
Scott Graham
d5ead4d70f Upstream lightly modified Chromium BUILD.gn files
Unreferenced, and not working at all in Crashpad-standalone.

Copied from Chromium at 52a9831d81f2099ef9f50fcdaca5853019262c35 to have
a point where a roll back into Chromium should be a no-op (with Chromium's
build/secondary/third_party/crashpad/... removed).

I'm not sure what we want to do about the various gni references into
Chromium (e.g. //build/config/sanitizers/sanitizers.gni, //testing/test.gni,
etc.) but I guess the sooner they live in Crashpad rather than in Chromium
the sooner we can figure out the sort of knobs and dials we need.

Bug: crashpad:79
Change-Id: Id99c29123bcd4174ee2bcc128c2be87e3c94fa3f
Reviewed-on: https://chromium-review.googlesource.com/777819
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2017-11-20 18:08:23 +00:00