Commit graph

36333 commits

Author SHA1 Message Date
Jin Qian
525205508f Merge "fastboot: remove reference of deprecated make_ext4 code" 2017-11-03 17:28:26 +00:00
Chih-hung Hsieh
e3db2ab732 Merge "Use -Werror in system/core/libpixelflinger" 2017-11-03 06:03:20 +00:00
Treehugger Robot
2f0c95a489 Merge "Revert "delete toolbox/r.c"" 2017-11-03 04:42:27 +00:00
Tao Bao
e5ff9b988c Merge "fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'." 2017-11-03 03:27:34 +00:00
Christopher Ferris
3eccc5f50e Merge "Only skip frames for local unwinds." 2017-11-03 01:36:28 +00:00
Christopher Ferris
c56a499422 Only skip frames for local unwinds.
When doing a remote unwind, and there is a crash in the unwind stack
code or in libbacktrace, the old version would skip those frames.
This makes debugging crashes in those libraries a bit difficult.

Bug: 68820611

Test: Ran unit tests.
Test: kill -3 a zygote process and verify no frames in
Test: libunwindstack.so/libbacktrace.so.
Test: Forced a crash in libunwindstack.so and verified the tombstone
Test: contains the full crash.
Change-Id: I297e5b3775c87c0dddf57ebb423bd72ba1baf193
2017-11-02 16:22:52 -07:00
Tao Bao
67212f9083 fastboot: Don't give parsing error for unsupported 'getvar erase-block-size'.
Couldn't parse erase-block-size '0x'.
Couldn't parse logical-block-size '0x'.
mke2fs 1.43.3 (04-Sep-2016)
...

Some bootloaders explicitly return error on failed query (e.g. walleye),
while others return empty message (e.g. bullhead). We should just return
zero for empty message, instead of giving a misleading parsing error.

Test: `fastboot format userdata` on bullhead, with no parsing error.
Test: `fastboot format userdata` on walleye still works.
Change-Id: I194d41d24679929eccc65bfe895d6ab2a26315b7
2017-11-02 15:53:12 -07:00
Chih-Hung Hsieh
c7f344e9a9 Use -Werror in system/core/libpixelflinger
* Remove unused local variables.
* Suppress/fix warning of unused functions, conditionally used variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If92bc79f15a0486364da0389defbb2d43b3bd6ea
2017-11-02 15:16:18 -07:00
Jin Qian
988a51a9fe fastboot: remove reference of deprecated make_ext4 code
Bug: 64395169
Change-Id: Ida14996dc1488657e7bdeb34d6e767a8f6ed44ed
2017-11-02 15:13:46 -07:00
Connor O'Brien
6ef5c24b84 fastboot: handle small flash block sizes correctly
Erase block sizes smaller than the ext4 block size may be valid, but
can incorrectly result in a stripe width smaller than the stride
size. Instead of reporting these sizes as invalid, add a check to
enforce that raid_stripe_width >= raid_stride.

Bug: 68770797
Test: Hack fb_getvar to report small erase block size, run fastboot
-w and confirm it does not print a warning or set stripe_width smaller
than stride.
Signed-off-by: Connor O'Brien <connoro@google.com>

Change-Id: I689ce4bdd5b38bd0952bb6de54785cca39176010
2017-11-02 12:51:46 -07:00
Christopher Ferris
0d323c12df Merge "Add support for non-virtual thunk." 2017-11-02 15:31:01 +00:00
Chris Fries
4a16646c95 Revert "delete toolbox/r.c"
This utility is always useful during device bringup, so let's bring it
back for debug builds.

This reverts commit 8a475f7e4a.

Change-Id: Ic4041afe538663f1e201ee1341dee247ab0d5ba2
2017-11-02 10:03:10 -05:00
Christopher Ferris
5a72ea0f2f Add support for non-virtual thunk.
Bug: 67678053

