Граф коммитов

1398 Коммитов

Автор SHA1 Сообщение Дата
Landon Fuller 9a76b02200 Merge branch 'release/plcrashreporter-1.2' into bugfix/PLCR-545-dw_op_bregx-is-handled-incorrectly 2014-05-22 10:05:05 -04:00
Joe Ranieri 7b72b92e73 Fixing the handling of DW_OP_bregx.
According to the DWARF4 spec:
The DW_OP_bregx operation has two operands: a register which is
specified by an unsigned LEB128 number, followed by a signed LEB128
offset.

Issue: PLCR-545
2014-05-22 10:03:23 -04:00
Joe Ranieri 0852d1d12a Fixing the handling of DW_OP_bregx.
According to the DWARF4 spec:
The DW_OP_bregx operation has two operands: a register which is
specified by an unsigned LEB128 number, followed by a signed LEB128
offset.

Issue: PLCR-545
2014-05-21 16:33:55 -04:00
Landon Fuller f7f69d46fc Merge branch 'bugfix/PLCR-543-fix-documentation-warnings' 2014-05-07 15:13:03 -04:00
Joe Ranieri 39ffd63c13 More autorelease, less memory leaks.
Issue: PLCR-543
2014-05-07 14:52:57 -04:00
Joe Ranieri 47e7f6f53f Add a sanity check for the processInfo property.
Issue: PLCR-543
2014-05-07 14:39:21 -04:00
Joe Ranieri 513165bf6b Stop using the deprecated sharedReporter in tests.
Issue: PLCR-543
2014-05-07 14:38:13 -04:00
Joe Ranieri d2701017b8 Adding the concept of external deprecations.
An externally deprecated definition is marked deprecated for external
clients only. This allows the framework implementation to use the
definition without receiving deprecation warnings/errors.

Issue: PLCR-543
2014-05-05 12:38:32 -04:00
Joe Ranieri c8598bf80b Fixing documentation comment tags.
These were found by -Wdocumentation-unknown-command, which Clang
disables by default because it’s too noisy. In the case of the
PLCrashReporter code, it continually warns that 'internal' is not a
known command.

Issue: PLCR-543
2014-05-04 10:17:51 -04:00
Joe Ranieri 61f5165f27 Ensure that a code type is always set.
This is currently impossible to reach, but if more processor info encodings are added this code will have something to fall back onto.

Issue: PLCR-543
2014-05-04 03:58:18 -04:00
Joe Ranieri b71b6b1fba Narrowing the scope of diagnostic ignore pragmas.
Issue: PLCR-543
2014-05-04 03:58:18 -04:00
Joe Ranieri 053de2e7f5 Documenting the special handling of v1 reports.
Issue: PLCR-543
2014-05-04 03:58:18 -04:00
Joe Ranieri 1df3d6382d Removing leading whitespace.
Issue: PLCR-543
2014-05-04 03:58:18 -04:00
Joe Ranieri 5f3ba0bc10 Fixing return types.
When plcrash_async_read_addr() was removed in commit 1eb3c7b, the call
sites were not updated properly. plcrash_async_task_memcpy() returns
plcrash_error_t and not kern_return_t.

Issue: PLCR-543
2014-05-04 03:40:11 -04:00
Joe Ranieri cfcfc79bab Add deprecated attributes to deprecated members.
This fixes warnings about the doxygen comments not being in sync with
the attributes on the members. This should be the last of the
documentation comment warnings and -Wno-documentation-deprecated-sync
has been removed.

PLCR-543
2014-05-01 12:58:45 -04:00
Joe Ranieri 1eb3c7b2fd Removing the deprecated plcrash_async_read_addr function.
Issue: PLCR-543
2014-04-26 14:25:56 -04:00
Joe Ranieri 42f02e4230 Working around Clang’s dislike of @sa @ref.
This is the last of the documentation warning fixes, so the
-Wno-error=documentation flag is being removed and documentation
warnings will be errors from here out.

Issue: PLCR-543
2014-04-25 17:04:17 -04:00
Joe Ranieri f26343140f Fixing the bulk of the documentation warnings.
This leaves a handful of warnings about using '@sa @ref async_safety'.
Clang thinks that the '@sa' command has an empty paragraph in this
case, but it appears to be a false positive and a bug in Clang.

Issue: PLCR-543
2014-04-23 20:12:49 -04:00
Joe Ranieri f5c662914f Turning on warnings about documentation comments.
Given that the project builds with -Werror, the documentation comment
warning has been forced to stay a warning via -Wno-error-documentation.
When the project is free of documentation warnings, this should be
removed.

