236 Commits

Author SHA1 Message Date
Peter Boström
1aa478d161 Remove DISALLOW_* macros in crashpad
This change was partially scripted and partially done manually with vim
regex + manually placing the deleted constructors.

The script change looked for destructors in the public: section of a
class, if that existed the deleted constructors would go before the
destructor.

For manual placement I looked for any constructor in the public: section
of the corresponding class. If there wasn't one, then it would ideally
have gone as the first entry except below enums, classes and typedefs.
This may not have been perfect, but is hopefully good enough. Fingers
crossed.

#include "base/macros.h" is removed from files that don't use
ignore_result, which is the only other thing defined in base/macros.h.

Bug: chromium:1010217
Change-Id: I099526255a40b1ac1264904b4ece2f3f503c9418
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3171034
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
2021-09-21 15:09:44 +00:00
Tamir Duberstein
5e43f1ed0a Remove fuchsia.net.NameLookup
This protocol is replaced with fuchsia.net.name.Lookup.

Bug: 1231266
Change-Id: I77c90ad8df03fa14c2a00aa819a7dd7b764c5fd6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3136173
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2021-09-01 16:50:41 +00:00
Joshua Peraza
78bcb55e1c Construct ProcessMemoryLinux using PtraceConnection
Update ProcessMemoryLinux to be constructed from PtraceConnection
instead of being Initialize()d with a pid_t.

This allows consolidating PtraceClient's BrokeredMemory with
ProcessMemoryLinux and providing the PtraceConnection as a alternative
to the memory file (previously only done for brokered connections).

Change-Id: I1363e208030eaf595fb8051e9a2c6b255c1f9886
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3072402
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2021-08-11 15:48:33 +00:00
David Fang
d5d78c1469 [third_party] Make mini_chromium relocatable
This will accommodate moving third_party/mini_chromium around.
The default location is unchanged for now.

There are GN variables that may need to be updated when Fuchsia's source
re-organizes its layout:

* mini_chromium_source_parent : this contains a BUILD.gn with groups and
encloses the mini_chromium_source_root.  This is controlled by the
structure of the project that depends on this project.

* _mini_chromium_source_root : this is what is normally checked out from
git, the upstream source directory

* mini_chromium_import_root : points inside source_root to make GN files
accessible.

This first step breaks out case logic for "if (crashpad_is_in_fuchsia)"
even if the value is unchanged for now.  This will faciliate a smaller
change when Fuchsia re-structures third_party sources.

Change-Id: I09e5362f4be8fdb440e3891422881b1053052341
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3062424
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2021-08-11 15:26:03 +00:00
Tamir Duberstein
a62b654838 Add fuchsia.net.name.Lookup
This is needed to facilitate transitioning from fuchsia.net.NameLookup.

Bug: 49741
Change-Id: Ife6015bfe58c01aad98d12b13cecd4bb56b34537
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3036084
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2021-07-16 22:08:48 +00:00
Joshua Peraza
3ae82cd30a Remove gyp
Standalone Crashpad for Android can now be built with gn.

Change-Id: I0ee7f8e1af8c2bc0edb88e93b345abd7d739f33c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3034984
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2021-07-16 17:09:48 +00:00
Shai Barack
c4081b8e6d fuchsia: Port syslog includes to use SDK path
Change-Id: Id52dab839af3bd29b425ea6339153e9a55d70430
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2991505
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2021-06-28 16:26:49 +00:00
Justin Cohen
3b0ebc29cd Cleanup some diffs between Chromium and Crashpad.
Some header changes (page_size), formatting and exception processor
cast changes.

Change-Id: Id1d2dd99ee6d82b5322692894e4e12e96fcac030
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2936663
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2021-06-28 14:25:39 +00:00
Shai Barack
cbec52f327 fuchsia: rebase include paths to //
See: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=78683

Bug: fuchsia:78683
Change-Id: Ibf6d79d9fdb38122faa3a079f291a9017913f168
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2959009
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2021-06-15 21:03:28 +00:00
Justin Cohen
ce378c4293 Fix some chromium roll errors and warnings.
Remove unneeded base/strings/stringprintf.h includes.
ARCH_CPU_X86_64 macro is used without including build/build_config.h
Missing base/check.h

Change-Id: Ib7864ab7b30ef8fc37649783f7b90b618d0d6a0b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2920552
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2021-06-02 22:02:42 +00:00
Lei Zhang
d8f60c8112 Swap from base/stl_util.h to cxx17_backports.h.
Chromium moved base::size() to base/cxx17_backports.h, so do the same in
mini_chromium and update the users in Crashpad.

Roll mini_chromium to 2f06f83f to make the new base header available.

Bug: chromium:1210983
Change-Id: Ie3dc4c189dcdfcac030b95fe285f94abb29a27bf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2917779
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-05-25 21:44:52 +00:00
Robert Sesek
ae20ed4321 Reland "Default to the threadsafe GTest death_test_style."
This is a reland of b579146695ba0c045d26b022e63d199bd23f8349

Original change's description:
> Default to the threadsafe GTest death_test_style.
>
> Using the default style of "fast" can lead to subtle test flakiness.
> And on macOS, most of CoreFoundation is not safe to use after fork()
> without exec(). Several //base implementations on Mac use CF, and so it
> is almost never safe to use the "fast" death_test_style.
>
> Change-Id: Idcee977978561e0a57ace20b53f597c566708692
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/570500
> Commit-Queue: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#854588}

Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2747682
Reviewed-by: Sophie Chang <sophiechang@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862111}
Message-Id: Merged from chromium b374bd6f372ac3ead20ed8b3a53ad1b60bd26b50
Change-Id: I87eae51cb4746183951bf8643f241937b119fa70
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2818148
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-04-09 20:55:31 +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
Justin Cohen
2cb83e491e ios: Cleanup API for chromium integration.
Bug: crashpad: 31
Change-Id: I9149879b2f6886ea17ca828dd60d37eb187ba88e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2665887
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-02-02 14:27:06 +00:00
Shai Barack
ed132d5ec2 [syslog] Expect logsink client includes
Change-Id: Icfbf45df76dc6471df9a088f7205b206f4c8488c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2560888
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2020-11-26 19:14:41 +00:00
Joshua Peraza
71e8ec7987 Initialize logging
Depends on https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/2424890