Test: New unit tests pass.
Change-Id: If04f502e234da00a356e5ddd31acd22a6ad1a804
2017-11-01 16:24:55 -07:00
Treehugger Robot
3d879b10d8 Merge "fs_mgr: support reading fstab based on ro.boot.hardware.platform" 2017-11-01 20:46:22 +00:00
Treehugger Robot
4ef714eae0 Merge "Use -Werror in system/core" 2017-11-01 20:41:43 +00:00
Chih-Hung Hsieh
122352d983 Use -Werror in system/core
* Move -Wall -Werror from cppflags to cflags.
* Fix/suppress warning on unused variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I1e05e96a1d0bcb2ccef1ce456504b3af57167cc5
2017-11-01 11:32:55 -07:00
Chih-hung Hsieh
52013bc3d4 Merge "Use -Werror in system/core/libnativebridge" 2017-11-01 16:39:01 +00:00
Oleg Matcovschi
018d7f69da fs_mgr: support reading fstab based on ro.boot.hardware.platform
This change adds fstab.${ro.boot.hardware.platform} file into list of
searched fstab filenames.
The ${ro.boot.hardware.platform} helps consolidate init sequence based
on platform. Potentially it allows same build serve different devices.

Bug: 68663168
Change-Id: I822d5bc432e823218ebc640093cfbe5e9271d3b1
2017-11-01 09:38:21 -07:00
Christopher Ferris
15251c24b9 Merge "Move sp/pc not changing check into Unwinder." 2017-11-01 14:58:35 +00:00
Christopher Ferris
96e15c9e7d Merge "Fix template support." 2017-11-01 14:58:05 +00:00
Narayan Kamath
55c9284f55 Merge "zip_archive: Allow crc_out to be nullptr in Inflate." 2017-11-01 11:12:18 +00:00
Christopher Ferris
fda7edd13e Move sp/pc not changing check into Unwinder.
Remove this check from the DwarfSection class.

Rather than have every step function make the check, doing it at the
top level avoids having every function do the same check.

Bug: 68167269

Test: New unit tests, ran debuggerd -b on processes.
Change-Id: I23b7c799faaf26c93c1b72848df18c78de6c42fb
2017-10-31 17:51:02 -07:00
Chih-Hung Hsieh
048df230ab Use -Werror in system/core/libnativebridge
* Fix unused static variable warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I9c3a2031ac49368a1833a9d46af8174c3c9cd32e
2017-10-31 15:55:40 -07:00
Christopher Ferris
584333e3b2 Fix template support.
- Fix template applying to function name without a starting N.
- Fix return types for templates handling.
- Add support for the T substitution parameter.
- Fix a case where the literal L handler was not being set properly.

Bug: 67678053

Test: New unit tests, fuzzer.
Change-Id: I4f831038047eb2cd8519426f16aa2bdcb846d92d
2017-10-31 15:00:54 -07:00
Treehugger Robot
bb3769349d Merge "bootstat: Add another boot reason." 2017-10-31 20:02:00 +00:00
James Hawkins
8ac79bc820 bootstat: Add another boot reason.
Bug: None
Test: None
Change-Id: I865a12e9c8833c4a345284181aa1812be3eddadd
2017-10-31 10:07:34 -07:00
Treehugger Robot
411111acf4 Merge "logcat: Note in help that regexps are Perl-compatible" 2017-10-31 16:48:47 +00:00
Brendan Jackman
a5141130f3 logcat: Note in help that regexps are Perl-compatible
The expressions accepted by the '-e'/'--grep' command line option are
PCRE:

https://android.googlesource.com/platform/system/core/+/master/logcat/logcat.cpp#1018

Say so in the help string.

Change-Id: I7f6af130d5e39570bb49310a928f5d495e5b269b
2017-10-31 12:44:54 +00:00
Christopher Ferris
f0da1c42a3 Merge "Switch libbacktrace new unwinder." 2017-10-31 00:33:46 +00:00
Christopher Ferris
086baf981d Switch libbacktrace new unwinder.
Update the backtrace leak tests to share a map since this is the most
common way it will be used, and it runs much faster.

Remove the CreateNew functions, and references to them.

Remove benchmarks of CreateNew functions.

Test: Builds, ran new unit tests, ran art tests.

Change-Id: I4a25a412f1a74c6d43aebbebbf32ead20ead8f94
2017-10-30 13:37:50 -07:00
Narayan Kamath
2d1e23f5d6 zip_archive: Allow crc_out to be nullptr in Inflate.
Only compute the crc32 if required. In addition :
- Add unit tests for Inflate that cover this addition.
- Fix an inconsistency in return codes that was revealed
  by this new test.