Warnings about documentation comments containing @deprecated but the
actual declaration not having a deprecated attribute have been disabled
via -Wno-documentation-deprecated-sync. Turning this on and fixing the
warnings will result in a cascade of new warnings relating to using
deprecated APIs.

Issue: PLCR-543
2014-04-23 20:02:56 -04:00
Landon Fuller 0c0785b033 Merge branch 'bugfix/PLCR-542-fix-aarch64-alignment-issues' 2014-04-16 11:30:12 -04:00
Landon Fuller 68a7db8638 Merge branch 'bugfix/PLCR-542-fix-aarch64-alignment-issues' into release/plcrashreporter-1.2 2014-04-16 11:23:01 -04:00
Landon Fuller 93859e3c4f Fix AArch64 code alignment issues.
We missed a number of .align statements in the arm64 port. This happened
to work anyway, but in a few cases, misalignment is now triggering
linker warnings, alerting us to the bug.

This adds missing .align directives for all ARM64 code, and also fixes
an innocuous over-alignment (.align 4) for 32-bit ARM.

Issue: PLCR-542
2014-04-16 11:18:57 -04:00
Landon Fuller dfadd703e2 Merge pull request #4 in PLCR/plcrashreporter from feature/PLCR-538-switch-to-cpp11 to master
* commit '2b3b33a4d346c84fd8653e1e9e002cdd281e4a6e':
  C++11 fix: Add explicit static casts for cases where were relying on implicit conversion to a narrower/signed/unsigned integral type.
  C++11 fix: Avoid casting the SIG_* function-types to (in theory) constant uintptr_t values.
  C++11 fix: An explicit instantiation must be declared within the template's namespace.
  Switch all targets to clang/C++11.
2014-04-15 19:15:51 +00:00
Landon Fuller 4109da9dfb Merge branch 'bugfix/PLCR-539-fix-simulator-libc-dependency-in' 2014-04-15 13:12:26 -04:00
Landon Fuller dfc7a56f4b Merge branch 'bugfix/PLCR-539-fix-simulator-libc-dependency-in' into release/plcrashreporter-1.2 2014-04-15 13:12:07 -04:00
Landon Fuller d1979b1052 Work-around for rdar://16620815: iPhoneSimulator.platform ignores Xcode "Enable (C++|Objective-C) Exceptions" flags.
We rely on -fno-exceptions to avoid creating runtime link dependencies
on the C++ stdlib in our static library targets.

When building against the Simulator platform SDK, however, the
"Enable C++ Exceptions" project setting is ignored, breaking linking
of our static libraries in applications that do not not already
link libc++.

This is caused by broken compiler flag configurations in Xcode's
iPhoneSimulator.platform compiler specs; the compiler specs refer to a
legacy "GCC_ENABLE_EXCEPTIONS" flag that is no longer set by Xcode.

To work around this, we add "GCC_ENABLE_EXCEPTIONS" as a user-defined
build setting for the Simulator static library target, with a value
of NO. This hack should be removed once we stop supporting Xcode
releases with a broken Native Build System.xcspec; if the configuration
is not removed, however, it will likely operate as a no-op.

On the remote chance that the configuration does negatively impact the
build in a future Xcode release, it will only affect the simulator
targets.

Issue: PLCR-538
2014-04-15 13:08:35 -04:00
Landon Fuller 2b3b33a4d3 C++11 fix: Add explicit static casts for cases where were relying on implicit conversion to a narrower/signed/unsigned integral type.
Issue: PLCR-538
2014-04-14 15:26:11 -04:00
Landon Fuller 9d3d77b35d C++11 fix: Avoid casting the SIG_* function-types to (in theory) constant uintptr_t values.
Clang complains about the use of SIG_DFL/SIG_IGN in a switch case; while
they are implemented as integer constants cast to function pointers,

Our casting them back for use in a switch() statement is not strictly
well-defined, so I've switched them to the more correct if () statements.

Issue: PLCR-538
2014-04-14 15:21:21 -04:00
Landon Fuller 427c3ed30d C++11 fix: An explicit instantiation must be declared within the template's namespace.
Issue: PLCR-538
2014-04-14 15:16:40 -04:00
Landon Fuller df7bff0e7b Switch all targets to clang/C++11.
Issue: PLCR-538
2014-04-14 15:11:43 -04:00
Landon Fuller 791507d84c Merge branch 'release/plcrashreporter-1.2' 2014-04-14 10:43:28 -04:00
Landon Fuller 764fd1ed22 Merge branch 'bugfix/PLCR-532-utf-8-process-names-truncated' 2014-04-11 10:50:35 -04:00
Landon Fuller e5de162365 Merge branch 'bugfix/PLCR-532-utf-8-process-names-truncated' into release/plcrashreporter-1.2 2014-04-11 10:50:20 -04:00
Landon Fuller 490ef0b3d3 Use the PLCrashProcessInfo API for fetching and validating process data from the crash report.
This allows us to use a common code path for fetching the process info,
rather than having a test-only code path that does not safely handle
UTF-8.