Although logging to files is not yet supported by mini_chromium, it is
the default behavior for OS_WIN in chromium. This change should
cause crashpad to log via OutputDebugString() on Windows, instead of
debug.log files. Future work (crbug.com/crashpad/26) should arrange for
logs to be uploaded with reports, embedded in associated minidumps or as
file attachments.

Bug: chromium:711159
Change-Id: I0f9004f7de94dd29d555cc7d23c48a63da6b4bba
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2425108
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-10-21 19:45:30 +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
Jan Wilken Dörrie
a98ee20e57 [crashpad] Prepare crashpad for base::string16 switch
This change prepares crashpad for the upcoming switch of base::string16
to std::u16string on all platforms. It does so by replacing Windows-only
instances of base::string16 with std::wstring, and using appropriate
string utility functions.

Bug: chromium:911896
Change-Id: Ibb0b8a4e4dc7fae1d24d18823f8dbb6da31f8239
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2332402
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-09-12 07:36:53 +00:00
Sean McAllister
3965bc7d78 Refactor OS_LINUX usage for coming LaCrOs update.
We're working to decouple ChromeOS and Linux builds of Chrome.

Currently OS_CHROMEOS sets OS_LINUX, so we need to refactor
current OS_LINUX usage to make this explicit.

More information can be found at go/cros_is_linux_os_linux

BUG=chromium:1110266
TEST=manual build

Change-Id: Ie765da1ab6a0bf0286538ae1df3697abaa29aeaa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2391116
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2020-09-03 19:12:04 +00:00
Mark Mentovai
bdf9471324 mac: Switch from <AvailabilityMacros.h> to <Availability.h>
The macOS 11.0 SDK, as of Xcode 12b6 12A8189n, has not updated
<AvailabilityMacros.h> with a MAC_OS_X_VERSION_11_0 or
MAC_OS_X_VERSION_10_16 constant. However, the <Availability.h> interface
has been updated to provide both __MAC_11_0 and __MAC_10_16.
<AvailabilityMacros.h>’s MAC_OS_X_VERSION_MAX_ALLOWED, which is supposed
to identify the SDK version, is broken in the 11.0 SDK in that whenever
the deployment target is set to 10.15 or earlier, the SDK will be
mis-identified through this interface as 10.15. When using the
<Availability.h> equivalent, __MAC_OS_X_VERSION_MAX_ALLOWED, the 11.0
SDK is identified as 10.16 (arguably it should be internally versioned
as 11.0, but at least this interface allows it to be detected
unambiguously.) It’s clear that the <AvailabilityMacros.h> interface
provides no meaningful support for the macOS 11.0 SDK at all, but
<Availability.h> does.

<Availability.h> was introduced in the Mac OS X 10.5 SDK, so there is no
relevant SDK version compatibility problem with this interface.

Key differences between these interfaces for the purposes used by
Crashpad:
 - <AvailabilityMacros.h> → <Availability.h>
 - MAC_OS_X_VERSION_MIN_REQUIRED (DT) → __MAC_OS_X_VERSION_MIN_REQUIRED
 - MAC_OS_X_VERSION_MAX_ALLOWED (SDK) → __MAC_OS_X_VERSION_MAX_ALLOWED
 - MAC_OS_X_VERSION_x_y → __MAC_x_y
 - <Availability.h> __MAC_OS_X_VERSION_* SDK/DT macros are only
   available when targeting macOS, while <AvailabilityMacros.h>
   MAC_OS_X_VERSION_* SDK/DT macros are available on all Apple platforms,
   which may be a source of confusion. (<Availability.h> __MAC_* macros
   do remain available on all Apple platforms.)

This change was made mostly mechanically by:

sed -i '' -Ee 's/<AvailabilityMacros.h>/<Availability.h>/g' \
    $(git grep -E -l '<AvailabilityMacros.h>' |
          grep -v AvailabilityMacros.h)

sed -i '' -Ee 's/(MAC_OS_X_VERSION_(MIN_REQUIRED|MAX_ALLOWED))/__\1/g' \
    $(git grep -E -l 'MAC_OS_X_VERSION_(MIN_REQUIRED|MAX_ALLOWED)' |
          grep -v AvailabilityMacros.h)

sed -i '' -Ee 's/(MAC_OS_X_VERSION_(10_[0-9]+))/__MAC_\2/g' \
    $(git grep -E -l 'MAC_OS_X_VERSION_(10_[0-9]+)' |
          grep -v AvailabilityMacros.h)

Bug: crashpad:347
Change-Id: Ibdcd7a6215a82f7060b7b67d98691f88454085fc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2382421
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-08-31 21:11:29 +00:00
Avi Drissman
4ae896bad0 Migrate to OS_MAC and OS_APPLE in Crashpad
This migrates:

 defined(OS_MACOSX) -> defined(OS_APPLE)
 defined(OS_MACOSX) && !defined(OS_IOS) -> defined(OS_MAC)
 !defined(OS_MACOSX) || defined(OS_IOS) -> !defined(OS_MAC)

Bug: chromium:1105907
Change-Id: I1b4abc19bbbe8df90e9c6e64cd29324b40b8ab71
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2321777
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-07-28 02:35:48 +00:00
Tamir Duberstein
6c96d8fb78 fuchsia: Move crashpad_tests to injected-services
Isolation=good.

Change-Id: Ide383f52548bbfb5bef2703787cb7bab411fb8bf
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2315002
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2020-07-22 23:33:31 +00:00
Suraj Malhotra
e3c94b87f0 [fuchsia] Move //zircon/system/ulib/fdio to //sdk/lib/fdio
Bug: fuchsia:54057
Change-Id: I58e2bbf7f3a1674d5b34d4bc502b85cee0bea347
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2253148
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2020-07-10 18:43:55 +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
Robert Sesek
99ecfd3b52 apple: Convert GN libs lists to frameworks.
GN recently added support for Apple frameworks to link, rather than
overloading the libs lists. This pulls .frameworks out of the libs
lists, so that GN can stop supporting .frameworks in libs in the
future.

Roll mini_chromium ae14a14ab..cd26c5101

