1569 Commits

Author SHA1 Message Date
Peter Wen
1c78fe23bd Update doc/developing.md with linux details
This information is very helpful to someone new to Crashpad to be able
to get up and running quickly (i.e. what I would have needed).

Bug: crashpad:291
Change-Id: Ibc84a009dbd7c93dd098e658cbe895957c6dca16
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1567847
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
2019-04-15 19:21:29 +00:00
Eric Astor
e50676dcf2 Switch all string-number conversion to use fundamental types, and add long to the list.
Change-Id: I9244df09415f9d46262e2b8d04b64d7c4f786436
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1565287
Commit-Queue: Eric Astor <epastor@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-04-12 18:26:02 +00:00
Egor Pasko
ad49fcfad6 directory_reader_posix: more verbosity in PLOG
Bug: chromium:949321
Change-Id: I0c73d730ede912a7be0b22ea3ab384a8fda2e528
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1564512
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
2019-04-11 17:17:37 +00:00
Francois Rousseau
5081a90207 [fuchsia] delete old way of passing attachments
* Fuchsia has switched to passing VMOs directly

Bug: fuchsia:DX-1270
Change-Id: I8114a87d895602e80757b87cbeb884b62cfae57f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1562180
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-11 16:08:47 +00:00
Francois Rousseau
77b2b2f1d0 [fuchsia] change attachments from filepaths to VMOs
* we start with VMOs in Fuchsia so this avoids a temporary file before writing the files in the database
* in order to do a soft transition, we add the new type and leave the old one until the caller in Fuchsia has been updated.

Bug: fuchsia:DX-1270

Change-Id: I3c77c775a186801dbcc7379e84ad5795f41780e7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1554011
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-04-10 19:29:17 +00:00
Francois Rousseau
83f6f43d81 [fuchsia] allow generation of C++ bindings for FIDL dependencies
Bug: fuchsia/DX-1270
Change-Id: I99edcfcc96baa00affd129f9249fe6e3c565812b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1560311
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-09 21:03:52 +00:00
Francois Rousseau
0c618f8317 [fuchsia] define zx and fidl_base in their own source_set
ideally these source_set would be create programmatically from the corresponding meta.json

Change-Id: I4374aef5614c75603132dcdf8d32a687fb9cbadc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1560077
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-04-09 20:24:52 +00:00
Francois Rousseau
7411c8354b [fuchsia] use source_set for C FIDL library
this makes it easier to depend on what we want (the C bindings) rather than having to maintain two lists in sync (sources and deps)

Change-Id: Ib3c7715cf8e54658ab44e4de04d04acedf13d09c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1558821
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-09 17:24:12 +00:00
Francois Rousseau
5a94b55000 [lss] add third_party/lss/lss to .gitignore
ug: crashpad:265
Change-Id: I81d5c2dd734b8daeacaee37f3f2314bb9e473f53
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1559309
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-09 17:02:32 +00:00
Joshua Peraza
cc0c2f90df Add lss to third_party and use sys_getpid()
More syscalls to come.

Bug: crashpad:265
Change-Id: Ib139e638b0356426f922650249632132fd613f6f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1540403
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-04-09 00:53:01 +00:00
Joshua Peraza
ae431a1ae5 linux: Disable DumpWithoutCrash() if Crashpad isn't initialized
When sampling has disabled crash reporting for WebView, no signal
handler is initialized, causing later calls to DumpWithoutCrash()
to crash.

Bug: 949295
Change-Id: Ib93986f81bc83404ac9f4d8f40fb34e54f1b3bec
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1558817
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2019-04-09 00:27:21 +00:00
Francois Rousseau
71d2291f4e [windows] stop PLOGing report path if stat fails
apparently we're attempting to log to a C++ out-stream during process exit, and that is causing the run-time to try to do a character-set conversion, requiring it to look up some run-time locale state which has presumably already been torn-down

Bug: chromium:948588
Change-Id: I9431dafd0aaaa8827faf3b24985873733b431e22
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1558812
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-04-08 23:11:41 +00:00
Francois Rousseau
c8dc08b719 [fuchsia] clean up third_party/fuchsia/BUILD.gn
Change-Id: I5c5f03ea5882592008d11e2819962e8781954ca2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1555833
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-04-08 16:13:29 +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
Francois Rousseau
b0373799ba [fuchsia] fix module names for executables and loadable modules
On Fuchsia, executables and loadable modules don't have a name at build
time so we use "<_>" as module name to index their symbols on the crash
server. We need to use the same dummy value at run time.