If we change the unit test's product name (as per the PLCR-532
reproduction case) to UTF-8 that triggers the multibyte sequence
truncation bug, this change allows the PLCrashLogWriterTests to complete
successfully.

Issue: PLCR-532
2014-04-11 10:38:10 -04:00
Landon Fuller a0e829dee3 Fix test build for iOS / iOS Simulator.
The mmap() header was implicitly available on Mac OS X; it must be
explicit included when building against the iOS SDK.

Issue: PLCR-532
2014-04-11 10:37:43 -04:00
Landon Fuller 6ee40769ca Bump the version to 1.2-rc5 in preparation for the next RC release.
Issue: PLCR-537
2014-04-11 10:03:01 -04:00
Landon Fuller f829718a44 Merge remote-tracking branch 'origin/release/plcrashreporter-1.2' 2014-04-10 19:45:28 -04:00
Landon Fuller 337f7641a2 Merge pull request #3 in PLCR/plcrashreporter from bugfix/PLCR-532-utf-8-process-names-truncated to release/plcrashreporter-1.2
* commit 'ecd405532bd12b814339fc9f76b7116fac50e981':
  Clarify the comment describing termination within an invalid sequence.
  Use strlen() directly.
  Additional tests and and memory over-read validation.
  Remove unnecessary macro argument in LEN_UTF8() macro.
  Add missing nil checks for process name values.
  Document that the process name values may be nil.
  Log the target pid when fetching the process name fails.
  Use the new UTF-8 multibyte truncation handling to clean up p_comm values.
  Implement API for trimming incomplete UTF-8 multibyte sequences from a truncated UTF-8 string.
  Stub out an API for determining the length, in bytes, of the valid UTF-8 sequences in a string.
2014-04-10 23:42:34 +00:00
Landon Fuller ecd405532b Clarify the comment describing termination within an invalid sequence.
Issue: PLCR-532
2014-04-10 16:28:33 -04:00
Landon Fuller edaaba2816 Use strlen() directly.
Since this code path is not declared async-safe, there's no need to implement
our own inline strlen.

Issue: PLCR-532
2014-04-10 16:25:43 -04:00
Landon Fuller 99525dc9cc Additional tests and and memory over-read validation.
This adds a few improvements recommended by Mike Ash:

- Tests for 0-length strings, as well as strings that start with
  invalid byte sequences.
- A minor rework of the tests to lay out the test string bytes at the
  end of a page, directly before a PROT_NONE page. This allows us to use
  page protections to assert that over-read does not occur.

Issue: PLCR-532
2014-04-10 16:18:06 -04:00
Landon Fuller 48fd1e63e9 Remove unnecessary macro argument in LEN_UTF8() macro.
This is a non-functional change.

Issue: PLCR-532
2014-04-10 08:35:31 -04:00
Landon Fuller dc02169583 Add missing nil checks for process name values.
This ensures that the inability to fetch or decode the process name (eg,
due to use of invalid UTF-8) won't trigger a crash at crash reporter
initialization time.

Ideally, this code would be unit tested, but that will require
significant changes to the PLCrashLogWriter; in the interests of
regression avoidance, we'll revisit larger-scale API changes as part of
the general refactoring of this code scheduled for the next major
update.

Issue: PLCR-532
2014-04-09 13:12:58 -04:00
Landon Fuller 6640486d94 Document that the process name values may be nil.
Issue: PLCR-532
2014-04-09 13:12:38 -04:00
Landon Fuller 6f5c3b08c9 Log the target pid when fetching the process name fails.
Issue: PLCR-532
2014-04-09 13:03:02 -04:00
Landon Fuller a4e80ae7ea Use the new UTF-8 multibyte truncation handling to clean up p_comm values.
Issue: PLCR-532
2014-04-08 18:17:10 -04:00
Landon Fuller 2025d32d28 Implement API for trimming incomplete UTF-8 multibyte sequences from a truncated UTF-8 string.
Issue: PLCR-532
2014-04-08 18:02:43 -04:00
Landon Fuller d5a6398983 Stub out an API for determining the length, in bytes, of the valid UTF-8 sequences in a string.
Issue: PLCR-532
2014-04-07 16:23:09 -04:00
Landon Fuller 1795971111 Merge branch 'release/plcrashreporter-1.2' 2014-02-18 12:33:48 -05:00
Landon Fuller e1f3f6f0b8 Update version for 1.2-rc4 release.
Issue: PLCR-531
2014-02-18 11:38:06 -05:00