$ git log ae14a14ab..cd26c5101 --date=short --no-merges --format='%ad %ae %s'
2020-07-01 rsesek@chromium.org apple: Expand {{framework_dirs}} and {{frameworks}} in the toolchain.

Bug: chromium:1052560
Change-Id: Id70bceb57174a52c6f4a7f72378a3ee0ae89f64d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2278022
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
2020-07-01 19:57:26 +00:00
Justin Cohen
b300f76af9 Roll crashpad/third_party/edo/edo/ 243fc89ae..97121c640 (22 commits)
243fc89ae9..97121c6401

$ git log 243fc89ae..97121c640 --date=short --no-merges --format='%ad %ae %s'
2020-06-20 mobile-devx-github-bot Wrap EDOClientService::errorHandler c functions in extern "C"
2020-06-10 albertbow Add warning message to `isKindOfClass:`.
2020-05-02 sskhandp Add -Wunguarded-availability and fix availability warning
2020-04-29 mobile-devx-github-bot Fix up EDO to work with OCMock 3.6
2020-04-21 haowoo Use lightweight generics to retrieve root objects.
2020-04-18 albertbow Internal change
2020-04-16 mobile-devx-github-bot Internal change
2020-04-16 sskhandp Internal change
2020-04-09 mobile-devx-github-bot Fix up .andDo blocks to not call retainArguments that can accidentally cause retain loops in mocks.
2020-02-19 sskhandp Store queue in variable to avoid repetitive calls.
2020-02-13 mobile-devx-github-bot Make sure strongSelf and strongSelf.handlerSyncQueue is not nil.
2020-02-11 albertbow Minor fix on comments.
2020-02-03 tirodkar Fix project name
2020-01-10 albertbow Rollforward EDORemoteException for user-thrown exceptions in remote invocation.
2020-01-07 albertbow Roll forward the fallback of EDORemoteException to be the subclass of NSException.
2020-01-02 mobile-devx-github-bot Internal change
2020-01-02 albertbow Fallback EDORemoteException to be the subclass of NSException.
2019-12-18 albertbow Rollback EDORemoteException.
2019-12-17 albertbow Allow one-way blacklisting types in remote invocation.
2019-12-17 albertbow Use EDORemoteException for user-thrown exceptions in remote invocation.
2019-12-16 albertbow Expose EDORemoteException.
2019-12-12 albertbow Create EDOInvocationException class.

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

Change-Id: Id0bb660e2668c472a8ba1133822221ae100c2541
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2256583
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
2020-06-22 15:22:23 +00:00
Hans Wennborg
161bfed35a Remove/replace unnecessary includes of logging.h
If the file just needs the CHECK/CHECK_OP/NOTREACHED
macros, use the appropriate header for that instead.
Or if logging.h is not needed at all, remove it.

This is both a nice cleanup (logging.h is a big header,
and including it unnecessarily has compile-time costs),
and part of the final step towards making logging.h no
longer include check.h and the others.

Bug: chromium:1031540
Change-Id: Ia46806bd95fe498bcf3cf6d2c13ffa4081678043
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2255361
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
2020-06-22 11:59:03 +00:00
Hans Wennborg
032f1aecc2 Include-what-you-use related to logging.h
Add direct includes for things provided transitively by logging.h
(or by other headers including logging.h).

This is in preparation for cleaning up unnecessary includes of
logging.h in header files (so if something depends on logging.h,
it needs include it explicitly), and for when Chromium's logging.h
no longer includes check.h, check_op.h, and notreached.h.

DEPS is also updated to roll mini_chromium to ae14a14ab4 which
includes these new header files.

Bug: chromium:1031540
Change-Id: I36f646d0a93854989dc602d0dc7139dd7a7b8621
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2250251
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-06-18 13:51:20 +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
Mark Mentovai
29b1688c11 Replace remaining uses of NULL with nullptr
I did a mass conversion in 5d74f120fc57 (October 2014) but these few
must have shown up after.

This excludes code in third_party.

Change-Id: I61cb0273804c0424904a516ed5ab735548b6b9cb
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2166725
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-04-27 13:58:49 +00:00
Justin Cohen
17a515d33d [ios] Bring up first draft Mach exception server.
Add Mach exception server and fill out exceptions 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 exception_snapshot will end up in a
   different file completely, but until we pick a
   serialization/deserialization method, keep it as-is.

Bug: crashpad:31
Change-Id: I44203aa44036a341d6b4517fde7ab0cb9d7e94d7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2160122
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-25 23:38:48 +00:00
Mark Mentovai
ba24acb86c ios: Split bootstrap out from mach_extensions
mach_extensions is sensible on iOS, but bootstrap is not available
outside of macOS. To allow mach_extensions to be used cleanly on iOS,
the bootstrap code is moved into its own macOS-specific file.

Bug: crashpad:31
Change-Id: I7bf9d5194253b563954a1e55fbf67a16f686e8ff
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2154529
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-04-17 20:54:47 +00:00
Mark Mentovai
122a400d7b ios: Enable (and test!) more of util and test
This builds some code in the util and test libraries on iOS that was
previously excluded. It also enables tests for this code, and other
tests that it was possible to enable either previously or as a result of
this change.

Previously, crashpad_util_test ran 178 tests from 46 test suites, and
crashpad_test_test ran 2 tests from 2 test suites. Now,
crashpad_util_test runs 284 tests from 62 test suites, and
crashpad_test_test runs 6 tests from 4 test suites.

The related .gn files also suffered through a slight cleanup.

Bug: crashpad:31
Change-Id: I84cdda5631f0ea4888ada902a8462776ac46fd2a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2154526
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2020-04-17 20:54:17 +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
Mark Mentovai
dc9176b063 iOS: “namespace” Objective-C test classes by prefixing with CPTest
Re:
https://chromium-review.googlesource.com/c/2028183/4/test/ios/crash_type_xctest.mm#13

We previously discussed using the CP prefix for Objective-C class and
protocol names, and CPTest for those restricted to tests. This is
intended to parallel our C++ code’s use of the crashpad and
crashpad::test namespaces, but with name prefixing because Objective-C
doesn’t support any other form of namespacing.

These class names are changed:

