Commit graph

36291 commits

Author SHA1 Message Date
Christopher Ferris
c9dee84d81 Add support for only a .eh_frame.
Static executables only have a .eh_frame section and no .eh_frame_hdr
section. Add support for this by rearranging the class hierarchy and
creating a DwarfEhFrameWithHdr class and a DwarfEhFrame class to handle
the different cases.

Add new unit tests for DwarfEhFrame and for the new functionality.

Bug: 68820189

Test: Passes new unit tests, unwinds static executables.
Change-Id: I63d7cb8c52a686e96579a2266e18c0d06bbb6e63
2017-11-07 13:22:39 -08:00
Treehugger Robot
1e0b9672de Merge "MIPS[64]: codeflinger: Fix build due to unused variable warnings" 2017-11-07 20:34:34 +00:00
Christopher Ferris
8e1ac14f40 Merge "Fix nullptr dereference." 2017-11-07 20:30:42 +00:00
Treehugger Robot
d9984743e6 Merge "Don't include the build number in the adbd binary." 2017-11-07 20:04:40 +00:00
Elliott Hughes
6b970212fd Don't include the build number in the adbd binary.
We want repeatable builds for minimal OTAs.

(cherrypick of 2e93eda69cf20d9c04d56ea6bf1e2ea62ad62eb4.)

Bug: http://b/64634017
Bug: 64709603 (presubmit balking at the line above)
Test: repeated builds after `touch daemon/main.cpp` keep same md5sum
Change-Id: Iedeb44377ea45bbf20e2212760802198a57dc14a
2017-11-07 10:57:36 -08:00
Miodrag Dinic
cc599273b4 MIPS[64]: codeflinger: Fix build due to unused variable warnings
Change-Id: Ie31d44ee74a218c83774df855be496ca862af8c5
Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
2017-11-06 16:38:49 +01:00
Christopher Ferris
13b86658b9 Fix nullptr dereference.
If an entry is found in .eh_frame_hdr, but it's not properly in .eh_frame,
then the code would crash. The assumption that the header always points
to valid fde data is not guaranteed.

Bug: 68813077

Test: Passes new unit test that crashed before the change.
Change-Id: I914d9bda0d442cd232e2a056ae490301a8850105
2017-11-05 14:01:43 -08:00
Connor O'Brien
ebcfa44937 Merge "fastboot: handle small flash block sizes correctly" 2017-11-03 21:15:34 +00:00
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