Bug: fuchsia/DX-1193
Tested: `fx run-test crashpad_test`

Change-Id: Ie926a6d26cb52679ccfac767db098c9fbfd21dd8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1548230
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-04-02 22:42:17 +00:00
Peter Collingbourne
439f50fb11 Revert "Work around libcrashpad_handler_trampoline.so ASan trunk clang problem"
This reverts commit 5a21d038c9c9f3baa4e360b0a9bf5d6417868edf.

Reason for revert: Toolchain bug has now been fixed.

Original change's description:
> Work around libcrashpad_handler_trampoline.so ASan trunk clang problem
> 
> This first landed downstream in Chromium at 7a8076717f11.
> 
> Bug: chromium:936418
> Change-Id: I3eea804039829163948683f014bc10dee6477fb7
> Reviewed-on: https://chromium-review.googlesource.com/c/1495416
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Commit-Queue: Mark Mentovai <mark@chromium.org>

TBR=thakis@chromium.org,mark@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:936418
Change-Id: I17d40865b64805ffdc1fb5e71e67fee1856c03b7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1546813
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
2019-03-30 01:50:42 +00:00
Peter Collingbourne
94dc7eb437 Collect abort messages on Android.
As of Android Q, the android_set_abort_message() function copies the
abort message into a mapping with a specific name that starts with a magic
number. This makes it possible for Crashpad to collect the abort message
by looking for the mapping with this name in procmaps and checking for the
magic number. The abort message is stored in a process annotation named
"abort_message".

Test: No regressions in build/run_tests.py on devices running P and Q
Test: Patched into Chromium; manually verified that HWASAN crash report appears in minidump
Bug: crashpad:287
Change-Id: I23c4d9e11015c84341de2d2e47e38a1eec508a36
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1544875
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-03-29 22:46:12 +00:00
Joshua Peraza
7d5d5ff25f Avoid triggering buffer overflow detectors
Writing directly into buf.tmp causes the nul-terminator to overflow
into buf.crlf, which upsets some overflow detectors.

Bug: crashpad:289
Change-Id: I241f1ae239ed8360ac5dfd245cb70e919ae73cd1
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1545014
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2019-03-29 15:34:02 +00:00
Joshua Peraza
d396fdf9d4 Delete crashpad_dependencies.gni
The file doesn't appear to be referenced anywhere and its contents are
generally duplicated in test.gni and crashpad_buildconfig.gni.

Change-Id: Id65a3020330a968ce3bcfb23c30e4cd0c5f808f8
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1541847
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-03-28 20:05:11 +00:00
Peter Collingbourne
75efc19dd0 Make most of the tests pass on Android.
- Link with -static-libstdc++ to avoid a runtime dependency on the NDK libc++.
- Relax the regular expression matching the path to ar. If the path is
  sufficiently long then gyp will wrap the line, causing the match to fail.
- The crashpad_handler binary needs to be pushed to the device,
  otherwise a number of tests fail or hang.

Now the only tests that fail on my device are:

[  FAILED  ] DebugRendezvous.Self
[  FAILED  ] DebugRendezvous.Child
[  FAILED  ] ProcessReaderLinux.SelfModules
[  FAILED  ] ProcessReaderLinux.ChildModules

Change-Id: I951a22cea5bce453d858da49a49b6a8defc1461c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1536652
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
2019-03-27 00:13:56 +00:00
Francois Rousseau
3cc7ceaac5 [fuchsia] do not try to suspend crashed thread
* a thread blocked in an exception is technically not suspended on Fuchsia
* this will take care of the spurious error message "thread failed to suspend: ZX_ERR_TIMED_OUT (-21)" introduced in https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1536268