ApplicationDelegate→CPTestApplicationDelegate
CrashViewController→CPTestCrashViewController
CrashpadUnitTestDelegate→CPTestUnitTestApplicationDelegate

Filenames and #include guards are also adjusted to match.

This also has include-what-you-use fixes and more modern pointer
handling in CPTestSharedObject, which was already named correctly.

Bug: crashpad:31
Change-Id: I3645ee830a30eccb594d679e0d52ba1a2dd1225d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2144453
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
2020-04-15 15:19:35 +00:00
Justin Cohen
de43cd3723 Fix Chromium Roll.
- Fix -Wundeclared-selector in Chromium roll.
- Convert TEST to TEST_F in crashpad_client_ios_test.mm

Also rolls mini_chromim 731e08f06..641fcf9bb (3 commits)
  2020-04-14 mark Mark static const class/struct members as constexpr
  2020-04-09 justincohen Add PlatformTest to mini_chromium.
  2020-04-09 jperaza Replace ScopedClearErrno with ScopedClearLastError

Change-Id: Ib8ac742eb97359be47e1ff01ae6f10518761a302
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2144452
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-14 14:28:34 +00:00
Justin Cohen
b2fd7d5307 [ios] Bring up first half of UncaughtExceptionHandler.
When code raises an Objective-C exception, unwind the stack looking for
any exception handlers. If an exception handler is encountered, test to
see if it is a function known to be a catch-and-rethrow 'sinkhole'
exception handler. Various routines in UIKit and elsewhere do this, and
they obscure the exception stack, since the original throw location is
no longer present on the stack (just the re-throw) when Crashpad
captures the crash report. In the case of sinkholes, trigger an
immediate exception to capture the original stack.

The is an improvement over the alternative,
NSSetUncaughtExceptionHandler, which passes along the stack frames, but
not the stack memory contents and full exception context itself.

The details of what happens after a fatal exception is triggered are
unresolved in this CL.  For now, simply call std::terminate.

This code was inspired by chromium/src/chrome/browser/mac/
exception_processor.mm.

Bug: crashpad:31
Change-Id: Ieebc6476a0507c466c8219c10f790ec0a624e58c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2125254
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-08 20:57:21 +00:00
Joshua Peraza
c4cc4e6ac9 android: initialize signal dispositions
Bionic installs signal handlers which request crash
dumps from Android's debuggerd, but there are errors
in how signals which aren't automatically re-raised
are handled on Marshmallow (API 23).

Before requesting a dump, Bionic acquires a lock to
communicate with debuggerd and expecting imminent
death, never releases it.

While handling the dump request, debuggerd allows
the dying process to continue before
ptrace-detaching it. So, when Bionic manually
re-raises a signal, it is intercepted by debuggerd
and the dying process is allowed to live.

Bionic restores SIG_DFL for the signal it's just
handled, but if a different crash signal is later
recieved, Bionic attempts to reacquire the lock to
communicate with debuggerd and blocks forever.

Disable Bionic's signal handlers for these signals
on Marshmallow.

Bug: chromium:1050178
Change-Id: Ia1fc5a24161a95931684d092ba8fee2f0dfbbdbb
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2134513
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-08 17:21:05 +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
9ed8290547 Bring up skeleton crashpad_client_ios.
First steps at bringing up the crashpad_client on iOS.  Also updates
the XCUITest to trigger various crashes, with some swizzling
necessary to allow crashes.

Change-Id: I87dd36bed1c052b509d14bfa29679ed81e58a377
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2039470
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
2020-02-18 20:03:41 +00:00
Rohit Rao
39116ab723 Adds support for running iOS unittests via XCTest.
Using XCTest allows us to drive tests from the commandline via
xcodebuild, and it also simplifies running tests on physical devices.

Tests put themselves into "XCTest-mode" if the
"XCTestConfigurationFilePath" environment variable is present.  This
variable is only set when XCTests are running.

Change-Id: If55199a7470f0479f107097eef1dfb1a705015e9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2033427
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-31 20:14:04 +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
54bbd7d0d5 Adds support for running GTests on iOS.
iOS needs to run tests from within the context of a UIApplication, and
it needs to periodically spin the runloop to ensure that the watchdog
does not kill the app for being unresponsive.

BUG=crashpad:31

Change-Id: Ia1d881e478d4f83c236b475a21529760c06100c7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1904226
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-07 17:08:53 +00:00
danakj
a126f524fa Use base::BindOnce() instead of base::Bind()
R=rsesek@chromium.org

Bug: chromium:1007836
Change-Id: I1997bec5e4a499d2c200099e6cc94876a4667782
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1967540
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
2019-12-13 18:03:42 +00:00
Benjamin Wright
097395dfca [crashpad] - Replace "system-temp" with "isolated-temp"
Bug: fuchsia:25092
Change-Id: I553245cea7b4db7e414320bfed02e79531cbc4c9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1961139
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-12-11 01:10:20 +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
Mark Mentovai
c009b85449 Use GTEST_SKIP() instead of custom DISABLED_TEST()
Since gtest 00938b2b228f, gtest has built-in first-class support for
skipping tests, which is functionally identical (at least in Crashpad’s
usage) to the home-grown support for run-time dynamically disabled tests
introduced in Crashpad 5e9ed4cb9f69.

Use the new standard pattern, and remove all vestiges of the custom
local one.

This was done previously in 79f4a3970a64, but was reverted in
bba9d0819c12 because Chromium’s test launcher did not support
GTEST_SKIP() at the time. The deficiency is on file as
https://crbug.com/912138.

While that bug was never specifically marked as “fixed” and I haven’t
found what changed in Chromium, I do now see some use of GTEST_SKIP() in
Chromium. I also prototyped this change in Chromium at
https://chromium-review.googlesource.com/c/1854691/ and found that
GTEST_SKIP() does indeed now appear to work.

Change-Id: I13fef8fe8bfd9854a40dfa5910a3282d1a85bc45
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1855380
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-10-11 16:45:34 +00:00
Wesley Aptekar-Cassels
da3384a708 Fuchsia: remove fuchsia.net.SocketProvider from cmx
fuchsia.net.SocketProvider has been replaced by fuchsia.net.NameLookup
and fuchsia.posix.socket.Provider.