Bug: 35246701
Test: zip_archive_tests
Test: make; zipalign.
Merged-In: I31d7554378f94fc8995f707471d57cb98311e2c2
Change-Id: I05111bfa665c610f93d1c1dee987a509bf87aa65
2017-10-30 18:26:41 +00:00
Jae Shin
51ec0a1387 Merge changes from topic "rs_vndk_step3"
* changes:
  Tests are run with proper namespace configs by their locations
  Fix: make vndk namespace visible for 2016 Pixes
  vndk: remove vendor/lib from the search path of the 'vndk' namespace
  libz is back to LLNDK
  Make the rs namespace visible
  Add libft2.so to ll-ndk for rs namespace
  Move libz vndk-sp from ll-ndk
2017-10-30 03:22:53 +00:00
Jiyong Park
a2935e0c8b Tests are run with proper namespace configs by their locations
Tests in /data/[nativetest|benchmarktest] run with namespace config for
system and tests in /data/[nativetest|benchmarktest]/vendor run with
namespace config for vendor.

They no longer run in the 'test' namespace config which didn't impose
any restriction for libraries.

Bug: 67028906
Test: sailfish/marlin builds and boots
Test: no VTS regression on system.img from GSI + vendor.img from
marlin/sailfish
Test: VtsKernelLibcutilsTest successful in above config

Merged-In: I28cdef960d087565c8a22dca0e9a154fb1c3bb94
Change-Id: I28cdef960d087565c8a22dca0e9a154fb1c3bb94
(cherry picked from commit 326b783ad9)
2017-10-30 10:27:45 +09:00
Jiyong Park
6ed1a1c339 Fix: make vndk namespace visible for 2016 Pixes
The nativeloader tries to find the 'vndk' namespace when there is a
vendor apk in the classloader paths. This can happen even for a
downloaded app if the app is using a vendor apk via <uses-library> tag.

In order to prevent the nativeloader from failing to find the vndk
namespace, the namespace is marked as visible.

Bug: 66482442
Test: download the app mentioned in the bug, it does not crash.
Merged-In: I82e2394eb6eedcb8645e1a5b3735bbfe2735b312
Change-Id: I82e2394eb6eedcb8645e1a5b3735bbfe2735b312
(cherry picked from commit 1cc09e749f)
2017-10-30 10:27:45 +09:00
Jiyong Park
7f654c3243 vndk: remove vendor/lib from the search path of the 'vndk' namespace
'vndk' namespace is the place for VNDK-SP libs. So /vendor/lib must be
removed from its search paths. It was there just because libhardware
(which is VNDK-SP) is loading HAL libs in vendor partition from there.
However this problem has been solved by modifying the libhardware so
that HAL libs are loaded from the 'sphal' namespace and not from the
current (the 'vndk') namespace.

Bug: 37731053
Test: sailfish builds and boots
Merged-In: Ia88934a975aa8811e05b5ba408e42d132f20f4e9
Change-Id: Ia88934a975aa8811e05b5ba408e42d132f20f4e9
(cherry picked from commit f01b52895d)
2017-10-30 10:27:45 +09:00
Jiyong Park
e58fa1b0c6 libz is back to LLNDK
For 2016 pixel devices, where VNDK is not fully enforced, move libz back
to LLNDK so that we can pass the CTS without requiring the default
namespace to be isolated.

If we have libz in vndk-sp directory, test_linker_namespaces fails
because /system/lib/vndk-sp/libz.so becomes accessible. In order to make
the lib inaccessible, we have to make the default namespace isolated,
but this can't be done for 2016 pixel devices where VNDK is not fully
enforced. So, we choose to remove /system/lib/vndk-sp/libz.so and keep
the single copy at /system/lib.

Bug: 65018779
Test: android.jni.cts.JniStaticTest#test_linker_namespaces successful on
2016 pixel devices

Merged-In: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
Change-Id: Ib6b6560b02be69d2015c0afb86acf07c02b30c2f
(cherry picked from commit 697eb2da0d)
2017-10-30 10:27:45 +09:00
Jiyong Park
7075bca364 Make the rs namespace visible
This allows us to dlopen libRS_internal.so directly from the rs
namespace, not from the sphal namespace.

