Commit Graph

30208 Commits

Author SHA1 Message Date
Christopher Ferris 9e484bdb4a Fix another set of bugs.
- The pc read from the eh frame binary table of pc/fde offset is off by 4.
  I verified that on arm/arm64/x86/x86_64 the pc in this table matches
  the fde pc_start value. I did this by adding an error if this occurred
  and ran unwind_info over everything in system/lib, system/lib64, system/bin.
- Fixed unit tests for the above change.
- Fix a small bug in the processing encoded values. The high
  bit of the encoding should be masked off, but I wasn't doing that. That
  meant during processing of the fde, I was incorrectly returning
  an error because the encoded value was unknown.
- Added a new test for this encoding change.

Bug: 23762183

Test: Build and all unit tests pass. Also, see above comments.
Change-Id: If074a410a1726392274cd72c64470ca0be48e0db
2017-08-10 17:37:32 -07:00
Treehugger Robot 5d89e6c7fe Merge "Include asan options from data partition." 2017-08-10 01:05:44 +00:00
Christopher Ferris 5cd87d39d7 Merge "Small clean ups" 2017-08-09 23:22:22 +00:00
Mark Salyzyn ad7f1bc0b3 Merge "logcat: transition to Android.bp" 2017-08-09 23:18:00 +00:00
Ryan Campbell ce30d07b11 Include asan options from data partition.
Look for asan options under /data/asan so that multi-process coverage
can be enabled on a newly-started remote process without disabling
verity and without forcing it to be always-on.

Test: adb shell echo "include_if_exists=/data/asan/asan.options.%b" >>
/system/asan.options && adb shell echo
"coverage=1\ncoverage_dir=/data/misc/trace" >
/data/asan/asan.options.android.hardware.light@2.0-service && adb shell killall
android.hardware.light@2.0-service
Bug: 64019182

Change-Id: I241ad8478439323681dc1cfde2fa0770f030ae75
2017-08-09 15:32:23 -07:00
Christopher Ferris 3b4b075fea Small clean ups
- Remove redundant map_info checks.
- Initialize fde_count_ to zero.

Bug: 23762183

Contributed-By: Ivan Maidanski <i.maidanski@samsung.com>

Test: Builds, run backtrace_test modifying CreateNew to Create and vice-versa.
Change-Id: I6e9cdfa99734f8cc2d9915cc32c66a1455e79f1b
2017-08-09 14:22:12 -07:00
Mark Salyzyn 507f69f80e logcat: transition to Android.bp
Switch logcat, logcatd and liblogcat to use Android.bp.

Test: compile
Change-Id: I01c0d8cbc6a713ad5b4b413677574e3c6463afcb
2017-08-09 13:30:03 -07:00
Treehugger Robot 2d1d8812cc Merge "logcat: fix error propagation." 2017-08-09 00:45:20 +00:00
Mark Salyzyn 210e43c354 logcat: fix error propagation.
Fix some _serious_ error propagation issues discovered with
additional warning flags (-Wextra).

Test: compile
Change-Id: I5148550092e4ecb6cafba91229c350c516e7e244
2017-08-08 15:49:21 -07:00
Tom Cherry 2c3a2a8c5c Merge "ueventd: add test to ensure selabel_lookup() is thread safe" 2017-08-08 22:00:26 +00:00
Tom Cherry 57ef66b6fa ueventd: add test to ensure selabel_lookup() is thread safe
selabel_lookup() must be threadsafe, but had failed in the past.

Bug: 63861738
Test: this newly added test
Change-Id: I78bdb8e555433e8217ac6d4be112ba91de9f03bb
2017-08-08 13:11:44 -07:00
Treehugger Robot 24c39f0b4c Merge "fastboot: Add --disable-verity and --disable-verification options." 2017-08-08 20:01:16 +00:00
Treehugger Robot f602dd4ced Merge "Add AID for LoWPAN subsystem" 2017-08-07 23:50:02 +00:00
David Zeuthen b6ea435a20 fastboot: Add --disable-verity and --disable-verification options.
This can be used to disable verity and/or verification when flashing a
build to a device. It works with both 'fastboot flashall' and
'fastboot flash vbmeta /path/to/vbmeta.img'.