Change-Id: I03e16b4bf432b1560a1b9f9415fc79a94854ad27
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1739507
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2019-08-06 20:27:13 +00:00
Tamir Duberstein
c68e99cb2d [all] add fuchsia.{net.NameLookup,posix.socket.Provider}
These services will replace fuchsia.net.SocketProvider.

Bug: chromium:979080
Change-Id: I8399910e43665f73df40e94ede267c5097997ae7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1680062
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2019-06-28 21:40:35 +00:00
Oliver Hunt
de22b8d050 Opt tests into the ambient-replace-as-executable feature
Bug: fuchsia:SEC-307

Just adding this feature as a pre-flight step while we
restrict the ability for arbitrary processes to make
VMOs executable.

Change-Id: I4ccdad44855f300edb4e5cbd0b89d5be230a7b4a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1659947
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2019-06-14 19:43:00 +00:00
Adam Barth
76e761f7a6 [fuchsia] Switch to fdio_pipe_half
fdio_pipe_half2 and fdio_pipe_half are now the same. We can complete the
migration by switching back to the cleaner name.

Change-Id: Ibf2ab290300e37adbb19df60f7b4869e8150ec5b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1643209
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Adam Barth <abarth@chromium.org>
2019-06-04 19:15:46 +00:00
Adam Barth
5ea6551bae [fuchsia] Update to fdio_pipe_half2
fdio_pipe_half is being replaced with fdio_pipe_half2.

Change-Id: I01294f01692b0a90c00815ad02b6c30e41edba07
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1623147
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Adam Barth <abarth@chromium.org>
2019-05-21 20:14:00 +00:00
Scott Graham
02a3bf6e27 fuchsia: Tidy up return ZX_TASK_RETCODE_EXCEPTION_KILL after soft transition
Bug: fuchsia:ZX-3473
Change-Id: Iad57d46e6eaffea96f276ce0e73ea87e812b488c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1599728
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2019-05-07 17:19:58 +00:00
Eric Astor
48675b4bd3 Remove pid_t in platform-independent code.
Change-Id: Ia58e07bf85a09cd7e63784220800431ad1366584
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1565273
Commit-Queue: Eric Astor <epastor@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-04-24 16:02:00 +00:00
Francois Rousseau
0730f0c60c [fuchsia] rename gn group to fuchsia
now that we import fuchsia-sysinfo and fdio, this isn't really just zx anymore

Change-Id: Ic42359ce3d230e214ebdbbefb880ccb021434a0f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1555533
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-05 23:33:12 +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
Scott Graham
dc17650336 fuchsia: Update MultiprocessExec.BuiltinTrapTermination for task kill revamp
Transitional CL until ZX_TASK_RETCODE_EXCEPTION_KILL lands, which will
define various ZX_TASK_RETCODE_xxx values.

Change-Id: Ia3b6a4bd9a05798721b92e0b72b9beeedc0f5f27
Reviewed-on: https://chromium-review.googlesource.com/c/1486891
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-02-25 18:10:27 +00:00
Mark Mentovai
bba9d0819c Revert "Use GTEST_SKIP() instead of custom DISABLED_TEST()"
This reverts commit 79f4a3970a6425ef0475263974bf9a012279ba4f.

Chromium’s test launcher is not prepared to handle GTEST_SKIP().

Bug: chromium:912138
Change-Id: Iaeffaedcd92093ec61b013f2a919dc4670094581
Reviewed-on: https://chromium-review.googlesource.com/c/1464099
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-11 17:12:40 +00:00
Mark Mentovai
ff5a25e11f Remove a few unnecessary semicolons.
Patch by Nico Weber <thakis@chromium.org>, originally
https://crrev.com/c/1463405.

Bug: chromium:926235
Change-Id: I7e0ba822aa8dd104768d7ad6e603539576ae96a9
Reviewed-on: https://chromium-review.googlesource.com/c/1463744
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
2019-02-11 16:21:20 +00:00
Mark Mentovai
79f4a3970a Use GTEST_SKIP() instead of custom DISABLED_TEST()
Since gtest 00938b2b228f3, gtest has built-in first-class support for
skipping tests, which is functionally identical (at least in Crashpad’s
usage) to the home-grown support for run-time dynamically disabled tests
introduced in Crashpad 5e9ed4cb9f69.

Use the new standard pattern, and remove all vestiges of the custom
local one.

Change-Id: Ia332136c356d523885fc5d86bc8f06fefbe6a792
Reviewed-on: https://chromium-review.googlesource.com/c/1427242
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-01-22 21:00:06 +00:00
Mark Mentovai
cc166d71f4 Use base::size where appropriate, and ArraySize elsewhere
This is a follow-up to c8a016b99d97, following the post-landing
discussion at
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1393921/5#message-2058541d8c4505d20a990ab7734cd758e437a5f7

base::size, and std::size that will eventually replace it when C++17 is
assured, does not allow the size of non-static data members to be taken
in constant expression context. The remaining uses of ArraySize are in:

minidump/minidump_exception_writer.cc (×1)
minidump/minidump_system_info_writer.cc (×2, also uses base::size)
snapshot/cpu_context.cc (×4, also uses base::size)
util/misc/arraysize_test.cc (×10, of course)

The first of these occurs when initializing a constexpr variable. All
others are in expressions used with static_assert.

Includes:
Update mini_chromium to 737433ebade4d446643c6c07daae02a67e8deccao

f701716d9546 Add Windows ARM64 build target to mini_chromium
87a95a3d6ac2 Remove the arraysize macro
1f7255ead1f7 Placate MSVC in areas of base::size usage
737433ebade4 Add cast

Bug: chromium:837308
Change-Id: I6a5162654461b1bdd9b7b6864d0d71a734bcde19
Reviewed-on: https://chromium-review.googlesource.com/c/1396108
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-01-04 22:42:57 +00:00
Avi Drissman
c8a016b99d Remove base's arraysize from Crashpad.
BUG=837308
R=mark@chromium.org

Change-Id: Ibecbfc7bc2d61ee54bc1114e4b20978adbc77db2
Reviewed-on: https://chromium-review.googlesource.com/c/1393921
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
2019-01-03 19:44:15 +00:00
Vlad Tsyrklevich
abfad376ab Add missing build/build_config.h includes
Didn't notice these until I hit presubmit in chromium.