Bug: fuchsia/ZX-3772
Tested: `fx run-test crashpad_test` on Fuchsia; verified with `fx shell crasher` no error message
Change-Id: I5306732ef7c5a4f2c0fe84bc072506d57a43931e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1538558
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-03-25 20:45:09 +00:00
Scott Graham
17d024e7df fuchsia: Suspend process before manipulating it
This was broken by yours truly in
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1057833/,
probably because I couldn't decide whether to do it in HandleException()
or HandleExceptionHandles() (or possibly I'm just a dope).

In any case, suspending in HandleExceptionHandles() is fine, the thread
for the exception will be suspended on entry, so suspending other
threads after the initial excepting thread's koid to handle lookup is
OK.

This avoids a bunch of logspam like:

  zx_thread_read_state(ZX_THREAD_STATE_GENERAL_REGS): ZX_ERR_BAD_STATE (-20)

and presumably will fix non-excepting-thread stacks being completely
broken?

Bug: fuchsia:DX-1190

Test: run `crasher write0_mt` on device
Change-Id: I029537aba2955d4f055471bf36a4e9a0f8ef2d5e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1536268
Reviewed-by: Francois Rousseau <frousseau@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
2019-03-22 21:45:00 +00:00
Mark Mentovai
8b1be541f5 mac: Support 32-bit x86 builds
Updates mini_chromium to 471390dc9c5a.

471390dc9c5a mac: Support 32-bit x86 builds

% gn gen out/debug_32 --args='target_cpu="x86"'
% ninja -C out/debug_32

The 10.14 SDK does not contain support to link for 32-bit x86, so with
Xcode 10, it may be necessary to set the GN argument mac_sdk=10.13 (or
lower) or target_sysroot to an equivalent path. It may also be necessary
to coax Xcode into accepting this SDK.

Change-Id: I251c870ae06e2a7d9e6d8936240f204da2f4a517
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1529224
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-03-19 20:52:31 +00:00
Francois Rousseau
8e222b90b7 fix report size computation in prune condition
today the attachments are not taken into account, but should on Linux and Fuchsia

Bug: fuchsia:DX-1104

Tested:`fx run-test crashpad_test` for Fuchsia.

Change-Id: I022331bdb09c637f40ff2ba2d711e301e211e86a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1518323
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Francois Rousseau <frousseau@google.com>
2019-03-14 18:00:18 +00:00
Joshua Peraza
1bb8ca4059 Silence some warnings
These warnings create a lot of noise in the Android logcat

Change-Id: I747a7f4cd61f4dcbb16c6dfcb3a1b4caeeaed06a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1518320
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2019-03-12 22:15:25 +00:00
Adam Barth
aa160f6581 [fuchsia] Update header include
Previously, we included lib/fdio/util.h, but that header is being
removed. The declarations we need are in lib/fdio/fdio.h now.

Change-Id: I094b328766f1c67571044f85717b788eded1d142
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1508635
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Adam Barth <abarth@chromium.org>
2019-03-07 18:21:15 +00:00
Mark Mentovai
348022def8 Fuchsia: Proper Fuchsia-on-macOS cross build support
Update mini_chromium to df0c375531b7

df0c375531b7 Fuchsia: Proper Fuchsia-on-macOS cross build support

Change-Id: I40b184ad2d61e989acf5c73b6e251a58466a801d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1505790
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-03-07 03:12:08 +00:00
Mark Mentovai
36f9051caf Enable clang -Wextra-semi in POSIX/Fuchsia clang builds
This completes compatibility with clang -Wextra-semi and enables that
warning when building with clang for POSIX/Fuchsia. The enabling
mini_chromium change depends on the compatibility changes in gtest.

-Wextra-semi is only used when using mini_chromium’s build
configuration. This does not affect in-Chromium builds.

This updates mini_chromium to d3e46f173a22 and gtest to 8b6d3f9c4a77.
Semicolon-related changes in each:

mini_chromium

29c507fb618e Add -Wextra-semi to POSIX/Fuchsia Clang builds
d3e46f173a22 Sync base/numerics with upstream as of 97fa6e4bdf7b

gtest

56ef07a20308 Build gmock cleanly with clang -Wextra-semi
a1dd07786b9a Build gmock cleanly with clang -Wextra-semi and
             -Wextra-semi-stmt

All changes:

mini_chromium

4e8b715e2aeb Partially restore VS2015 support; baseline functionality
             only
29c507fb618e Add -Wextra-semi to POSIX/Fuchsia Clang builds
d3e46f173a22 Sync base/numerics with upstream as of 97fa6e4bdf7b

gtest

4d62b5b9aef0 fix:  Remove Arduino entry points
0c0ca9038245 fix:  Correct *_main.cc paths
adc5045cbf27 chore:  Alphabetize exclude directories
23533009b872 chore:  Add Windows cmake files to .gitignore
0ffa5f9779fc Merge branch 'master' into chore/fix_library_json
fd1c7976aee8 Merge branch 'chore/fix_library_json' of
             https://github.com/ciband/googletest into
             chore/fix_library_json
202dcabf39fd misc:  Revert formatting changes
23e693787399 misc:  Reapply Arduino functions
45c58aa6f360 fix:  Add Arduino setup()/loop() functions back
c868da198834 Enable building as a shared library (dll) on Windows with
             Bazel
7c4164bf404d Fix INSTANTIATE_TEST_CASE_P with zero variadic arguments
91bfc0822855 Enable CI on Windows (appveyor) with Bazel
569fba4d742b Make internal FunctionMocker class final
fdc59ffd050a Add AllOfArray matcher that verifies a value matches all
             member of some array/container/list/set/..., e.g:
bf07131c1d0a Merge pull request #2041 from ciband:chore/fix_library_json
46b81732b634 Fixed "make dist"
5ec7f0c4a113 Merge pull request #2079 from acozzette:fix-dist
718bb65acff1 Avoid dynamic/static runtime linking (LNK4098) by properly
             replacing MD(d)->MT(d) in both C and CXX flags, resolves
             2074
01148677a937 Merge pull request #2086 from hugolm84:fix-dynamic/static-
             runtime-link
1f42ae7353b3 Merge pull request #2063 from mathbunnyru:master
9318a18ccf8f Added -Wgnu-zero-variadic-macro-arguments" clang
2775733ee1e9 Update advanced.md casing in example
ce29e55cfcbb Merge pull request #2090 from KellyWalker/patch-1
8e37822b4b21 Merge pull request #2063 from mathbunnyru:master
acde02c635f8 Repeat #2090
e04254989d26 Merge pull request #2091 from google/gennadiycivil-patch-1
1c23efb42450 Fix README.md broken link
4f4c01d8c866 Merge pull request #2092 from Billy4195/Update_README
fe519d64a6e0 fix: Add *_all.cc files to ignore list
b2b24622500d fix: Add Arduino to embedded platform list
53798de93935 chore: Add PlatformIO supported platforms list
0ea2d8f8fa16 Fix stack overflow in AnyOfArray tests
67265e070677 cmake: move global project definition to beginning
f89253434fd3 cmake: detect Cygwin which needs extensions to build
471f5bc433c0 Merge pull request #2098 from
             ciband:feat/finish_platformio_support
876bdfa565b7 Update example code in gtest.h to prefer override over
             virtual now
52ea4f7beaa6 Mark legacy _TEST_CASE_ macros as deprecated
50059a12b9fd Address -Wgnu-zero-variadic-macro-arguments
9df5475b8267 Test out changes with clang/OSX each PR using Travis CI
5dfcd1bc422d Update .travis.yml
f80d6644d4b4 Update .travis.yml
b3679d856586 Fix an invalid example of JSON report in advanced.md
e28b50609e78 Merge pull request #2103 from kw-udon/fix-json-in-advanced-
             md
9a502a5b14b4 Merge pull request #2100 from ngie-eign/test-clang-osx-
             every-travis-run
47568eade6b9 fix:  Correct *-all.cc file paths
48e6f1f387e6 Stop TestInfo::Run() calling a function through null
             pointer
f4d3cdb65753 Generate a libgtest.la to help libtool managing
             dependencies
60cf03313da2 Set gtest version correctly for older cmake versions
dda0df3b0ac6 Internal change
28a96d1834dd Fix matcher comparisons for std::reference_wrapper
4f79e316acc9 Internal changes
b68ec344bfe4 Merge pull request #2101 from MaEtUgR:fix-cmake-cygwin
b37574c1bfb3 Merge pull request #2107 from
             ciband:feat/finish_platformio_support
c4ccab33aaa0 Internal Change
ed2fe122f8dc Fix -Wunused-private-field issues with clang
1ded83195d93 Compile clang with `-Wall -Wshadow -Werror`
96826743ea0a Import `patch-bsd-defines` from FreeBSD ports [1]
75c3396099bf Merge pull request #2113 from knuto:pr/set_old_gtest_ver
e5e846da7fda Merge pull request #2120 from ngie-eign:clang-compile-with-
             basic-warns-flags
ea43be9d1a78 Merge pull request #2119 from ngie-eign:clang-wunused-
             private-field
f73b2fb39efc Merge pull request #2114 from knuto:pr/libtool_support
54ec41f00018 Merge pull request #2121 from ngie-eign:add-dragonflybsd-
             and-kfreebsd-support
d850e144710e Merge pull request #2112 from knuto:pr/fix_null_pointer
a4af76cf8c13 Add `cxx_strict_flags` for clang to match FreeBSD's WARNS
             flags
2147806d2d5c Fix clang `-Winconsistent-missing-override` warnings
5388473acfb6 Fix clang `-Winconsistent-missing-override` warnings
1c22797cd304 Fix clang `-Wunused-parameter` warnings
fcf59ca7bf63 Ignore `-Wsign-conversion` issues
9dc235b59cfd Avoid array index out of range
6d4d2f06bebc Merge pull request #2141 from dspinellis/index-fix
0e424c7594dd Update gtest-death-test to use new Fuchsia API
873e479817d3 Internal Change
c374893023c9 Merge pull request #2123 from ngie-eign:clang-inconsistent-
             missing-override
c5a792d1b685 Merge pull request #2125 from ngie-eign:clang-unused-
             parameter
1411d27a944d Merge pull request #2061 from samolisov:building-with-
             bazel-as-a-dll-on-windows
7203f37f57e4 Merge pull request #2137 from ngie-eign:clang-ignore-sign-
             conversion
cd09534deccd Don't hardcode the filename in
             `CxxExceptionDeathTest.PrintsMessageForStdException`
b6473fcf90a3 Merge pull request #2126 from ngie-eign:clang-add-more-
             strict-warnings
37ae1fc5e6be Merge pull request #2147 from ngie-eign:gtest-test-death-
             test-dont-hardcode-test-name
d70cd4e35859 Fix grammatical error in primer.md
5154386c5f76 Merge pull request #2152 from rsinnet/patch-1
efecb0bfa687 Replace more pump'd code with variadic templates
fc979623a91e Minor build system fixes
56ef07a20308 Build gmock cleanly with clang -Wextra-semi
db9b85e27522 Let embedders customize GTEST_INTERNAL_DEPRECATED()
a1dd07786b9a Build gmock cleanly with clang -Wextra-semi and
             -Wextra-semi-stmt
3dd2e841c34b Fix emission of -Wzero-as-null-pointer-constant when
             comparing integers
8b6d3f9c4a77 Merge pull request #2158 from CarloWood:master

Bug: chromium:926235
Change-Id: I078620849c2369636d0809f0193a355aa0879cae
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1503686
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
2019-03-06 23:00:18 +00:00
Mark Mentovai
2a47ea4663 Obtain the Fuchsia SDK from the correct (updated) location
Since a mac-amd64 SDK is now published in addition to linux-amd64, use
it on macOS instead of repurposing linux-amd64.

Many thanks to Scott Graham <scottmg@chromium.org> for helping out at
https://chromium-review.googlesource.com/c/1506419.

Bug: crashpad:279
Change-Id: I4f108222ec2e75dea93fe32053ab470ac7ce48b9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1503688
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2019-03-06 22:29:08 +00:00
Mark Mentovai
c8fdad4fe5 Update DEPS for buildtools and GYP
Point buildtools to its new location and update it to 3e50219fc450.

https://chromium.googlesource.com/chromium/buildtools:

437a616be5b2 Roll doclava from Android version 6.0.0 to 8.1.0
e514b423cd41 Remove libunwind arm dependency from libc++abi
d8b13809dced Build libc++abi with LIBCXXABI_SILENT_TERMINATE set
dd61138d2390 Add libunwind include path to libunwind config
a2cbf26d9ed3 Roll lib{cxx,cxxabi,unwind}
95d2a25d1de9 Roll gn 5478ca083b..c67646fb60 (r528993:r531988)
cac097d5c2b8 Roll lib{cxx,cxxabi,unwind}
f115f4786771 Revert "Roll gn 5478ca083b..c67646fb60 (r528993:r531988)"
2637e7e91152 Roll gn 5478ca083b..a0a05a85c5 (r528993:r533513)
053f96910491 Add Windows support to libc++ target
a09e064635a4 Merge "Add Windows support to libc++ target."
2888931260f2 checkdeps: Add "noparent" support, similar to OWNERS files
3748a2a90871 Roll gn a0a05a85c5..ee966518c2 (r533513:r544233)
10d701fce52d Prepare for |is_posix| switch in the Fuchsia build
ce837ab781da Roll lib{c++,c++abi,unwind}
c81e25593ef4 [CFI] Update libc++abi to include cfi-icall fix
4c8aa3ad4fd3 Roll gn ee966518c2..b709e226c5 (r544233:r549249)
e8aa02ea839e Merge "Roll gn ee966518c2..b709e226c5 (r544233:r549249)"
8febfea9bc7e Move SVN revision comments to be variables in a gni file
ab7b6a7b350d Roll gn b709e226c5..76b9b6c759 (r549249:r552354)
b7d53a93026d Make libc++abi C++17 ready
50bedd71e73c Roll gn 76b9b6c759..8b9e025d4d (r552354:r554932)
0b71401b977f Roll gn 8b9e025d4d..0fbf0789d9 (r554932:r555198)
292896eef97e Roll libc++abi 52c7a376..05a73941
ae5162d61ffc Remove unnecessary android_crazy_linker dependency from
             libc++abi
c2fb17cecaf9 Correctly configure __cxa_demangle visibility
a9e946f166b7 Exclude libc++abi target when use_custom_libcxx=false
e7546473ac90 Move extern-C before __attribute__ declarations
e0b3d0a72133 Roll gn 0fbf0789d9..ccbeab673a (r555198:r558753)
8ca403ab93e0 Merge "Move extern-C before __attribute__ declarations"
4cbff1e40ea6 Roll lib{cxx,unwind} to ToT
94288c26d2ff Revert "Roll gn 0fbf0789d9..ccbeab673a (r555198:r558753)"
893eb86b02b2 Set no_default_deps in shared libc++ builds
6f4dae280c6a Roll gn 0fbf0789d9..84176d72a4 (r555198:r564007)
5941c1b3df96 Roll gn 84176d72a4..a3bcd204a1 (r564007:r567268)
9c9fd97928dd Roll gn a3bcd204a1..7f29218b23 (r567268:r570036)
f45682622e92 Remove GN from buildtools
506ae1c73670 Add gn-has-moved binary in old gn location
49b054d87c53 Remove libcpp_is_static
aec56e26079f Roll to gn from gn.googlesource.com
2568b85b1fa9 Merge "Remove libcpp_is_static"
66c7d9dc3c26 Re-add .gitignore for GN
a57c8cf55208 Merge "Re-add .gitignore for GN"
7876a3a2adc9 Revert "Remove libcpp_is_static"
0dd5c6f980d2 Merge "Revert "Remove libcpp_is_static""
4ae75c1f8188 Add components/tracing in visibility for libunwind
637716e67c05 Remove libcpp_is_static
5a265b45c14c Merge "Remove libcpp_is_static"
691bfec9d73b Only set is_component_build if !is_component_build
9a90d9aaadeb Use new export_libcxxabi_from_executables variable
2dff9c9c74e9 Roll GN from "UNKNOWN" to 1413 (4cf8d15..e134e49)
13a00f110ef9 Roll lib{cxx,cxxabi,unwind}
fdce2ad26b26 Roll libcxx{abi}
24ebce457874 Update clang-format binaries and scripts for all platforms
da9b2941cbf6 Revert "Roll libcxx{abi}
04161ec8d7c7 Roll gn to version 1496 (0790d304)
7d88270de197 Added statically linked linux binary for clang-format
b07ce09e6870 Roll lib{c++,c++abi,unwind}
5cce74c6ae2e Roll libc++
93e021048e8a Add thomasanderson and thakis to libc++{abi} OWNERS
0e1cbc4eab68 Stop removing hide_all_but_jni_onload config from libc++
9d61cbb94fd6 Make libc++ a shared library on Android sanitizer builds
40194ab03962 Do TODOs related to Android/libc++
2f02e1f363b1 Don't export operator new/delete on Mac
6fbda1b24c18 Add eu-strip to buildtools/third_party/
d658e92a1fc2 Delete buildtools

https://chromium.googlesource.com/chromium/src/buildtools:

6b05562fca00 [buildtools] add owners
97f503c698ae Update libcxx{abi}
daac513c763a Fixes necessary for enabling libc++ on Windows
3e50219fc450 Fix mac/component/asan builds

Update GYP to 8bee09f4a578.

52d9dcea6525 Add prototype of Travis config
85a2192070ba
ac24c9a9501e osx
6dbd6e1ed2ad
2f9ae921f899 add copyright to .sh
2ea7773b5a97 set +x  on buildbot/travis-checkout.sh
834a0592ddee fiddling with directories
c3b797d883df try exporting PATH and only build ninja for now
541da5393710 try other order for sync:
39ad9f30379c see if ninja is getting pulled
007db9efe490 see if ninja is getting pulled
0afd3fc18f12 try a wrapper script
7f2941039abf readd osx
d22dd9717aeb and try clang
deb62526ffbb Disable some tests that fail on bots to try to get a green
             build
4d467626b0b9 Make Travis build only the master branch
81286d388abf infra: remove cq.cfg, which is no longer used
197c82b78bc8 Patch GYP so that building with Xcode 10 works
f825c98e4bff Fix issue with missing resources in Xcode ui tests targets
6dbf304b77cb Add a copyright header to TestCmd.py
9df93ee4302e Make Visual Studio 2017 Community Edition work w/ GYP
f989ef9f1c41 Use ast module instead of compiler module for parsing files
f2dca32f7856 Update simple_copy.py for Python3 types
ab4aca868d68 Mostly mechanical changes for Python3 support
732bde62a5eb Fix one dangling utf8 decode call needed for python 3
e22714e51525 Fixes needed for Python3 on Win32
703706c4995b src,win: add VS2019 version
bd11dd1c51ef More miscellaneous fixes for Python3 compatibility
8bee09f4a578 Changes for windows and easy xml to get gyp to run under
             python 3

Change-Id: I7a0dc6638d275728aec2bd30c07b11492573d1e3
Reviewed-on: https://chromium-review.googlesource.com/c/1496661
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-03-04 01:43:22 +00:00
Mark Mentovai
5a21d038c9 Work around libcrashpad_handler_trampoline.so ASan trunk clang problem
This first landed downstream in Chromium at 7a8076717f11.

Bug: chromium:936418
Change-Id: I3eea804039829163948683f014bc10dee6477fb7
Reviewed-on: https://chromium-review.googlesource.com/c/1495416
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-28 22:19:42 +00:00
Mark Mentovai
708367f5ba POSIX: ScopedMmap length refinement
9d26012e9c73 relaxed the requirement on ScopedMmap such that the length
of the region supervised no longer needed to be provided as a round
number of pages. This was accomplished by internally rounding up the
provided length to a page length. Unfortunately, this made

ScopedMmap::len() return something other than the passed-in length,
which is undesirable. This change makes ScopedMmap store the passed-in
length internally, making it available unmodified via the accessor, and
rounding it up to page length at internal points of use.

Change-Id: I827925af68e38f33bfa3cee535db0f098884fc6b
Reviewed-on: https://chromium-review.googlesource.com/c/1492774
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-02-28 01:51:41 +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
Mark Mentovai
2271f00fe0 Add missing BUILD.gn for third_party/apple_cf
apple_cf is just a header, but we’ve got a BUILD.gn for
third_party/cpp-httplib, which is also just a header.

Change-Id: Ib42c25657b5964678d14682a0a802ebef0e4cb2f
Reviewed-on: https://chromium-review.googlesource.com/c/1489182
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-26 16:39:24 +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 Peraza
99bf283e54 android: Add methods to start handler with /system/bin/linker
Starting with Android Q, Bionic's linker will support loading
executables from an APK, replacing the /system/bin/app_process
workaround.

libhandler_trampoline.so is a small executable, which `dlopen()`s
the handler code from another native library allowing
de-duplicating shared code with that library without having that
library available for a more direct link time dependency.

Bug: 928422
Change-Id: Ib126b8fca6005a34b9e4ef103eb1383dc0c554ea
Reviewed-on: https://chromium-review.googlesource.com/c/1477336
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
2019-02-25 19:22:57 +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
9d26012e9c POSIX: don’t be overly restrictive about mmap() region length
ScopedMmap was asserting that the length of a mapped region must be an
exact number of pages, but this is not required or useful.

Change-Id: I6141712a1980a217565e31ddcd4c23cf6a32503c
Reviewed-on: https://chromium-review.googlesource.com/c/1480440
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-25 17:48:47 +00:00
Nico Weber
b1739cc67f crashpad: Remove semicolons, Windows edition.
Bug: chromium:926235
Change-Id: I392675c2f6ad09fbdabbb19c49805f73fa665c7e
Reviewed-on: https://chromium-review.googlesource.com/c/1483310
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-02-22 17:18:17 +00:00
Mark Mentovai
39e458b331 Remove (a? the last?) extraneous semicolon
Bug: chromium:926235
Change-Id: Ie30810641c1d0dcc735002443f7a18facd9508a8
Reviewed-on: https://chromium-review.googlesource.com/c/1475993
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
2019-02-21 15:58:50 +00:00
Vlad Tsyrklevich
25ba1d6895 Explicitly check mach_vm_read() size out parameter
Explicitly check that mach_vm_read() successfully read the entire
requested region. This is a speculative fix for an infrequent crash that
occurs in the wild where only part of the region read by ReadMapped()
was actually mapped into memory.

Bug: chromium:918626
Change-Id: I4f4b3902d11480dc4a003608cfb1d371ec89425b
Reviewed-on: https://chromium-review.googlesource.com/c/1455170
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2019-02-20 21:45:51 +00:00
Mark Mentovai
03850fb6cf Remove the last two extraneous semicolons
Patch by Nico Weber <thakis@chromium.org>, originally
https://crrev.com/c/1476986.

Bug: chromium:926235
Change-Id: I6fd9aed5c57ffe0fec8f9adcd4cf5211d7b795c3
Reviewed-on: https://chromium-review.googlesource.com/c/1475992
Commit-Queue: Mark Mentovai <mark@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
2019-02-19 15:59:10 +00:00
Petr Hosek
4dbd8c75d5 Fix issues revealed by -ftrivial-auto-var-init=pattern
-ftrivial-auto-var-init=pattern automatically initializes all variables
with a pattern. This revealed two issues:

1. Unitialized read of field from CrashpadInfoClientOptions.
2. The PC distance check in TestCaptureContext (due to additional
instrumentation, the distance is now 76 on x86-64 and 92 on aarch64).

Change-Id: I528e5f21c70d2849c9300776da783fde59411e9e
Reviewed-on: https://chromium-review.googlesource.com/c/1471691
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-14 16:41:57 +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
Maksim Sisov
152aa8d1f9 Add missing limits header to crashpad.
This patch fixes the following error:

../../third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc:246:12: error: 'numeric_limits' is not a member of 'std'
       std::numeric_limits<decltype(context->spsr)>::max()) {
            ^~~~~~~~~~~~~~
../../third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc:246:27: error: expected primary-expression before 'decltype'
       std::numeric_limits<decltype(context->spsr)>::max()) {
                           ^~~~~~~~
../../third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc:246:27: error: expected ')' before 'decltype'

Bug: chromium:819294
Change-Id: I4f31a33fcdae9567c71a4d371d2e6afe68d2ef6a
Reviewed-on: https://chromium-review.googlesource.com/c/1454376
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2019-02-11 10:07:08 +00:00
Vlad Tsyrklevich
caad799c28 Delete chromium-specific macOS rpaths
These flags are no longer tracked here since the macOS crashpad_handler
is built upstream as of https://crrev.com/629713

Bug: chromium:912286
Change-Id: I6735a6a1364086e67d1b7c2d316829c74c20d0d9
Reviewed-on: https://chromium-review.googlesource.com/c/1456777
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
2019-02-07 18:30:28 +00:00
Tom Tan
84ef87ef51 Fix arm64 CONTEXT for crashy_test_program
Bug: chromium:893460
Change-Id: I0bd47521d68aa9477e32104986bd7aeb1d4e2738
Reviewed-on: https://chromium-review.googlesource.com/c/1454820
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
2019-02-05 20:06:48 +00:00
Eric Astor
f66a125cd5 Move POSIX-only include into #ifdef guard, preventing warnings of undefined symbols in some conservative build configurations.
Change-Id: I75ab0a7623c506a826b42406484e8a29f9db9304
Reviewed-on: https://chromium-review.googlesource.com/c/1439198
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Eric Astor <epastor@google.com>
2019-01-28 17:14:06 +00:00
Matthew Dempsky
1fc95dc3cc [fuchsia] Add zx_vmo_replace_as_executable to tests
Fuchsia in the future will create VMOs as non-executable (i.e.,
without ZX_RIGHT_EXECUTE) by default, so this necessary preparation
for that.

Change-Id: I00ada804d1d16db4f50ff3882058e382b1845328
Reviewed-on: https://chromium-review.googlesource.com/c/1419778
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Matthew Dempsky <mdempsky@chromium.org>
2019-01-22 21:07:06 +00:00