Bug: 62903976
Test: Manually tested.
Change-Id: Iad22d42a9dd5befd70ecd0224803721a10a28d90
2017-08-07 16:52:55 -04:00
Robert Quattlebaum 01f7576a3e Add AID for LoWPAN subsystem
Bug: b/64399805
Change-Id: Ida6aa60d8beee9151a723826d99c1e9044dc05be
2017-08-04 16:19:34 -07:00
Chih-hung Hsieh 69ff5009c7 Merge "Fix clang-tidy performance warnings in system/core." 2017-08-04 21:05:51 +00:00
Tom Cherry 401c9cb330 Merge "init: more unique_fd, less goto" 2017-08-04 20:13:10 +00:00
Tom Cherry 7c4609cfb3 init: more unique_fd, less goto
Test: boot bullhead
Change-Id: I3c31ca045538d9c9dbbf9c8f27f63033344627fd
2017-08-04 20:12:56 +00:00
Treehugger Robot 59b33cb01c Merge "libcutils: write trace event into socket in container" 2017-08-04 00:50:59 +00:00
Treehugger Robot 90657bbeab Merge "Return correct error code when finish input length is too long." 2017-08-03 23:35:05 +00:00
Jocelyn Bohr f1e5edf765 Return correct error code when finish input length is too long.
Bug: 63745895
Change-Id: I465bf9138a0a21363f89f2c6074f7108ee33af70
2017-08-03 13:59:10 -07:00
Chih-Hung Hsieh e5d975c7cc Fix clang-tidy performance warnings in system/core.
* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.

Bug: 30407689
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: Ia5a00581e718d412255d6177e5a7c286cdfbec11
2017-08-03 13:58:05 -07:00
Christopher Ferris 172b1d0008 Merge "Add support for the new unwind method." 2017-08-03 19:08:34 +00:00
Yifan Hong 472808a570 Merge changes from topic 'libcutils_private_headers'
* changes:
  Remove private headers from libcutils.vendor
  Move android_filesystem_config.h => fs_config.h
2017-08-03 18:24:04 +00:00
Christopher Ferris 6f3981c181 Add support for the new unwind method.
Also add a comment to the GetElf function to indicate that it never returns
nullptr.

Also needed to add this library to the a million and one places that the vndk
has hard-coded this data.

Bug: 23762183

Test: Built, nothing uses the new code.
Test: However, I did run backtrace_test using this code, and all tests pass.
Change-Id: Ib270665dcb7a7607075e36d88be76dbde6e2faa8
(cherry picked from commit dc4104b720)
2017-08-03 10:15:44 -07:00
Earl Ou e4030384c4 libcutils: write trace event into socket in container
When Android is running in a container, ftrace trace_marker may be
disabled, e.g. Chrome OS verified mode. To enable trace, a socket is
created for everyone to send trace event.

Modify libcutils so apps using it can write trace to the socket.

To achieve this goal without touching code for normal device,
trace-container.c is created for code specific to container. Shared
code between trace-dev.c and trace-container.c is moved to local
trace-dev.h.

Note that to avoid sharing FDs across different processes, Zygote closes
FD and reopen it to /dev/null if it is a socket. Therefore, we need to
manually close FD and reopen it again after forking. This is done in
the atrace_set_tracing_enabled as Zygote also use it to clear flags
during forking.

Related change:
- http://crrev.com/2400163003 (Chromium)
- http://ag/2028075 (Android system/core)
- http://ag/1738271 (Android device/google/cheets2)

Bug: 29776474, 62410809
Test: run chrome://tracing and see data from the host side.
Change-Id: I3fe969e284b972c28e4f32f23cd948aaea61a043
2017-08-03 15:16:44 +08:00
Treehugger Robot 5c655991f5 Merge "cutils: update property_get to use diagnose_if." 2017-08-03 02:15:54 +00:00
Treehugger Robot e61e2fcf21 Merge "Stop asking for old versions of C++ in system/core." 2017-08-03 02:14:45 +00:00
Treehugger Robot b31ca1a64f Merge "Fix reference to out of scope local in adb_thread_setname." 2017-08-02 23:57:57 +00:00
Yifan Hong b6807125df Remove private headers from libcutils.vendor
Bug: 63135587
Test: m -j
Test: BOARD_VNDK_VERSION=current m -j
Test: mma -j
Test: BOARD_VNDK_VERSION=current mma -j

Change-Id: I9eecf23c4c311bd8336a5bfaaeb2afb3b51c6513
Merged-In: I9eecf23c4c311bd8336a5bfaaeb2afb3b51c6513
2017-08-02 16:40:36 -07:00
Yifan Hong 09c89672b6 Move android_filesystem_config.h => fs_config.h
The non AID_ things in android_filesystem_config.h are moved
to fs_config.h. For libcutils.vendor and libcutils_headers.vendor,
fs_config.h is not exported.

An empty system/core/include/private/fs_config.h is placed to
appease the dependency from certain modules (logd, etc.)
that includes system/core/include/private/android_filesystem_config.h
directly.