Bug: crashpad:263
Change-Id: I7d86c508928c95a65b7972a19fbdf3bd19c9b29b
Reviewed-on: https://chromium-review.googlesource.com/c/1387885
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
2018-12-20 23:03:08 +00:00
Vlad Tsyrklevich
8b2ec2aae4 Make TaskMemory a child class of ProcessMemory
Currently TaskMemory re-implements a number of Read* routines that are
implemented in a platform-independent way in ProcessMemory with access
to a single platform-specific ReadUpTo method. Implement the ReadUpTo
method for TaskMemory and subclass it from ProcessMemory to inherit the
remaining methods.

The ProcessMemoryTests didn't work on macOS because MultiprocessExec
can not access the child process' task port without root privileges or
the task_for_pid entitlement. Create an adaptor class for those tests to
use MachMultiprocess so that the child process sends its task port to
the parent.

Bug: crashpad:263
Change-Id: Id8e1788a74fe957f05703a5eb569ca3bf9870369
Reviewed-on: https://chromium-review.googlesource.com/c/1387265
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-12-20 19:44:31 +00:00
Joshua Peraza
bf10ed0a69 posix: use threadsafe gtest death test for ScopedGuardedPage
Also update gyp to build it.

Change-Id: I859c552b9cfc41f531ffb04fe6d6730dbd0e8fed
Reviewed-on: https://chromium-review.googlesource.com/c/1319269
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-11-06 21:12:54 +00:00
Francois Rousseau
fdfd782c9b switch to EXPECT_DEATH_CRASH
* introduced in https://chromium-review.googlesource.com/c/1278829
* this blocks the rollup in Fuchsia: ../../third_party/crashpad/test/scoped_guarded_page_test.cc:30:3: error: use of undeclared identifier 'EXPECT_DEATH'

Bug: crashpad:262
Change-Id: Ifff85a63aba012533956ce494fc645b554761478
Reviewed-on: https://chromium-review.googlesource.com/c/1318313
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2018-11-06 01:08:16 +00:00
Vlad Tsyrklevich
a9be1b1403 Add ProcessMemoryWin and re-factor tests
Currently, ProcessMemory is only implemented for Linux and Fuchsia.
Implement the interface for Windows as well and re-factor tests to
support it, mostly this consists of using a new ScopedGuardedPage class
instead of ScopedMmap in the ProcessMemory tests.

BUG=crashpad:262

Change-Id: I1b42718972be5ad838d12356d09f764053f09e4f
Reviewed-on: https://chromium-review.googlesource.com/c/1278829
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-11-05 21:33:35 +00:00
Scott Graham
1b4fdd0fd0 fuchsia: Re-enable HTTPS transport, but disable tests
The HTTPS tests are flaky on Fuchsia bots, so TLS transport was disabled.
However, a different CHECK fails in prod when a crash is attempted to be
uploaded via an 'https' url. So for now, re-enable the https transport,
but disable the https tests that were flaky, so they can be debugged
separately.

Additionally, there was a small error in
21edfd3c3a
that wasn't caught because these tests were disabled; fix the path to
test server certs on Fuchsia.

Bug: fuchsia:DX-382

Change-Id: I4ad0649ecb6d0644b1dfcf08bbb097d3a0cd40d0
Reviewed-on: https://chromium-review.googlesource.com/c/1265197
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Francois Rousseau <frousseau@google.com>
2018-10-05 18:16:11 +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
Joshua Peraza
b918119ca2 linux: Read thread IDs via a PtraceConnection
Bug: crashpad:250
Change-Id: I2ff9c2d810f7af25f7438e974e0adfb5abebec16
Reviewed-on: https://chromium-review.googlesource.com/1200962
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-09-12 00:39:03 +00:00
Wez
bc50af15a2 Migrate from ScopedZxHandle to libzx containers.
Bug: chromium:852541
Change-Id: Ie05c70f249e6f843183a02ec61fd09f6a0607598
Reviewed-on: https://chromium-review.googlesource.com/1148923
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
2018-08-01 17:38:19 +00:00
Joshua Peraza
52ff1accbb linux: Fix locating modules with multiple mappings from offset 0
The general strategy used by Crashpad to determine loaded modules is to
read the link_map to get the addresses of the dynamic arrays for all
loaded modules. Those addresses can then be used to query the MemoryMap
to locate the module's mappings, and in particular the base mapping
from which Crashpad can parse the entire loaded ELF file.

ELF modules are typically loaded in several mappings with varying
permissions for different segments. The previous strategy used to find
the base mapping for a module was to search backwards from the mapping
for the dynamic array until a mapping from file offset 0 was found for
the same file. This fails when the file is mapped multiple times from
file offset 0, which can happen if the first page of the file contains
a GNU_RELRO segment.

This new strategy queries the MemoryMap for ALL mappings associated
with the dynamic array's mapping, mapped from offset 0. The consumer
(process_reader_linux.cc) can then determine which mapping is the
correct base by attempting to parse a module at that address and
corroborating the PT_DYNAMIC or program header table address from the
parsed module with the values Crashpad gets from the link_map or
auxiliary vector.

Bug: crashpad:30
Change-Id: Ibfcbba512e8fccc8c65afef734ea5640b71e9f70
Reviewed-on: https://chromium-review.googlesource.com/1139396
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-07-26 15:33:15 +00:00
Joshua Peraza
fb0f7ca8d7 Uninstall handlers for expected crash signals in child processes
Chromium's test launcher installs crash signal handlers which call
exit(1), instead of with the signal value.

Change-Id: I0c1a62100ef59939a6bcfbf0733e746609a1ead8
Reviewed-on: https://chromium-review.googlesource.com/1131819
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2018-07-11 17:10:46 +00:00
Djordje Golubovic
cb41ba7471 Added MIPS support to crashpad.
Modified gyp/gn files to support MIPS targets.

Implemented thread_info, cpu_context, signal context classes for MIPS target.

Addressed MIPS specific signal ordering.

Added "MIPS Technologies, Inc." to AUTHORS file.

