758 Commits

Author SHA1 Message Date
Mark Mentovai
0c41b15496 Convert AsciiDoc documentation to Markdown
Most of the world, including the Chromium universe, seems to be
standardizing on Markdown for documentation. Markdown provides the
benefit of automatic rendering on Gitiles (Gerrit), and on GitHub
mirrors as well. Crashpad should fit in with its surroundings.

There are two quirks that I was unable to resolve.

 - Markdown does not allow **emphasis** within a ```code fence```
   region. In blocks showing interactive examples, the AsciiDoc
   documentation used this to highlight what the user was expected to
   type.
 - Markdown does not have a “definition list” (<dl>). This would have
   been nice in man pages for the Options and Exit Status sections.
   In its place, I used unnumbered lists. This is a little ugly, but
   it’s not the end of the world.

The new Markdown-formatted documentation is largely identical to the
AsciiDoc that it replaces. Minor editorial revisions were made.
References to Mac OS X now mention macOS, and tool man pages describing
tools that that access task ports now mention System Integrity
Protection (SIP).

The AppEngine-based https://crashpad.chromium.org/ app in doc/appengine
is still necessary to serve Doxygen-generated documentation. This app is
updated to redirect existing generated-HTML URLs to Gitiles’ automatic
Markdown rendering.

Scripts in doc/support are updated to adapt to this change. All AsciiDoc
support files in doc/support have been removed.

BUG=crashpad:138