Test: m -j
Test: BOARD_VNDK_VERSION=current m -j
Bug: 63135587
Change-Id: I95dfb874a426941022b100c0ca26a0576b0f4aa3
Merged-In: I95dfb874a426941022b100c0ca26a0576b0f4aa3
2017-08-02 16:31:19 -07:00
Josh Gao b5c90e9d6b Merge "Revert "base: work around thread safety analysis bug."" 2017-08-02 23:10:42 +00:00
Josh Gao c54e3dba8d Revert "base: work around thread safety analysis bug."
This reverts commit e4509da961.

Reason for revert: probably breaks checkbuild?

Change-Id: I04a6284dee82761c90fa355da0472855a228b849
2017-08-02 23:10:26 +00:00
Josh Gao f3c7f10abd Merge "base: work around thread safety analysis bug." 2017-08-02 23:09:07 +00:00
Treehugger Robot f914029057 Merge "Make sure freeaddrinfo is always called on failure." 2017-08-02 23:00:23 +00:00
George Burgess IV 9bf11c1d05 cutils: update property_get to use diagnose_if.
This lets us redeclare property_get with diagnose_if tagged on it,
so we no longer need to deal with overloads.

Bug: 12231437
Test: m checkbuild on bullhead aosp-master.
Change-Id: Ic55dcfeaa314f83d3713aabac7852cb766330fc8
2017-08-02 15:59:19 -07:00
Treehugger Robot ac8a484646 Merge "libappfuse: use an explicit buffer size" 2017-08-02 22:57:27 +00:00
Josh Gao e4509da961 base: work around thread safety analysis bug.
Clang's assert_capability and assert_shared_capability annotations are
nonfunctional until https://reviews.llvm.org/rL309725 is relanded and
makes its way into our toolchain. Work around this by using the
equivalent assert_lock and assert_shared_lock.

Bug: http://b/64226736
Test: manual
Change-Id: I40711f162ea1d492f1e0b3eff88bf6ae6d995e2f
2017-08-02 14:44:58 -07:00
George Burgess IV 87533581be libappfuse: use an explicit buffer size
This patch makes lookup_name use an explicit buffer size, rather than
"whatever the union happens to give me." I don't know if it's the
correct size, but having a 0-length array in this sort of configuration
seems fragile, and will be a compilation error when
https://android-review.googlesource.com/#/c/platform/bionic/+/449363/
goes in.

Bug: 12231437
Test: Builds with the mentioned patch applied to Bionic
Change-Id: I5793c906b7c2417e9a58aa907ef11c282027edb2
2017-08-02 14:11:25 -07:00
Elliott Hughes 972d078b3e Stop asking for old versions of C++ in system/core.
Bug: http://b/32019064
Test: builds
Change-Id: I1befc647b581bd293f98010e816b6413caab5e6c
2017-08-02 14:06:28 -07:00
Treehugger Robot ceb7814c86 Merge "Remove TODOs for std::string removal." 2017-08-02 20:35:45 +00:00
Elliott Hughes 7462f1858c Fix reference to out of scope local in adb_thread_setname.
Bug: https://android-review.googlesource.com/#/c/168725/5/adb/sysdeps.h@639
Test: boots, adbd thread names look sane
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: Ib3bdf53658f3903de8f0a5688f7d77745e677c77
2017-08-02 20:34:06 +00:00
Elliott Hughes 3ff453aaa0 Make sure freeaddrinfo is always called on failure.
Bug: https://android-review.googlesource.com/#/c/platform/system/core/+/268797/2/libcutils/socket_network_client_unix.c
Test: builds
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: I2d93c8359c3398769d408284f77d56e09713a7f3
2017-08-02 20:32:27 +00:00
Treehugger Robot e7b8fc22af Merge "Add comments to "public.libraries.*.txt"." 2017-08-02 19:34:26 +00:00
Christopher Ferris 7009a3ccf7 Merge "Allow mips to build." 2017-08-02 19:30:16 +00:00
Christopher Ferris 32766f1f52 Allow mips to build.
Test: Build mips.
Change-Id: Ice2fe1d11b7c628b325ea2ad1fd1252ad8e10668
2017-08-02 10:45:46 -07:00
Tom Cherry c34afb1cd5 Merge "init: use unique_fd in builtins.cpp" 2017-08-02 17:09:31 +00:00
Christopher Ferris 0d2cac9ea8 Merge "Revert "Add support for the new unwind method."" 2017-08-02 01:49:03 +00:00
Christopher Ferris bd625efbca Revert "Add support for the new unwind method."
This reverts commit 5b460d13a4.

Reason for revert: Strange sailfish boot problem.

Change-Id: Ibde9375405cca4343c262335647dac120aab4d73
2017-08-02 01:47:31 +00:00
Christopher Ferris 9ccf627e78 Merge "Add support for the new unwind method." 2017-08-01 23:22:42 +00:00