Bug: crashpad:232
Change-Id: Ibfc221ba54088e95f984b9dc6be5fd52f86abcc2
Reviewed-on: https://chromium-review.googlesource.com/1064594
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-07-10 15:29:34 +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
Scott Graham
bff3594594 fuchsia: Update includes for new fdio header location
Also includes a gtest roll, which includes a change in gtest to do the
same thing. This also removes the link against launchpad which is no
longer necessary, and will be removed from the SDK soon.

Bug: crashpad:196, chromium:848028, chromium:850757
Change-Id: Ica8632a6157b585d6b44073e05bf7aa43253e305
Reviewed-on: https://chromium-review.googlesource.com/1096353
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-06-12 16:47:21 +00:00
Scott Graham
51ebe79f06 fuchsia: Fix inverted CHECK condition in migration to fdio_spawn
Bug: crashpad:196
Change-Id: I7465669d7d7ea9e0692fc5e4e8df140b4d388cc1
Reviewed-on: https://chromium-review.googlesource.com/1081288
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-31 19:50:18 +00:00
Adam Barth
1299754179 fuchsia: Migrate off launchpad
Rather than using liblaunchpad.so to create processes, we now use
fdio_spawn.

Bug: crashpad:196
Change-Id: I28a7c12c823f0a0d120962edfce2e2197302b9cb
Reviewed-on: https://chromium-review.googlesource.com/1080234
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2018-05-31 04:01:08 +00:00
Scott Graham
5c49c59847 fuchsia: Implement TLS support in HTTPTransportSocket
With use_boringssl_for_http_transport_socket set, this also works on
Linux, however the bots fail during run lacking libcrypto.so.1.1. So,
not enabled on Linux until that's figured out.

