SA_EXPOSE_TAGBITS is a Linux >= 5.11 feature that allows si_addr to
contain the upper tag bits. This is a feature that allows signal
handlers to see the full upper address bits on aarch64, which consist of
TBI and MTE nibbles. For MTE, preserving these bits is of significant
importance, as it allows for precise use-after-free and buffer-overflow
diagnosis that's impossible without seeing these bits in the fault
address.
We unconditionally enable this feature on all kernels, as it's ignored
when unsupported (even on older kernels).
Tested on:
1. Linux x86 host, which is a no-op.
2. Android device with Linux 4.14, which is a no-op.
3. Android device with Linux 5.15, which passes. For posterity, my
config was:
| $ gn args out_arm64
| target_os = "android"
| android_ndk_root = "~/Android.sdk/ndk/21.4.7075529"
| android_api_level = 26
| target_cpu = "arm64"
| # NDK builds push libc++_shared.so, which is not present on newer Android
| # versions, so I hacked the runner to push the file. Maybe this should be
| # upstreamed at some point as well.
| $ git diff
| diff --git a/build/run_tests.py b/build/run_tests.py
| index 8ad19e34..64269c90 100755
| --- a/build/run_tests.py
| +++ b/build/run_tests.py
| @@ -273,7 +273,8 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
| _adb_shell(adb_mkdir_command)
|
| # Push the test binary and any other build output to the device.
| - local_test_build_artifacts = []
| + local_test_build_artifacts = [
| + '~/Android.sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so']
| for artifact in test_build_artifacts:
| local_test_build_artifacts.append(os.path.join(
| binary_dir, artifact))
| @@ -294,6 +295,7 @@ def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
| # The list of TERM values comes from Google Test’s
| # googletest/src/gtest.cc testing::internal::ShouldUseColor().
| env = {'CRASHPAD_TEST_DATA_ROOT': device_temp_dir}
| + env = {'LD_LIBRARY_PATH': device_out_dir}
| gtest_color = os.environ.get('GTEST_COLOR')
| if gtest_color in ('auto', None):
| if (sys.stdout.isatty() and
| $ ninja -C out_arm64 && python build/run_tests.py out_arm64/ \
| --gtest_filter=*StartHandlerForSelfTestSuite*
Change-Id: I293b36fcd08ffaca593dae8042299a39756defa0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4024204
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mitch Phillips <mitchp@google.com>
sed -i '' -E -e 's/Copyright (.+) The Crashpad Authors\. All rights reserved\.$/Copyright \1 The Crashpad Authors/' $(git grep -El 'Copyright (.+) The Crashpad Authors\. All rights reserved\.$')
Bug: chromium:1098010
Change-Id: I8d6138469ddbe3d281a5d83f64cf918ec2491611
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3878262
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
The minidump stream type MINIDUMP_THREAD_NAME_LIST represents
thread names as a list in the form [(thread_id, thread name), ...].
This introduces a new MinidumpThreadNameListWriter class which
allows OS-specific snapshot writers to write thread names using
this new stream type.
Bug: crashpad:327
Change-Id: Ief45df5dbbf44c0e1254786bfbe6720112ceef38
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3671775
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Newer minidump stream types, like MINIDUMP_THREAD_NAME_LIST, use
64-bit RVAs (which have 64-bit location descriptors) instead of 32-bit
RVAs and location descriptors.
This adds support to MinidumpWritable for the new 64-bit RVA64 and
MINIDUMP_LOCATION_DESCRIPTOR64 types.
Bug: crashpad:327
Change-Id: Icd67bca600756a68ef9ba7d5a429f935eebf726f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3673776
Commit-Queue: Ben Hamilton <benhamilton@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Adds new structures and offsets for minidump extended contexts. This
information will be captured from threads in a later CL so this CL
does not yet write different dumps, except in testing.
Minidump format for extended compacted contexts has been determined by
experiment. Offsets for where to write various parts of the context
are hardcoded to 0x550 as this matches values seen in Windows. Offsets
for misc_info_5 match those seen in working minidumps that can be opened
in windbg. Our hope is that while these could change in future, CPU
and OS vendors are unlikely to change them.
See doc[0] for a discussion of these fields and offsets in the minidump.
See "MANAGING STATE USING THE XSAVE FEATURE SET" Chapter 13 in the
Intel SDM[1]. Many of the offsets and sizes of the extended features
are provided by cpu specific values. We can access these in Windows
using the SDK, and transfer these to the saved extended context
which in turn is understandable by windbg.
Further information is available from AMD Ch. 18 "Shadow Stacks"[2].
[0] https://docs.google.com/document/d/1Dn8n97r5B7kxYouvujNnPIYd_7QeVHpahSRmB92Qn6g/edit#heading=h.hivqj2jg39y
[1] https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4.html.
[2] https://www.amd.com/system/files/TechDocs/24593.pdf
Bug: 1250098
Change-Id: Ia9041acc379c6d38329ee99737a2a0a77f7a1ee0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3536964
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
The size of dyld_all_image_infos didn't change, but the last 128 bit
of `reserved` moved out of `reserved` and got names.
On 64-bit, that's straightforward -- just move two uint64s out of the
array into fields.
On 32-bit, it's fairly awkward: It's 4 of the uintptr_t `reserved`
array, which means `UIntPtr, reserved, [4]` would have to diverge
between 32-bit and 64-bit, and also shared_cache_fs_obj_id would
straddle the `end_v14` boundary. Since macOS 12.0 doesn't support
32-bit builds, just punt on this for 32-bit. (This might possibly
mean that crashpad-on-apple-watch might not compile, but that's
a build configuration that doesn't exist.)
See comment 9 and 6 on the bug.
Bug: crashpad:375, chromium:1265179
Change-Id: I221af20c59c30a8176d5685d3f5e84aaf3de9afe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3253742
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Message-Id: Merged from chromium 83a01b8e2cd2d4d96b0e298d012bb3a2bd93c64f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3293642
Commit-Queue: Robert Sesek <rsesek@chromium.org>
This will accommodate moving third_party/mini_chromium around.
The default location is unchanged for now.
There are GN variables that may need to be updated when Fuchsia's source
re-organizes its layout:
* mini_chromium_source_parent : this contains a BUILD.gn with groups and
encloses the mini_chromium_source_root. This is controlled by the
structure of the project that depends on this project.
* _mini_chromium_source_root : this is what is normally checked out from
git, the upstream source directory
* mini_chromium_import_root : points inside source_root to make GN files
accessible.
This first step breaks out case logic for "if (crashpad_is_in_fuchsia)"
even if the value is unchanged for now. This will faciliate a smaller
change when Fuchsia re-structures third_party sources.
Change-Id: I09e5362f4be8fdb440e3891422881b1053052341
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3062424
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Standalone Crashpad for Android can now be built with gn.
Change-Id: I0ee7f8e1af8c2bc0edb88e93b345abd7d739f33c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3034984
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This change removes usages of the base::char16 and base::string16 type
aliases in favor of using char16_t and std::u16string directly.
Bug: chromium:1184339
Change-Id: Ieb790cbe2ce98d91865cd21d98616195a57b3903
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2742482
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
It looks like this was planned for future changes that haven't happened
yet. Current users of the .def files explicitly reference them, so
compat currently doesn't require this dependency.
Bug: fuchsia:66116
Change-Id: I85404d17eac4a2aa3c2157fe3fc2a1421879996a
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2640725
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Because of the multiple-worlds building of the Crashpad code in the
Fuchsia tree (with the Fuchsia BUILDCONFIG.gn in particular) there's no
good location to globally disable Wconversion for all of crashpad.
This can be somewhat-improved by using a GN template
crashpad_static_library() similar to the existing crashpad_executable()
template.
Includes mini_chromium DEPS roll:
68da43e Fix a couple trucation warnings
88ce866 build: set include dirs
Bug: fuchsia:58162
Change-Id: I638fcf858c35b9a858ca2c410636f8c99603aed2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2411131
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
CFI attempts to verify that the dynamic type of a function object
matches the static type of the function pointer used to call it.
https://clang.llvm.org/docs/ControlFlowIntegrity.html#indirect-function-call-checking
However, the analyzer does not have enough information to check
cross-dso calls. In these instances, CFI crashes upon calling the
function with an error like:
pthread_create_linux.cc:60:16: runtime error:
control flow integrity check for type
'int (unsigned long *, const pthread_attr_t *, void *(*)(void *), void *)'
failed during indirect function call
(/lib/x86_64-linux-gnu/libpthread.so.0+0x9200):
note: (unknown) defined here pthread_create_linux.cc:60:16:
note: check failed in crashpad_handler,
destination function located in /lib/x86_64-linux-gnu/libpthread.so.0
Change-Id: Ib29dabfe714f2ee9cc06a5d17e6899ff81a06df4
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2339332
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
The macOS 11.0 SDK, as of Xcode 12b6 12A8189n, has not updated
<AvailabilityMacros.h> with a MAC_OS_X_VERSION_11_0 or
MAC_OS_X_VERSION_10_16 constant. However, the <Availability.h> interface
has been updated to provide both __MAC_11_0 and __MAC_10_16.
<AvailabilityMacros.h>’s MAC_OS_X_VERSION_MAX_ALLOWED, which is supposed
to identify the SDK version, is broken in the 11.0 SDK in that whenever
the deployment target is set to 10.15 or earlier, the SDK will be
mis-identified through this interface as 10.15. When using the
<Availability.h> equivalent, __MAC_OS_X_VERSION_MAX_ALLOWED, the 11.0
SDK is identified as 10.16 (arguably it should be internally versioned
as 11.0, but at least this interface allows it to be detected
unambiguously.) It’s clear that the <AvailabilityMacros.h> interface
provides no meaningful support for the macOS 11.0 SDK at all, but
<Availability.h> does.
<Availability.h> was introduced in the Mac OS X 10.5 SDK, so there is no
relevant SDK version compatibility problem with this interface.
Key differences between these interfaces for the purposes used by
Crashpad:
- <AvailabilityMacros.h> → <Availability.h>
- MAC_OS_X_VERSION_MIN_REQUIRED (DT) → __MAC_OS_X_VERSION_MIN_REQUIRED
- MAC_OS_X_VERSION_MAX_ALLOWED (SDK) → __MAC_OS_X_VERSION_MAX_ALLOWED
- MAC_OS_X_VERSION_x_y → __MAC_x_y
- <Availability.h> __MAC_OS_X_VERSION_* SDK/DT macros are only
available when targeting macOS, while <AvailabilityMacros.h>
MAC_OS_X_VERSION_* SDK/DT macros are available on all Apple platforms,
which may be a source of confusion. (<Availability.h> __MAC_* macros
do remain available on all Apple platforms.)
This change was made mostly mechanically by:
sed -i '' -Ee 's/<AvailabilityMacros.h>/<Availability.h>/g' \
$(git grep -E -l '<AvailabilityMacros.h>' |
grep -v AvailabilityMacros.h)
sed -i '' -Ee 's/(MAC_OS_X_VERSION_(MIN_REQUIRED|MAX_ALLOWED))/__\1/g' \
$(git grep -E -l 'MAC_OS_X_VERSION_(MIN_REQUIRED|MAX_ALLOWED)' |
grep -v AvailabilityMacros.h)
sed -i '' -Ee 's/(MAC_OS_X_VERSION_(10_[0-9]+))/__MAC_\2/g' \
$(git grep -E -l 'MAC_OS_X_VERSION_(10_[0-9]+)' |
grep -v AvailabilityMacros.h)
Bug: crashpad:347
Change-Id: Ibdcd7a6215a82f7060b7b67d98691f88454085fc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2382421
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
On Android, the compat library built compat/android/sys/mman.cc, which
provides a fallback for mmap, and compat/linux/sys/mman.cc, which
provides a fallback for memfd_create. This can result in two object
files colliding in the library, which is flagged as a “gn analyze”
error:
> ERROR at //crashpad/compat/BUILD.gn:62:5: Duplicate object file
> static_library(target_name) {
> ^----------------------------
> The target //crashpad/compat:compat
> generates two object files with the same name:
> obj/crashpad/compat/compat/mman.o
>
> It could be you accidentally have a file listed twice in the
> sources. Or, depending on how your toolchain maps sources to
> object files, two source files with the same name in different
> directories could map to the same object file.
>
> In the latter case, either rename one of the files or move one of
> the sources to a separate source_set to avoid them both being in
> the same target.
The files are renamed to avoid this collision. The associated headers
cannot be renamed because they need to shadow the SDK’s copies. There is
no “gn analyze” conflict reported for headers with the same name.
Change-Id: Ia49ef5ff8375673395597e96555f72f7c69e3564
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2285965
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Chromium relies on a global gn sources assignment filter, even though
it’s kind of discouraged. Crashpad doesn’t use this, instead selecting
which files to build entirely with the logic in its .gn files. In some
cases, Chromium’s filters prevent _linux files from building on Android,
and _mac files from building on iOS, even though Crashpad’s build has
explicitly requested these inclusions. To overcome this problem,
clear the gn sources_assignment_filter in all of Crashpad’s own .gn
files when building in Chromium.
Change-Id: Iab0af29f4e5aff4be8eec2ee12b2e3f991c0a86d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2285959
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
This updates the way that the .defs files added in 1bfd7d06ed60 are
treated, by putting them in compat/ios, using compat as intended. The
.defs files in compat forward, via #include, to the ones in
third_party/xnu. Additionally, compat/mac is enabled for iOS, as
everything in compat/mac is sensible on iOS, and will have no effect
when rendered unnecessary by the iOS SDK.
This also changes util:mig_output to a static_library instead of a
source_set. I don’t think there was any reason for it to have been a
source_set to begin with. static_library is preferred for nearly
everything.
Bug: crashpad:31
Change-Id: I7c468d6d6785bf2bc825d45831ebb81e1c9ddfbc
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2160310
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
First steps at bringing up the crashpad_client on iOS. Also updates
the XCUITest to trigger various crashes, with some swizzling
necessary to allow crashes.
Change-Id: I87dd36bed1c052b509d14bfa29679ed81e58a377
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2039470
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
macOS 10.15 (“Catalina”) introduces a single new field to its
dyld_all_image_infos structure, and uses structure version 16.
macOS 10.13 and 10.14 were documented in <mach-o/dyld_images.h> as using
structure version 16, but they actually use version 15. They should have
used version 16, as they do use a structure expanded from macOS 10.12,
which also uses version 15. Previously, process_types was true to the
documentation, but now that this is known to be incorrect, it’s been
revised to reflect reality. Because two variants of the version 15
structure exist, run-time OS version detection is used to disambiguate.
Bug: crashpad:310
Test: crashpad_snapshot_test ProcessTypes.DyldImagesSelf (10.15 SDK)
Change-Id: Ibc82b6a73809949f4bbf416ece7aa955b627c573
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1852109
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
NDK r20 provides a declaration of android_get_device_api_level() at API level
29, and an inline definition at older API levels. The latter conflicts with
crashpad's definition, so stop defining it if the NDK is new enough.
Bug: chromium:891999
Change-Id: If58542c9d6b5315f823f2509f168f2cb79141e3f
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1739512
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
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>
A uint8_t won't be bit-extended, zero-ing all the upper bits of value.
Change-Id: Iae41eeb4a014de5ed47ad599081959250a7bbe9c
Reviewed-on: https://chromium-review.googlesource.com/c/1405691
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Add MemoryMap::Iterator to support different strategies for locating
the start of module mappings on Android and Linux.
Beginning with API 21, Bionic provides android_dlopen_ext() which
allows passing a file descriptor with an existing relro segment to the
loader. This means that the mapping containing the dynamic segment
could have a name, device, and inode which are different than the
other mappings for the module.
The revised strategy for Android at API 21+ is to search all mappings
in reverse order from they dynamic array mapping until a module is
parsed with the expected dynamic array address.
Linux and Android 20- continue to select mappings using the device,
inode, and file offsets of the mappings.
Bug: crashpad:268
Change-Id: I30e95e51cb6874c00875d2a9c57f1249877736d4
Reviewed-on: https://chromium-review.googlesource.com/c/1374375
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
PTRACE_GET_THREAD_AREA is only removed from the newer version of glibc (>=2.28)
for aarch64. Since ChromeOS uses 2.23 version of glibc currently,
so it should be handled in crashpad to avoid the redefinition.
BUG=chromium:873168
Change-Id: I8da6bc0595b814b0490b38da6f4a68e6803bb5b9
Reviewed-on: https://chromium-review.googlesource.com/1188309
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
__aarch64__ should always be defined for 64-bit ARM, while __arm64__
only sometimes is.
Change-Id: I46a6469d8f5e74ad79b6ded51a809fbf88e5170a
Reviewed-on: https://chromium-review.googlesource.com/1151541
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
The pre-processor attempts to parse an entire expression before
evaluating sub-expressions, so undefined macros result in a syntax
error.
Change-Id: Ie950867897a1befd221bdbe4719f2365f5cc75ee
Reviewed-on: https://chromium-review.googlesource.com/1132328
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
On Linux and macOS, compat.gyp:crashpad_compat is a header-only target,
which should be declared type=none.
This CL also adds the missing non_mac/ include_dirs for non-macOS
targets.
Bug: crashpad:
Change-Id: I7bef32e8f6bdcb86f51118a1bb1d3b52d05120d1
Reviewed-on: https://chromium-review.googlesource.com/1124773
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This is a followup to [1] which fixed the x86 build for glibc 2.27. But there
was a similar block of code that was only present on arm, which was causing the
arm build to fail. This CL makes the equivalent change to [1].
[1] 3a20d34ac3
BUG=chromium:843240
R=mark@chromium.org
Change-Id: I4b2786ddcdd0d9920aca25b3ad00c5ba716ca30a
Reviewed-on: https://chromium-review.googlesource.com/1060155
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Glibc now defines PTRACE_GET_THREAD_AREA as an enum value. Trying to define our
own will result in an error:
../../third_party/crashpad/crashpad/compat/linux/sys/ptrace.h:25:35: error: redefinition of 'PTRACE_GET_THREAD_AREA' as different kind of symbol
static constexpr __ptrace_request PTRACE_GET_THREAD_AREA =
^
../../build/linux/debian_sid_amd64-sysroot/usr/include/x86_64-linux-gnu/sys/ptrace.h:110:3: note: previous definition is here
PTRACE_GET_THREAD_AREA = 25,
However, glibc also defines a new macro for the corresponding value, so it's
possible to detect this case:
----- ptrace.h -----
/* Get a TLS entry in the GDT. */
PTRACE_GET_THREAD_AREA = 25,
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
----- ptrace.h -----
This CL prevents defining our own PTRACE_GET_THREAD_AREA when PT_GET_THREAD_AREA
is defined.
Bug: None
Change-Id: Idf931e54dadd57788f04da47f12f0f0588a255cc
Reviewed-on: https://chromium-review.googlesource.com/999161
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
user_vfp is not declared anymore in sys/user.h, but in specific
internal kernel asm user.h in GLIBC. So building crashpad on ARMEL
with such a GLIBC will fail to build.
Also, sys/ptrace.h will not include the declarations for
PTRACE_GET_THREAD_AREA and PTRACE_GETVFPREG in arm (they are in
asm/ptrace.h and not included from sys/ptrace.h). So provide
compatibility declarations accordingly for arm architecture.
Change-Id: I58ab5274a66d84c0cbc9e9e9b23e0abc37bf67e5
Reviewed-on: https://chromium-review.googlesource.com/996073
Reviewed-by: Mark Mentovai <mark@chromium.org>
`dlsym` on Android KitKat (4.4.*) raises SIGFPE when searching for
non-existent symbols. This wrapper installs a signal handler prior to
calling `dlsym`.
Bug: crashpad:30
Change-Id: Iee94672d3c11b1fad1b01526eea7df688c0356cb
Reviewed-on: https://chromium-review.googlesource.com/835411
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
With a companion mini_chromium change at https://crrev.com/c/841203,
it’s possible to configure via “gn args” as follows:
android_ndk = "/android/android-ndk-r16"
target_cpu = "x86_64"
target_os = "android"
Note that a standalone toolchain is not required.
Bug: crashpad:30, crashpad:79
Change-Id: Ica55bdcb82c730909c05dd9fecb40a74eca78c8a
Reviewed-on: https://chromium-review.googlesource.com/841286
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>