Bug: 64747884
Test: VtsHalRenderscriptV1_0TargetTest successful on the device built
with BOARD_VNDK_VERSION=current and [system] namespace config is applied
to /data/nativetest[64]/* processes.

Merged-In: I0b441791e395798e80a84592ca01e771bb1c201a
Change-Id: I0b441791e395798e80a84592ca01e771bb1c201a
(cherry picked from commit 421a5e46b7)
2017-10-30 10:27:45 +09:00
Justin Yun
136eb05892 Add libft2.so to ll-ndk for rs namespace
libft2.so is changed to ll-ndk that is available only for rs
namespace.

Bug: 64425518
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I991dc774ca9b92fb6e95a7656243a6a4ecdc0ab9
Change-Id: I991dc774ca9b92fb6e95a7656243a6a4ecdc0ab9
(cherry picked from commit 513f76394a)
2017-10-30 10:27:45 +09:00
Justin Yun
8ebf6ee6f6 Move libz vndk-sp from ll-ndk
The ABI of libz is not as stable as it is for ll-ndk.

Bug: 37617391
Test: build and boot
Merged-In: I883bc6fda268e98cc7cdd5888264170c58688794
Change-Id: I883bc6fda268e98cc7cdd5888264170c58688794
(cherry picked from commit dadd3a846f)
2017-10-30 10:27:45 +09:00
Christopher Ferris
d9f183b83b Merge "Only call one unwinder." 2017-10-29 04:40:01 +00:00
Treehugger Robot
0db49f9f7c Merge changes Icdaf1cf1,I80ba5adb,I8de912c1
* changes:
  libbacktrace: remove exit time destructors.
  libbacktrace: add benchmarks for Backtrace::Create, CreateNew.
  libbacktrace: let the benchmark library decide iteration count.
2017-10-28 01:35:35 +00:00
Treehugger Robot
b88aa023d4 Merge "fastboot should fail if it runs out of space while unzipping." 2017-10-28 01:16:29 +00:00
Treehugger Robot
1193f3bff6 Merge "Delete obsolete debuggerd references." 2017-10-28 01:05:20 +00:00
Josh Gao
18ea0978cf Delete obsolete debuggerd references.
Test: treehugger
Change-Id: Ic1a8cfb867decd76443fdc26333f2bcaa98b61bb
2017-10-27 16:12:49 -07:00
Christopher Ferris
ab9cf8b4cc Only call one unwinder.
Nobody is looking at the mismatches, and it can cause problems
with tombstone parsers.

Also, fix the dump_header_info test and remove unused properties_fake.cpp.

Test: Ran unit tests, verified tombstones still work.
Change-Id: I4261646016b4e84b26a5aee72f3227f1ce48ec9a
2017-10-27 15:18:27 -07:00
Tao Wu
ee14225e0d Merge "Fix race condition between restart and stop/reset." 2017-10-27 21:32:51 +00:00
Elliott Hughes
4089d34b93 fastboot should fail if it runs out of space while unzipping.
Previously fastboot would carry on regardless if decompression failed:

  fastboot: archive does not contain 'vbmeta.img'
  fastboot: extracting vendor.img (260 MB)...
  fastboot: W/ziparchive(56777): Zip: unable to allocate  272781472 bytes at offset 0 : No space left on device
  fastboot: failed to extract 'vendor.img': I/O error
  fastboot: archive does not contain 'vendor_other.img'
  fastboot: wiping userdata...

This is because all but "boot" and "system" are considered "optional",
and the implementation of "optional" was "ignore any failures". What it
_should_ have meant was "it's okay if these don't exist, but if they do,
failures matter".

Fix this logic, use die() more aggressively, and remove spurious "\n"s
from die() format strings.

Also fix spurious whitespace in the libziparchive format string. Before:

  Zip: unable to allocate  272781472 bytes at offset 0 : No space left on device

After:

  Zip: unable to allocate 272781472 bytes at offset 0: No space left on device

Bug: http://b/68383022
Test: `fastboot update` on marlin
Change-Id: I3cbf55f1a33ca125f293f873eafbcfb86c880ba8
2017-10-27 14:21:12 -07:00
Tao Wu
84b856d901 Fix race condition between restart and stop/reset.
If there is a restart follow a stop/reset immediately or vice versa,
clear previous flag bits.

Test: manual - trigger restart after stop immediately to check if
service get started.

Change-Id: I4503177d7cb5ed054dbcf50cd8e09728415404d4
2017-10-27 11:31:42 -07:00
Mark Salyzyn
7de02203cc Merge "bootstat: test: add error propagation for fastboot format userdata" 2017-10-27 16:12:11 +00:00
Mark Salyzyn
e7c95fb34f bootstat: test: add error propagation for fastboot format userdata
Test: system/core/bootstat/boot_reason_test.sh optional_factory_reset
Bug: 63736262
Change-Id: I8893df15ef802bb76c0795288df91d8463bfe3d1
2017-10-27 08:32:55 -07:00