Change-Id: I15ad423d5b7aa1b7aa2ed1d2cb72639eec7c81aa
Reviewed-on: https://chromium-review.googlesource.com/408256
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-11-04 21:13:53 +00:00
Scott Graham
b47bf6c250 Fix tests when running on Win10
The Windows 10 loader starts a few extra threads before main(). In a few
of the test cases, the tests were relying on thread ordering (generally,
the test thread being at index #1). Instead, use other signals to find
the correct thread to verify.

R=mark@chromium.org

Change-Id: Icb1f5a8fdf3a0ea6d82ab65960dbcb650965f269
Reviewed-on: https://chromium-review.googlesource.com/407073
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-11-03 18:51:01 +00:00
Scott Graham
c4cdec3d72 Handle non-crashing cases for server failure to start
Follow up #4!

R=mark@chromium.org
BUG=chromium:567850,chromium:656800
TEST=tests added to crashpad_client_test

Change-Id: I2a53f2168988e620ce240750c6c2d544ba95c8b4
Reviewed-on: https://chromium-review.googlesource.com/406741
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-11-03 16:38:22 +00:00
Mark Mentovai
375082098d mac: Fix tests on 10.12.1
crashpad_snapshot_test MachOImageAnnotationsReader.CrashDyld was failing
on 10.12.1. In 10.12, dyld’s intentional crashes come through
abort_with_payload(). In 10.12.1, it appears that the task port sent
along with abort_with_payload() crashes is now a corpse port, which has
a different port name than the task port that it originated from.

https://openradar.appspot.com/29079442

TEST=crashpad_snapshot_test MachOImageAnnotationsReader.CrashDyld
BUG=crashpad:137

Change-Id: I43f89c0f595dd5614fc910fa1f19f21ddf0a7c4d
Reviewed-on: https://chromium-review.googlesource.com/407087
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-03 14:44:42 +00:00
Mark Mentovai
bb7d249d65 Partially port the crashpad_client library to Linux/Android
This defines the global (per-module) CrashpadInfo structure properly on
Linux/Android, located via the “crashpad_info” section name.

Per the ELF specification, section names with a leading dot are reserved
for the system. Reading that, I realized that the same is true of Mach-O
sections with leading underscores, so this renames the section as used
on Mach-O from __DATA,__crashpad_info to __DATA,crashpad_info.

This change is sufficient to successfully build crashpad_client as a
static library on Linux/Android, but the library is incomplete. There’s
no platform-specific database implementation, no CaptureContext() or
CRASHPAD_SIMULATE_CRASH() implementation, and most notably, no
CrashpadClient implementation.

BUG=crashpad:30

Change-Id: I29df7b0f8ee1c79bf8a19502812f59d4b1577b85
Reviewed-on: https://chromium-review.googlesource.com/406427
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-02 23:19:50 +00:00
Scott Graham
55ba6b6780 break; after handling --initial-client-data on command line
Not surprisingly,
"0x278,0x27c,0x280,0x274,0x288,0x978a70,0x978a80,0x978a90" is not a
valid directory to store metrics in.

Fortunately --metrics was processed before --initial-client-data in a
local build, otherwise this could have lurked for a long time. :(

R=mark@chromium.org
BUG=655788,656800

Change-Id: I3ac3d1b487f55ddf0172bac51f8d9efc411c3329
Reviewed-on: https://chromium-review.googlesource.com/406938
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-11-02 23:13:03 +00:00
Scott Graham
76ef9b5c2b win: Address failure-to-start-handler case for async startup
Second follow up to https://chromium-review.googlesource.com/c/400015/

The ideal would be that if we fail to start the handler, then we don't
end up passing through our unhandled exception filter at all.

In the case of the non-initial client (i.e. renderers) we can do this by
not setting our UnhandledExceptionFilter until after we know we've
connected successfully (because those connections are synchronous from
its point of view). We also change WaitForNamedPipe in the connection
message to block forever, so as long as the precreated pipe exists,
they'll wait to connect. After the initial client has passed the server
side of that pipe to the handler, the handler has the only handle to it.
So, if the handler has disappeared for whatever reason, pipe-connecting
clients will fail with FILE_NOT_FOUND, and will not stick around in the
connection loop. This means non-initial clients do not need additional
logic to avoid getting stuck in our UnhandledExceptionFilter.

For the initial client, it would be ideal to avoid passing through our
UEF too, but none of the 3 options are great:
1. Block until we find out if we started, and then install the filter.
   We don't want to do that, because we don't want to wait.
2. Restore the old filter if it turns out we failed to start. We can't
   do that because Chrome disables ::SetUnhandledExceptionFilter()
   immediately after StartHandler/SetHandlerIPCPipe returns.
3. Don't install our filter until we've successfully started. We don't
   want to do that because we'd miss early crashes, negating the benefit
   of deferred startup.

So, we do need to pass through our UnhandledExceptionFilter. I don't
want more Win32 API calls during the vulnerable filter function. So, at
any point during async startup where there's a failure, set a global
atomic that allows the filter function to abort without trying to signal
a handler that's known to not exist.

One further improvement we might want to look at is unexpected
termination of the handler (as opposed to a failure to start) which
would still result in a useless Sleep(60s). This isn't new behaviour,
but now we have a clear thing to do if we detect the handler is gone.

(Also a missing DWORD/size_t cast for the _x64 bots.)

R=mark@chromium.org
BUG=chromium:567850,chromium:656800

Change-Id: I5be831ca39bd8b2e5c962b9647c8bd469e2be878
Reviewed-on: https://chromium-review.googlesource.com/400985
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-11-02 21:39:52 +00:00
Mark Mentovai
c55e49c13d doc: Remove errant parenthesis
Also add a link to codereview.settings.

Change-Id: Id6676e16fa3e10e34805c47b2d41e82e524af09a
Reviewed-on: https://chromium-review.googlesource.com/406707
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-02 15:26:12 +00:00
Mark Mentovai
96b9857ace Fix the crashpad_minidump library for 32-bit ARM.
ARCH_CPU_ARMEL, not ARCH_CPU_ARM. This is probably going to bite again.

BUG=crashpad:30

Change-Id: Ifa6069638c72db13b7f6498471f9ca3ad7c45b90
Reviewed-on: https://chromium-review.googlesource.com/406407
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 21:17:39 +00:00
Mark Mentovai
88e3b6b022 Omit platform-specific assembler source from builds as needed
The default filename rules do not match .S or .asm, so the
platform-specific assembler implementations of CaptureContext() were not
being affirmatively excluded from other platforms’ builds. This
previously worked without causing problems because the Mac build
environment didn’t know what to do with .asm files, and the Windows
build environment didn’t know what to do with .S files. Now that another
platform that may understand .S files is being added, the rules for when
to build these files must be tailored a bit more tightly.

BUG=crashpad:30

Change-Id: Ib62e619c007320d45279c104b3e229d92698aa72
Reviewed-on: https://chromium-review.googlesource.com/406348
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 21:17:02 +00:00
Mark Mentovai
47a830465f Port the minidump library to Android and ARM
BUG=crashpad:30

Change-Id: I74212722b73f498c263f65d7599a8aca601c7ba0
Reviewed-on: https://chromium-review.googlesource.com/406387
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 20:32:37 +00:00
Mark Mentovai
e616638c9d Replace Rietveld with Gerrit in the developer documentation
Also, update a few links for good measure.

Change-Id: I47113a4f324e4ad6ba02aa46bae821eefd4d98ea
Reviewed-on: https://chromium-review.googlesource.com/406347
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 18:59:36 +00:00
Mark Mentovai
e7bd798af4 Update build/test and status documentation to reflect Android
BUG=crashpad:30

Change-Id: I0170e95e43146f6a2af6b6753c5197794bd83817
Reviewed-on: https://chromium-review.googlesource.com/406307
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 18:34:56 +00:00
Mark Mentovai
fd751f4708 Correct StringToUnsignedInt[64]()
StringToUnsignedInt[64]Traits::Convert() was returning in its failure
(negative input) case without touching *end. Its caller relies on *end
to detect failure.

Change-Id: I636f95471cd499434743e73f0e5e0b60c0871795
Reviewed-on: https://chromium-review.googlesource.com/405468
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-11-01 15:57:36 +00:00
Scott Graham
c2814e2519 Don't throttle explicitly requested uploads
R=mark@chromium.org
BUG=chromium:660955

Change-Id: Ia31846fe3487a52f4cad34859e23a7192ca4065e
Reviewed-on: https://chromium-review.googlesource.com/405533
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-10-31 21:17:45 +00:00
Mark Mentovai
b978b03fa1 Port most of crashpad_util_test to Linux/Android
- In the ProcessInfo test, port the global argc/argv getter to Linux by
   reading /proc/self/cmdline.
 - Use <inttypes.h> format macros for 64-bit types.
 - Only #include <sys/sysctl.h> on macOS.
 - #include <signal.h> instead of <sys/signal.h>.

In order to test on Linux/Android, the following changes to the
crashpad_util_test target must be made until more porting is complete:

 - Remove the dependency on crashpad_client because that library has not
   been ported yet.
 - Remove process_info_test.cc because it depends on crashpad_client and
   there is no implementation of ProcessInfo for Linux yet.
 - Remove http_transport_test.cc because there is no HTTPTransport
   implementation for Linux or Android yet.
 - Remove checked_address_range_test.cc because checked_address_range.cc
   does not yet expose a cross-bit usable type for addresses and sizes
   on Linux.

BUG=crashpad:30
TEST=crashpad_util_test

Change-Id: Ic17cf26bdf19b3eff3915bb1acdaa701f28222cd
Reviewed-on: https://chromium-review.googlesource.com/405647
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 21:07:06 +00:00
Mark Mentovai
d1aafe78ea Port the test library and crashpad_test_test to Linux/Android
- Linux (but not Android) provides __fpurge() instead of fpurge().
 - In multiprocess_exec_test_child, use getrlimit(RLIMIT_NOFILE) instead
   of max(sysconf(_SC_OPEN_MAX), OPEN_MAX, getdtablesize()). OPEN_MAX is
   not availble on Linux (but is in Android as a bogus value), and
   getdtablesize() is not available in Android since 5.0.0 (API 21).
   sysconf(_SC_OPEN_MAX) and getdtablesize() both return
   getrlimit(RLIMIT_NOFILE) on all relevant platforms.
 - Add a Linux/Android implementation of test::Paths::Executable().
 - Respect TMPDIR for all POSIX platforms in
   ScopedTempDir::CreateTemporaryDirectory(). If TMPDIR is unset or
   empty, use /tmp, except on Android, where /tmp does not exist and
   /data/local/tmp is used instead.

Also:

 - Fix the Mac and Windows implementations of test::Paths::Executable()
   to abort on fatal error, in line with the new Linux/Android version.

BUG=crashpad:30
TEST=crashpad_test_test

Change-Id: I98a50d8579b193c813ba79794be087649e94cc06
Reviewed-on: https://chromium-review.googlesource.com/405507
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 19:30:24 +00:00
Mark Mentovai
d5a759c900 Update mini_chromium to 8e8d3cc9a245f1bf63296e97fb6ac1c90f6d86f5
9f129335dbe5 Add Android and ARM support to mini_chromium base
1d3e5ef89ad0 Link Linux/Android executables with -pie for position
             independence
8e8d3cc9a245 Add Android to filename_rules.gypi

BUG=crashpad:30

Change-Id: Idace661e0ffa598f5c2a2a4af2d578355c101c56
Reviewed-on: https://chromium-review.googlesource.com/405567
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 17:42:54 +00:00
Mark Mentovai
e956a8252f Port the util library to Android
With this change, it is possible to build crashpad_util for Android with
clang. I built with NDK 13b (clang 3.8) at API 24 (current), API 21
(used by Chrome in 64-bit builds), and API 16 (used by Chrome in 32-bit
builds).

 - In WeakFileHandleFileWriter::WriteIoVec(): Android does not expose
   the IOV_MAX macro, but its value can be obtained by calling
   sysconf(_SC_IOV_MAX).
 - In CloseMultipleNowOrOnExec(): API 21 removes getdtablesize(). Skip
   it, because it returned the same thing as sysconf(_SC_OPEN_MAX),
   which is already consulted.
 - Throughout: Various #ifdefs checking for OS_LINUX have been extended
   to also check for OS_ANDROID. In Chrome’s build_config.h (and thus
   mini_chromium’s), OS_LINUX is not defined when OS_ANDROID is.

This has not been tested beyond building the crashpad_util target.

BUG=crashpad:30

Change-Id: Ieb0bed736029d2d776c534e30e534f186e6fb663
Reviewed-on: https://chromium-review.googlesource.com/405267
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 15:23:43 +00:00
Mark Mentovai
f735d050c4 Port the util library to Linux
With this change, it is possible to build crashpad_util on Linux. I
built with clang 3.8.1 and GCC 6.2.0.

 - For per-OS “exception code” metrics, Android and Linux are broken out
   distinctly.
 - Because Linux provides no standard UUID generator, base::RandBytes()
   is used to generate random UUIDs for the InitializeWithNew() form.
 - Multiple fixes for CloseMultipleNowOrOnExec():
    - readdir_r() is deprecated in glibc 2.24. Use readdir() on Linux.
    - Linux does not have OPEN_MAX. Use the fs.nr_open sysctl (via
      /proc/sys) to determine the maximum (currently-configured)
      possible number of file descriptors per process.
    - Use the {CTL_KERN, KERN_MAXFILESPERPROC} sysctl on Mac to
      determine the maximum (currently-configured) possible number of
      file descriptors per process. This is an improvement over using
      OPEN_MAX, which is still consulted.
 - ThreadLogMessages’ use of DCHECK_EQ() needs an address-of operator on
   function pointers to avoid confusing GCC.

One problem remains:

 - util/misc/pdb_structures.h produces -Wmultichar errors. -Wmultichar
   is enabled by default with GCC (but not clang). It is impossible to
   disable this warning with #pragma GCC diagnostic ignored. See
   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

This has not been tested beyond building the crashpad_util target.

BUG=crashpad:30

Change-Id: I02e7a05da512ca312806d825b3fc9b2c5bf1a990
Reviewed-on: https://chromium-review.googlesource.com/404009
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-10-31 15:20:59 +00:00
Scott Graham
cc0b7deef2 Get VS2013 compilation working again for Crashpad
Follow up #1 to https://chromium-review.googlesource.com/c/400015/,
still pending further discussion on details of registration.

R=mark@chromium.org
BUG=chromium:567850,chromium:656800

Change-Id: Idfee3a3241d7cfe418fbf9e40f17f35e5dbefac9
Reviewed-on: https://chromium-review.googlesource.com/401182
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-10-22 00:05:02 +00:00
Scott Graham
2d87606bb5 win: Start crashpad_handler by inheriting connection data to it
Previously, StartHandler() launched the handler process, then connected
over a pipe to register for crash handling. Instead, the initial client
can create and inherit handles to the handler and pass those handle
values and other data (addresses, etc.) on the command line.

This should improve startup time as there's no need to synchronize with
the process at startup, and allows avoiding a call to CreateProcess()
directly in StartHandler(), which is important for registration for
crash reporting from DllMain().

Incidentally adds new utility functions for string/number conversion and
string splitting.

Note: API change; UseHandler() is removed for all platforms.

BUG=chromium:567850,chromium:656800

Change-Id: I1602724183cb107f805f109674c53e95841b24fd
Reviewed-on: https://chromium-review.googlesource.com/400015
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-10-21 20:35:58 +00:00
Erik Chen
1e6dbcb300 Support passing DEVELOPER_DIR to mig.py
BUG=chromium:651267

Change-Id: If02f9bac603237677d348869d05d7b4d0b31909e
Reviewed-on: https://chromium-review.googlesource.com/392486
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-10-04 14:50:45 +00:00
Scott Graham
a16a7fd4ef win: Make DumpAndCrash() always terminate, and tidy up special codes
Upstreaming with tidying up of
https://codereview.chromium.org/2377693002/.

R=mark@chromium.org
BUG=chromium:634418

Change-Id: Ie8b3b673c8d2a06c5cc918a034688aa9396cfbf4
Reviewed-on: https://chromium-review.googlesource.com/390436
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-29 04:44:20 +00:00
Scott Graham
5a6c961658 Add metric for handler crash on Windows
R=mark@chromium.org
BUG=crashpad:100

Change-Id: I80de83d133cd9968af17e50798d6a5c6bd121b4b
Reviewed-on: https://chromium-review.googlesource.com/390480
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-28 20:43:24 +00:00
Scott Graham
ac6c01b575 Add metrics for tracking uploads
Three new metrics:
- counting upload success/failure;
- enum tracking the reason upload was skipped;
- enum describing how an upload got to the pending state.

R=mark@chromium.org, asvitkine@chromium.org
BUG=crashpad:100

Change-Id: I5e0cbc1ac3424e974f3a51560e5cdad484ffc038
Reviewed-on: https://chromium-review.googlesource.com/388855
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-26 22:09:32 +00:00
Scott Graham
0aeca5f123 UMA changes based on Chromium-side review
Per comments in https://codereview.chromium.org/2350943003/:
- Increase the upper bound for Crashpad.CrashReportSize to 20M
- Make ExceptionEncountered a 2 enum bucket to track start/end.

R=asvitkine@chromium.org, mark@chromium.org
BUG=crashpad:100

Change-Id: Ie848b2e3744c58f6d669986d3e78e7391b0e9e68
Reviewed-on: https://chromium-review.googlesource.com/387685
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-21 18:05:14 +00:00
Scott Graham
007f790fe2 static const on const char[] for UMA string
By request on https://codereview.chromium.org/2350943003.

BUG=crashpad:100

Change-Id: I64292793dd51e72d102d90506181ae0fc7ef1c63
Reviewed-on: https://chromium-review.googlesource.com/387195
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-20 21:49:50 +00:00
Scott Graham
17167a1e57 static_cast UMA 'enum class's to int
Otherwise, the Chromium expansions complain about not being able to add
and needing explicit conversions.

R=mark@chromium.org
BUG=crashpad:100

Change-Id: I0540a8dabff61f2189d9532422adae5c2885ae03
Reviewed-on: https://chromium-review.googlesource.com/387166
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-20 00:24:54 +00:00
Scott Graham
72a12e2e94 Make UMA for exception code OS-specific
R=wfh@chromium.org, mark@chromium.org
BUG=crashpad:100

Change-Id: I9368168405d1bd761ae6205955968264543541c4
Reviewed-on: https://chromium-review.googlesource.com/386989
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-19 21:57:18 +00:00
Scott Graham
b48e9bfbab Add UMA to exception handler exception catching
Includes mini_chromium DEPS roll for:
88e0a3e Add stub of sparse_histogram.h

R=mark@chromium.org
BUG=crashpad:100

Change-Id: I4c541a33be0f7f47e972af638d4765bd06682acf
Reviewed-on: https://chromium-review.googlesource.com/386385
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-19 18:10:31 +00:00
Scott Graham
23d31c4fea Fix Mac build after 27aeb2c9
Oh yeah, that other platform.

R=mark@chromium.org
BUG=crashpad:100

Change-Id: Iaacd9a2a4a9754a26af9dd78f5b12cb1523ea19b
Reviewed-on: https://chromium-review.googlesource.com/386785
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-16 20:41:50 +00:00
Scott Graham
27aeb2c9da Upstream Chromium UMA integration
Unmodified from https://codereview.chromium.org/2308763002/ other than
to add empty arguments to test code (that doesn't build in Chrome).

Requires https://chromium-review.googlesource.com/c/386236/.

Rolls mini_chromium to include:
438bd4f4 Add stub of persistent_histogram_allocator.h

R=mark@chromium.org
BUG=crashpad:100

Change-Id: Ibc88338ae2fd40a5a4ade7ff098be2bc19511543
Reviewed-on: https://chromium-review.googlesource.com/386084
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-16 20:23:06 +00:00
Mark Mentovai
0c29022090 Update mini_chromium to 7800285e83df4286981bb933e3335edade7c8308
7800285e83df Don't #undef UMA_HISTOGRAM_UNUSED

Change-Id: I6a694ae17dcafb2663485a0fecc551dad661449c
Reviewed-on: https://chromium-review.googlesource.com/384031
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-09 22:18:52 +00:00
Scott Graham
afc177ee21 Pull metrics instrumentation out to central file
Solves two problems with having the macros inline:

1. Deduplicates some of the logic (in this case, the name of the
   histogram, and whether it should be divided by 1024);

2. More useful check for compilation. As the macros are no-ops in
   Crashpad, it was easy to use the wrong name for a variable in the
   arguments to the macros (see .mm!)

This way, we have some better chance of at least having code that
compiles when built in Chromium if all the arguments are passed to
Metrics::Something() in a standalone build.

Also rolls mini_chromium DEPS to include:
99213eb Mark histogram arguments as unused to avoid warnings

R=mark@chromium.org
BUG=crashpad:100

Change-Id: I9f7fc3b85854fd61c1ebdf0084d728a7b690c2f1
Reviewed-on: https://chromium-review.googlesource.com/380445
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-02 19:13:00 +00:00
Scott Graham
5f42313ed5 Test first integration of UMA plumbing
Add a first example of a UMA entry to have it available to try to plumb
through to Chromium.

Adds LoggingFileSizeByHandle() to util/file/file_io.* to retrieve the
size of on disk file to report to UMA.

Also rolls DEPS for mini_chromium to include:
b5ec9ce Add stub versions of histogram_macros.h

R=mark@chromium.org
BUG=crashpad:100

Change-Id: Ib8e96ad4b7d715b46d2c71810c95c92965a89821
Reviewed-on: https://chromium-review.googlesource.com/338821
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-09-02 00:04:29 +00:00
Scott Graham
c6f88d164e Have MinidumpMemoryListWriter deal directly in SnapshotMinidumpMemoryWriters
This is as a precursor to
https://chromium-review.googlesource.com/374539 which merges
MemorySnapshots and so needs to be able to update them from the minidump
code.

MinidumpMemoryWriter existed to be able to mock for tests; that
behaviour is wrapped up in TestMemorySnapshot now.

BUG=crashpad:61, chromium:638370

Change-Id: I825ec57493b12fc1848018585c14544faa7e66d4
Reviewed-on: https://chromium-review.googlesource.com/374019
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-25 22:09:20 +00:00
Scott Graham
357c7c7b7b win: Add some explanation of .com/.exe for crashpad_handler
R=mark@chromium.org
BUG=

Change-Id: Iedc42c7a157967c6fc316c04bb0bbb1f97dadf8d
Reviewed-on: https://chromium-review.googlesource.com/371963
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-24 23:01:15 +00:00
Scott Graham
866e60749c Add >nul to editbin command to suppress \n in build output
R=mark@chromium.org

Change-Id: Ie22b12e42196f3fa3ce797ad04ffc38981f6e9ac
Reviewed-on: https://chromium-review.googlesource.com/374084
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-24 22:54:27 +00:00
Gayane Petrosyan
b35ee1fca1 Adding support for on-demand uploads.
In order to allow on-demand uploads for crash reports, adding a
upload_explicitly_requested bit on 'pending' state and necessary support
for it.

BUG=chromium:620762

Change-Id: Ida38e483fe8d0e48eb5cbe95e8b8bfd96a2f8f00
Reviewed-on: https://chromium-review.googlesource.com/367328
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2016-08-24 21:57:02 +00:00
Scott Graham
660a5e69d6 win: switch crashpad_handler.exe to /subsystem:windows and add .com
This switches the default behaviour of crashpad_handler.exe to be a
/subsystem:windows app, so that normal usage won't cause a console to be
popped up. At the same time, creates a copy of crashpad_handler.exe in
the output dir named crashpad_handler.com. The .com doesn't affect
normal operation, as the way StartHandler() uses CreateProcess()
requires a real path to a file. However, when run from a command prompt,
.com are found before .exe, so editbin the .com to be to a console app,
which will be run in preference to the exe when run as just
"crashpad_handler", as one tends to do from a command prompt when
debugging. That is:

  d:\src\crashpad\crashpad\out\Debug>where crashpad_handler
  d:\src\crashpad\crashpad\out\Debug\crashpad_handler.com
  d:\src\crashpad\crashpad\out\Debug\crashpad_handler.exe

  d:\src\crashpad\crashpad\out\Debug>crashpad_handler --help
  Usage: crashpad_handler [OPTION]...
  ...

  d:\src\crashpad\crashpad\out\Debug>crashpad_handler.exe --help
  <no output>

  d:\src\crashpad\crashpad\out\Debug>crashpad_handler.com --help
  Usage: crashpad_handler.com [OPTION]...
  ...

We also use the .com file in test invocations so that output streams
will be visible.

R=mark@chromium.org

Change-Id: I1a27f88472d491b2a1d76e63c45e6415d9f679c0
Reviewed-on: https://chromium-review.googlesource.com/371578
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-17 20:50:47 +00:00
Mark Mentovai
9807cba2f4 end_to_end_test: accept mangled anonymous namespaces from cdb
When crashy_test_program's SomeCrashyFunction is inlined into
CrashyMain, cdb doesn't demangle the decorated form of an anonymous
namespace (?A0x12345678) into the expected `anonymous namespace' string.

I experienced this in Release_x64 and Release modes using MSVS 2015
update 3 (14.0.25420.1, cl 19.00.24213.1) and cdb versions 10.0.10240.9
and 10.0.14321.1024.

BUG=crashpad:129

Change-Id: I0a665b88891c271253adccd9b2b414fcaac26c8f
Reviewed-on: https://chromium-review.googlesource.com/368730
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-12 17:33:28 +00:00
Mark Mentovai
c822792095 Update buildtools to f8fc76ea5ce4a60cda2fa5d7df3d4a62935b3113
The only thing relevant to Crashpad in the window is:

222bd42ce39d roll clang-format 242086:r258123

Change-Id: Ia175470c12f61ef4dac0e1417143d3cac9d16765
Reviewed-on: https://chromium-review.googlesource.com/368690
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-12 17:31:55 +00:00
Mark Mentovai
e8650f4729 Update googletest to ec44c6c1675c25b9827aacd08c02433cccde7780
30846f31c5e5 Fix typo in googlemock/README.md
a7964a3fbd41 Implement GetThreadCount for AIX
bf7e9e8c2bb3 Add include of sys/types.h
554ca00ff706 Update DevGuide.md
c81cf6b7efde Update .travis.yml
58b543535a57 Update .travis.yml
231af5ddc81a Try to use clang-3.6 in travis
c76f9e0cdd49 Update .travis.yml
e8193fe6e064 Adding llvm toolchain repo
b8f9b2b540d9 Update clang version
bbbc025d2e84 More docs in travis config
6705b9adeabc Override clang++ name on Linux only
4a0b77ff7253 Create CMakeLists.txt
98d988deac06 Add CMake install rules for gtest libraries and headers
c4c23548a19a Merge pull request #614 from DukeXar/master
884dd08d73d7 Merge pull request #628 from fjunqueira/patch-1
93c37d59b013 Merge pull request #632 from nocnokneo/add-cmake-install-
             rules
f44190f2c432 Fix missing-field-initializers GCC/Clang warning (issue
             433)
ffce1a857856 Merge pull request #633 from plopresti/master
3aef7d7ddd3a Update README URLs based on HTTP redirects
83b93eac3b2b Update FAQ.md
25409abfe7a3 Fixing some table error in file
ccd0f94e8217 Merge pull request #592 from Ferenc-/master
96bba4d5c1e9 Merge pull request #638 from KindDragon/patch-1
3c3a4ac2c2fa Merge pull request #640 from Ali-Se/patch-2
6fe019e6b73e Merge pull request #607 from google/BillyDonahue-patch-1
2f93e2d8085e Merge pull request #636 from ReadmeCritic/master
16b9bbc3efb1 Fix AdvancedGuide link in FAQ.md
1f8fe13618a5 Merge pull request #647 from mithro/patch-1
7c8ac4886a7a Added CMake install rules for GMock
ebd1d0887cdb Fix link to FAQ in Primer.md
35fb11efbe1a Merge pull request #654 from cmorse/doc_fix
f601ee162e23 Add include dirs to targets if CMake version supports it
a470862dbe80 fixed link in googlemock documentation
57b376a9cb8b Merge pull request #660 from waynix/FixLinks
c1cd9c2b05d5 Merge pull request #650 from jpuigcerver/master
0162ff72e80e Merge pull request #657 from
             audiofanatic/issue655-targetHeaderDeps
ddb8012eb48b Merge pull request #602 from mtbrandy/threadcount_aix
ac35fe735984 Update GTEST_PROJECT_URL_ in internal/gtest-port.h
13206d6f53aa Merge pull request #670 from dawikur/master
d8df1fb4884c Add link to Google Test Primer docs in README.md
d404af0d987a add python 3 support to tests
456fc2b5c4e9 add python 3 support to fuse_gtest_files script
82b11b8cfcca Merge pull request #678 from pjaytycy/master
340c6b337518 Add tmux and tmux-256color to the colored terminal list
a9b73f8139a9 Merge pull request #699 from achimnol/master
ff5ffd457e03 Merge pull request #688 from tamland/python3
f364e188372e Change error message of EXPECT_EQ to treat lhs and rhs
             equivalently
b648a3072161 Add build artifacts to git ignore
d4aa34b05d72 Fix link that's returned when running tests. #714
f5acf22268d6 Merge pull request #716 from jacob-
             meacham/feature/gitignore
5909d44d348f Merge pull request #715 from jacob-meacham/bugfix/expect-
             call
77d6b1733803 Merge pull request #713 from DarthGandalf/expect
83d3b47acf8a Fix formatting in AdvancedGuide.md
ff07a5de0e81 Merge pull request #719 from paul-
             wilkinson/docs_formatting_fix
d6790f26cae2 Read Bazel's $XML_OUTPUT_FILE environment variable
12b2f23e8e6b Fix inconsistent style
5db9cbbc2332 Restructure $XML_OUTPUT_FILE logic
6991f422b65a Fix env_var_test to ignore XML_OUTPUT_FILE if already set
d23cf2b15701 Restructure test so each scenario is independent
62700bdf5689 Fixed typo ('XCode' -> 'Xcode')
f7248d80eae1 Merge pull request #731 from mattrajca/patch-1
0098be394ad5 Fix typo (Inovke -> Invoke)
eba179631078 Merge pull request #735 from phad/patch-1
72416fab75f0 Merge pull request #724 from duggelz/master
207147495c80 Fix whitespace in paragraph
d225acc90bc3 Merge pull request #741 from mbinna/patch-1
2746b57f78a0 Changed the GTestDir marco value to reflect the new dir of
             googletest
01f3d09f9f6c Updated the value of GTEST_DIR to reflect the googletest
             dir
5bae126d663e Added VS 2015 project support
0a439623f75c Merge pull request #773 from mazong1123/master
e35015f53904 fix to operator precedence in GTEST_TEST_BOOLEAN_ with
             expressions that implement operator bool
2489c3074748 Fix to tests that return object which implement operator
             bool
faee7d1fbcf1 Merge pull request #808 from djmott/master
ce7ec96edab7 Rollback change #808
10799abad25a Merge pull request #810 from google/rollback_808
43c0ae337536 Support running MSVC build on AppVeyour
81345850725f Merge pull request #723 from KindDragon/master
e51026e5d15e Add Appveyor badge to Readme.md
d406cb18c3d7 Merge pull request #814 from google/BillyDonahue-patch-2
531bf5c41071 Fixed issue #775
dc2dbf1fbf1d Reformatted the Unprintable operator== code style
ec44c6c1675c Merge pull request #821 from mazong1123/master

Change-Id: I40169adab6ea260334089b08bf4a51d4a65d6e08
Reviewed-on: https://chromium-review.googlesource.com/368680
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-12 17:30:52 +00:00
Sami Kyostila
e45024b083 Use stl utilities from the base namespace
The utilities in base/stl_util.h have been moved from the global
into the base namespace. This patch updates the call sites accordingly.

No functional changes.

Change-Id: I059d5d6299f947b1135672da170427d23ac4775e
Reviewed-on: https://chromium-review.googlesource.com/368640
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-12 14:31:53 +00:00
Mark Mentovai
d8982a0859 minidump: Fix unit multiplier in variable names
There’s no behavior change, but two variables that store quantities in
units of Hz were misnamed *_mhz.

Change-Id: I8b7d9576a7638a4ee9789dc9d1050009ac009696
Reviewed-on: https://chromium-review.googlesource.com/368080
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-11 16:51:50 +00:00
Mark Mentovai
93485b2ccb Fix grammar in ModuleSnapshot::DebugFileName() documentation
Change-Id: Id3a9b5c1167e0d2a734af07f1f04e8c76f183c98
Reviewed-on: https://chromium-review.googlesource.com/368040
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-11 03:23:05 +00:00
Mark Mentovai
073ce275e0 De-tab and reindent after 7c807242e0b1
Change-Id: Ia68aa8294aa57d713066fbadd2200089e50e315b
Reviewed-on: https://chromium-review.googlesource.com/368030
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-11 02:17:59 +00:00
Scott Graham
56b14bceef win getopt: memcmp() -> strncmp() for ASan
R=mark@chromium.org
BUG=chromium:635990

Change-Id: I69f0e1f0f48c6d0d2ac26eb395df7add2907d02b
Reviewed-on: https://chromium-review.googlesource.com/367350
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-08-10 20:34:10 +00:00
Mark Mentovai
18a839c810 Update GYP to 93cc6e2c23e4d5ebd179f388e67aa907d0dfd43d
7904ce96fd01 Make the ninja generator handle symlinked paths correctly
741b7f1d257b Add support for a CPPFLAGS_host environment variable, and
             update the cflags test to verify it
265f495cc3a3 Fix infinite loop on empty variable name
c3d861c8bca4 ninja win: Suppress noisy messages from link.exe when LTCG
             is enabled
8f3918d7408f Promote documents in md-pages branch
b3cef028a51a AIX's cp command does not support -af which is the default,
             so use -RPf which achives something similar
427a0406159c Adding framework path mapping for 'copies' action in gyp
             files
3f21260b4340 Change analyzer to search for build_targets from supplied
             targets
e2e928bacd07 Add support for Xcode LastUpgradeCheck project attributes,
             allowing suppression of Xcode project configuration
             warnings
68f268008844 Add support for kernel-extensions in GYP
ae2d73840216 Set optional LastSwiftUpdateCheck to Xcode project
             attributes
f2c3cfc3b1df win: Fix missing loadable_module dependency in ULDI mode
2c1e6cced235 Revert of e2e928bacd07
0f5bae131e58 Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR
2dd620e10329 Attempt again to upstream Xcode project version warning
             suppression, from 1416453003 and 1430573009, and rolled
             back in 1423583004
f54bd199e717 Adds back lookup of 'all' targets
70fa8bbeb292 Changes semantics of analyzer
33b351b2eda8 Fix bug in analyze were empty invalid_targets was
             incorrectly written
e1133480da78 Changes analyzer to include test_targets in compile_targets
f06a5a0e46ce Remove deprecated code path from analyzer.py
567d084f2cb1 Add support for NetBSD (OS = netbsd)
c385ad654b30 Copy files with `cp -pPRf` on OpenBSD
f4d65e35719c Generate response files out of the source tree with xcode &
             xcode-ninja
e2313c02ad7b Fix CalculateGeneratorInputInfo for "xcode-ninja" generator
6fb8bd829f0c Derive default for ar_host from ar
70ee80e82bac Error checking to clarify SYSTEMROOT errors
863d9a4f4119 Make ninja work with XCTests for iOS
b85ad3e578da ninja: Correctly handle copies steps in sourceless
             shared_library targets
b362bbfbc877 mac: Extend libtool filter to also match fat builds
2b086540aeed Peter Kasting <pkasting@chromium.org>
4ff48eb18307 Switch the dependencies to their Git mirror
54b7dfc03f74 mac ninja&make: Use xcrun instead of xcodebuild where
             possible
9e2ceaef5352 GYP: Make GYP build deterministic
6f83895e9622 Stop copying deprecated ResourceRules.plist
aa0301be5a24 Allow converting resource plists to binary
87ac4d0e63fc Add limited support for Mac to CMake generator
7ab6f482e87a [iOS] Preserve global symbols when calling strip (-x) on
             today extensions
32cb1709adc3 Add timestamp=none to codesign flags
57190fa27868 [iOS] Update today_extension link flags
18ce4ecf6cf2 [iOS] Set --auto-activate-custom-fonts for ibtool compile
a230124f3834 Avoid gyp_chromium failures when vcvarsall.bat was run
66bbdf4c6b45 Revert "[iOS] Set --auto-activate-custom-fonts for ibtool
             compile."
5170bfd38fe7 [Mac/iOS] Add custom fonts, target device and minimum
             deployment target to _CopyXIBFile
51383232066a Update Xcode emulation extra plist items
7d29c3de1f5e Revert "Update Xcode emulation extra plist items."
b25bbc1f942d Re-land update Xcode emulation extra plist items for Xcode
             7.2
2f9ffdc96135 Support sdk_version of None
ed163ce233f7 Don't recompute environment for mac bundles unnecessarily
0cd47bf6960e Make login.keychain and 'Provisioning Profiles' symlinks
d84fed246cd4 Fix tests with Xcode 7
1950f6761bdf Xcode-ninja: Add excluded files to the project
             sources_for_indexing.xcodeproj
61259d585ce9 ninja/win: Use qualified paths for precompiled headers
5874a3cf9bac Adjust pretty_gyp to align comments with the appropriate
             braces
fbcb317c7513 ninja: Add target_rpath generator flag
133eaf70b372 Add support for iOS Frameworks with header maps
8e8c3178d9d2 Detect and warn on missing vcvarsall.bat
28340b46df65 Support DEVELOPER_DIR in gyp-ninja for mac
3fa0c6038873 [GN] Use hard-link if possible when copying to bundle
697933c2e3b3 Fix mac_tool.py copy-bundle-resource errors
4ec6c4e3a94b [iOS/OS X] Copy file instead of hard-linking them
f9ac7a9ba1c4 gyp-win-tool: Let LinkWrapper only transmogrify / when the
             host platform is Windows
34d3fba9d167 gyp-win-tool: Fix regression from my last change
6ea68631cdab gyp-win-tool: Don't use shell=True on non-Windows hosts
db72e9fcf55b Fix header map nextPowerOf2 method
4cf07e8d6167 [ios-ninja] Support xctests in devices in release
e24c83726b72 Adds support for a new target spec: 'mac_xcuitest_bundle'
             This allows us to create UI testing bundles
02b145a1a4f4 Enabling /ZW (CompileAsWinRT) option for msvs
bce1c7793010 ninja/mac: Add horrible workaround for horrible Xcode 7.3
             ld bug
c61b0b35c839 [gyp-ninja] Set simulator and device SDKROOT for iOS
35eafcd93951 Ignore more Xcode stderr logging information
bac4680ec9a5 Only call CopyStringsFile if convert_to_binary is False
e7079f0e0e14 Fix :rfc1034identifier when the value contains underscore
1f989f652a30 Complete PBXCopyFilesBuildPhase TODO in xcodeproj_file.py
93cc6e2c23e4 Make the ninja backend transitively check for C++ sources
             to use the C++ compiler for linking

Change-Id: Ifdb705cee07aa0d158b9b1952875041d9f2a14e5
Reviewed-on: https://chromium-review.googlesource.com/367490
Reviewed-by: Scott Graham <scottmg@chromium.org>
2016-08-10 01:02:30 +00:00