(Includes https://github.com/yhirose/cpp-httplib/pull/70, until it lands
and I'll do a full roll of cpp-httplib then.)

Bug: crashpad:30, crashpad:196
Change-Id: I987f6a87f8e47160c15e53fe1ce28611339069ff
Reviewed-on: https://chromium-review.googlesource.com/1075726
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-05-29 23:19:09 +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
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
31703a585f fuchsia: When in Fuchsia tree, disable tests requiring external files
The package deployment/running is in flux at the moment. In order to get
all the other tests on to the main Fuchsia waterfall, disable the ~25
tests that require external files (for launching child processes,
loading modules, or data files) because those operations all fail on
Fuchsia-without-packages right now. Upstream this is PKG-46. Once test
packaging and running has been resolved, this can be reverted.

These tests are still run when building Crashpad standalone on Fuchsia
as the standalone build simply copies all the relevant data files to the
device in /tmp.

Bug: crashpad:196
Change-Id: I1677c394a2b9d709c59363ebeea8aff193d4c21d
Reviewed-on: https://chromium-review.googlesource.com/1045547
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-05-05 00:27:22 +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
Joshua Peraza
10fd672bde linux: Enable brokered memory reading
This change:
1. Updates the broker's memory reading protocol to enable short reads.
2. Updates Ptracer to allow short reads.
3. Updates the broker to allow reading from a memory file.
4. Updates the broker's default file root to be "/proc/[pid]/".
5. Adds PtraceConnection::Memory() to produce a suitable memory reader
for a connection type.

Bug: crashpad:30
Change-Id: I8c004016065d981acd1fa74ad1b8e51ce07c7c85
Reviewed-on: https://chromium-review.googlesource.com/991455
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2018-04-05 22:21:46 +00:00
Fabrice de Gans-Riberi
74a56c256b Prepare for removal of is_posix from the Fuchsia build
This also rolls crashpad/third_party/mini_chromium/mini_chromium/ d42eb4101..6e0fdb2e4 (2 commits)
d42eb41012..6e0fdb2e49

$ git log d42eb4101..6e0fdb2e4 --date=short --no-merges --format='%ad %ae %s'
2018-04-04 scottmg@chromium.org Repair Linux-with-sysroot build after clang update
2018-04-04 fdegans Prepare for |is_posix| switch in the Fuchsia build

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

Bug: chromium:812974
Change-Id: I3d8efc3124c97981eda63f104a7adfb670babab7
Reviewed-on: https://chromium-review.googlesource.com/988231
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-04-04 22:18:25 +00:00
Joshua Peraza
d108fd04a5 linux: Add PtraceConnection::ReadFileContents
Some files, such as /proc/[pid]/maps, may not be accessible to the
handler. This enables the handler access to the contents of those files
via the broker.

This change reads maps and auxv using ReadFileContents.

Bug: crashpad:30
Change-Id: Ia19b498bae473c616ea794ab51c3f22afd5795be
Reviewed-on: https://chromium-review.googlesource.com/989406
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-04-03 22:08:29 +00:00
Joshua Peraza
5754f608cb android: unset source filters to use linux files
Also disable testing reading AT_ENTRY on Android.

Bug: crashpad:30
Change-Id: I10353bbbb3ff28721a2c05d69463df5eac4df281
Reviewed-on: https://chromium-review.googlesource.com/980811
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-03-27 02:19:39 +00:00
Joshua Peraza
9c89cd99f3 gn: add templates for executables and loadable_modules
When building in chromium, executables and loadable_modules should
depend on:
//build/config:exe_and_shlib_deps
which, among other things, may be needed to introduce a
dependency on a custom libc++.

Bug: crashpad:30
Change-Id: Ic46a3cf5b46bdac09cca22950f9236e0776ba44a
Reviewed-on: https://chromium-review.googlesource.com/974713
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-03-23 16:50:58 +00:00
Joshua Peraza
c27a1aaea0 win: Fix -Wmicrosoft-cast warning
Standard C++ doesn't allow implicit conversion between function
pointers and void*. MSVC does allow that, so clang-cl also allows it
but emits a -Wmicrosoft-cast warning. We want to enable this warning to
make the compiler behave more similar on different platforms, so add an
explicit cast to void*. (GetProcAddress() returns FARPROC, a function
pointer type.)

Upstreamed from:
https://chromium-review.googlesource.com/c/chromium/src/+/953743

Change-Id: I3ed4e23395e1e01b31b7cf945ddb6f93e4e69d45
Reviewed-on: https://chromium-review.googlesource.com/959545
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-03-12 21:24:34 +00:00
Scott Graham
2b05eb522f Rename ProcessReader to platform-suffixed versions
Mac's ProcessReader becomes ProcessReaderMac.
Linux/Android's ProcessReader becomes ProcessReaderLinux.
Fuchsia's ProcessReader becomes ProcessReaderFuchsia.

No intended change in behavior.

Bug: crashpad:196, crashpad:30
Change-Id: I7ec8d72f79533bd78189173261ade2ad99010bad
Reviewed-on: https://chromium-review.googlesource.com/930321
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-02-22 21:33:39 +00:00
Joshua Peraza
c69ba3d527 non-win: Add Multiprocess::SetExpectedChildTerminationBuiltinTrap()
Bug: crashpad:30
Change-Id: Ide7ad3d0f8b9938f57d183ff3fc73868ce28c02c
Reviewed-on: https://chromium-review.googlesource.com/932363
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-02-22 20:56:49 +00:00
Joshua Peraza
0520fdff1e linux: Move ScopedPrSetPtracer to util/
CrashpadClient will need ScopedPrSetPtracer when launching a handler
process in response to a crash.

Bug: crashpad:30
Change-Id: I35bc784b948349ca771f9cd65ef1089e626976bb
Reviewed-on: https://chromium-review.googlesource.com/927352
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2018-02-20 21:26:42 +00:00
Scott Graham
ec33c25797 fuchsia: Don't include sys/resource.h, recently removed from SDK
Bug: crashpad:196
Change-Id: Id4a16a1d44d99b658c78900a15db231ba14b0714
Reviewed-on: https://chromium-review.googlesource.com/924747
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-02-17 01:23:46 +00:00
Scott Graham
f9d160ffc6 Revert "Reset CrashpadInfo after CrashpadInfoReader tests"
This reverts commit 4717300fa4cefadeabef64346ba65aa8759d43b8.

Reason for revert: When used in with the size-testing fake CrashpadInfo's, this can overwrite past the end of them.

Original change's description:
> Reset CrashpadInfo after CrashpadInfoReader tests
> 
> Not resetting these was causing CrashpadInfoClientOptions tests to fail
> on Fuchsia, because dlclose() [legally] doesn't do anything, so
> modifying the current binaries CrashpadInfo caused the expected values
> from child .sos to be ignored. That could be worked around in that test
> too, but it's probably better to clean up the global state in this test
> anyway.
> 
> Bug: crashpad:196
> Change-Id: Ia8119ac7c554bea81e8373e2547faf192c629122
> Reviewed-on: https://chromium-review.googlesource.com/923178
> Commit-Queue: Scott Graham <scottmg@chromium.org>
> Reviewed-by: Joshua Peraza <jperaza@chromium.org>

TBR=scottmg@chromium.org,jperaza@chromium.org

Change-Id: Ia6d8db1ba24c82bb9346210ac8b66d80f42a6925
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: crashpad:196
Reviewed-on: https://chromium-review.googlesource.com/923541
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-02-16 03:41:10 +00:00
Scott Graham
4717300fa4 Reset CrashpadInfo after CrashpadInfoReader tests
Not resetting these was causing CrashpadInfoClientOptions tests to fail
on Fuchsia, because dlclose() [legally] doesn't do anything, so
modifying the current binaries CrashpadInfo caused the expected values
from child .sos to be ignored. That could be worked around in that test
too, but it's probably better to clean up the global state in this test
anyway.

Bug: crashpad:196
Change-Id: Ia8119ac7c554bea81e8373e2547faf192c629122
Reviewed-on: https://chromium-review.googlesource.com/923178
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-02-16 03:20:59 +00:00
Scott Graham
6667fa2559 fuchsia: Fixes to TestPaths
- Don't specify a directory in .so load, this allows
  CrashpadInfoClientOptions.TwoModules to pass, as it is able to find
  its .so.
- Set expected exe name to "app" on Fuchsia, as that's what all binaries
  are called when packaged. This fixes Paths.Executable.

Bug: crashpad:196
Change-Id: I6b0a663734e93b76412a5bdba045e73dcfe7e4cf
Reviewed-on: https://chromium-review.googlesource.com/922871
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2018-02-15 21:38:41 +00:00
Scott Graham
14dbd3531d gn win: Get main test binaries building
- default to subsystem:console
- don't build posix/timezone.*
- add some missing libs

This gets all the main binaries building and running. Most configs pass,
but there's some offsets that seem different in some builds; need to
investigate more. Additionally, the binaries used by end_to_end_test.py
aren't yet built, so that script fails.

Includes mini_chromium roll to 46eeaf9:
46eea49 gn win: Add debug info and pdb to cc/cxx
902a29f gn win: Various fixes towards making GN build work

Bug: crashpad:79
Change-Id: Ie56a469b84bed7b0330172cec9f1a8aeb95f702e
Reviewed-on: https://chromium-review.googlesource.com/902403
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-02-06 19:12:18 +00:00
Scott Graham
11589d9b32 Rework ElfImageReader.MainExecutableChild to not rely on fork()
Switches from test::Multiprocess to test::MultiprocessExec for
ElfImageReader.MainExecutableChild.

Uses the new child process launching, and passes the expected symbol
address from the child to the parent, rather than assuming the value
will be the same in both processes.

And, enables the test on Fuchsia since it now works.

Bug: crashpad:196, crashpad:215
Change-Id: I3b43407b6584275d61bedc9c13d1625b950fc23b
Reviewed-on: https://chromium-review.googlesource.com/884993
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-01-25 23:00:49 +00:00
Scott Graham
48abd4a60f Add CRASHPAD_CHILD_TEST_MAIN() helper for multiprocess tests
Extends MultiprocessExec to support running functions registered via
CRASHPAD_CHILD_TEST_MAIN() as the main of a new child process.

Additionally, implements Fuchsia exit code checking, and adds a
CRASHPAD_CHILD_TEST_MAIN()-based test for that.

Bug: crashpad:196, crashpad:215
Change-Id: I49ce3f4d95a3b9823813e6df5a602cee2583bcf8
Reviewed-on: https://chromium-review.googlesource.com/879563
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2018-01-25 22:59:20 +00:00