Commit graph

28514 commits

Author SHA1 Message Date
George Burgess IV
e750665187 Merge "fortify: inline #defined strings"
am: 32e8d4fa71

Change-Id: Iefcd07d72e691f1399468687bc236d032c521173
2019-05-23 17:17:29 -07:00
George Burgess IV
2dc6a4f732 Merge "fortify: use a macro in diagnose_if"
am: b07c1973d1

Change-Id: I126b03545a63cc63b54d25796e80a3e49b2d49d5
2019-05-23 17:11:40 -07:00
Treehugger Robot
32e8d4fa71 Merge "fortify: inline #defined strings" 2019-05-23 21:17:31 +00:00
Treehugger Robot
b07c1973d1 Merge "fortify: use a macro in diagnose_if" 2019-05-23 21:17:22 +00:00
George Burgess IV
ff7179350a fortify: inline #defined strings
These were originally #defined so we could share them between our
GCC and clang FORTIFY implementations. Since we no longer have a GCC
FORTIFY, #defining them is sort of pointless.

Bug: 131861088
Test: mma
Change-Id: I2ae4e0bdebbed16c946f5df7cc38c471881b481e
2019-05-23 13:38:09 -07:00
George Burgess IV
5273dc588a fortify: use a macro in diagnose_if
Our diagnose_if conditions are repetitive. It's potentially convenient
to hide that behind a macro. There's an upcoming refactor to our
run-time checks; having static checks look super similar is convenient,
and makes correctness (hopefully) slightly more obvious.

Bug: 131861088
Test: checkbuild on internal master.
Change-Id: Ic39a3b6bf020734c1bef6be144f61ef81466aafe
2019-05-23 13:38:09 -07:00
Elliott Hughes
1bb5ac584b Merge "Move off the Next ZipString overload."
am: 0c0afe17e9

Change-Id: I29a180b930574a3dd663353949e25499fb0b4934
2019-05-23 11:23:22 -07:00
Pirama Arumuga Nainar
509468abe7 Merge "Disable native_coverage for scudo-related libraries"
am: 1b7d236e56

Change-Id: I80c98402392fffbc4fa373bce52924f9f2f1f30d
2019-05-23 11:12:14 -07:00
Elliott Hughes
0c0afe17e9 Merge "Move off the Next ZipString overload." 2019-05-23 17:55:27 +00:00
Treehugger Robot
1b7d236e56 Merge "Disable native_coverage for scudo-related libraries" 2019-05-23 17:19:32 +00:00
Pirama Arumuga Nainar
17e7c75265 Disable native_coverage for scudo-related libraries
Bug: http://b/133379274
Bug: http://b/133322197

Test: coverage-enabled mediaextractor, which uses scudo, no longer
crashes during llvm_gcov_init.

Change-Id: I85a0cc91a2fbd8433823769c3032ec2591424e55
2019-05-22 22:18:37 -07:00
Elliott Hughes
127a706581 Move off the Next ZipString overload.
Bug: http://b/129068177
Test: treehugger
Change-Id: I83840c2ffd6cdede8cb34b4ec168427a43e1daf7
2019-05-22 18:50:53 -07:00
Christopher Ferris
011aa28ec9 Merge "Update to kernel headers to v5.1.3."
am: 933bd3ae66

Change-Id: Ida61da4efd77e568f61997bb3d5e83b64d734e8f
2019-05-22 13:49:53 -07:00
Christopher Ferris
933bd3ae66 Merge "Update to kernel headers to v5.1.3." 2019-05-22 19:09:12 +00:00
Colin Cross
e8b74390ea Merge "Export some symbols for vendor libmemunreachable"
am: d277334059

Change-Id: I6cf4d5a65834797babc6661514cd34f5799d10cb
2019-05-21 16:41:03 -07:00
Treehugger Robot
d277334059 Merge "Export some symbols for vendor libmemunreachable" 2019-05-21 22:51:26 +00:00
Tom Cherry
3395d23ad6 Merge "pwd/grp: fix pwd _r reentrancy, new tests, clean up"
am: e1276ba538

Change-Id: I0f013cc1f6c0c7661559bb183dc70ab3ef346658
2019-05-21 13:27:32 -07:00
Christopher Ferris
6c493e8014 Merge "Keep .debug_frame on arm 32."
am: 03345ed54a

Change-Id: I7bf2b41b1909a23f004ef8ec7cfd9f88fe4b61bc
2019-05-21 13:19:28 -07:00
Treehugger Robot
e1276ba538 Merge "pwd/grp: fix pwd _r reentrancy, new tests, clean up" 2019-05-21 18:29:33 +00:00
Christopher Ferris
03345ed54a Merge "Keep .debug_frame on arm 32." 2019-05-21 18:09:08 +00:00
Dmytro Chystiakov
31892ad6b2 Merge "Limit threads in pthread_leak#detach for low power devices."
am: f8813d14aa

Change-Id: I31c857f880261bb2b46498b60003a2e4a6473adb
2019-05-20 21:08:16 -07:00
Treehugger Robot
f8813d14aa Merge "Limit threads in pthread_leak#detach for low power devices." 2019-05-21 02:15:30 +00:00
Christopher Ferris
daa23b5279 Merge "Temporarily disable unwind through signal test."
am: dcc855456e

Change-Id: I881e198921407babd64f9aa87d20be8146a62974
2019-05-20 14:36:33 -07:00
Christopher Ferris
dcc855456e Merge "Temporarily disable unwind through signal test." 2019-05-20 20:15:13 +00:00
Christopher Ferris
24f97eb27b Update to kernel headers to v5.1.3.
Test: Builds and boots taimen.
Test: Ran bionic unit tests.
Change-Id: Ieaca8709d568f075df8cac60c9da2c0ed1916963
2019-05-20 12:58:13 -07:00
Christopher Ferris
035988ffb4 Temporarily disable unwind through signal test.
On cf_x86_phone-userdebug, both of the unwind through signal
tests fail. This has been failing forever, but seems to have suddenly
become an issue, so disable while I try to figure out why this is happening.

Bug: 132763120

Test: Ran on emulator and verified tests are skipped.
Change-Id: Iafc227d972a7783e94c701d73078c9570cea288e
Merged-In: Iafc227d972a7783e94c701d73078c9570cea288e
(cherry picked from commit d424fafbce)
(cherry picked from commit fe0fbcff7f)
2019-05-20 12:33:09 -07:00
Christopher Ferris
0c0f6fb293 Keep .debug_frame on arm 32.
The arm exidx unwind information can be sparse and clang is producing
functions that cannot be properly represented. The .debug_frame includes
extra unwind information that covers the cases that are not complete, so
do not remove it. For example, the __strchr_chk function has a push
in the middle of the function, so any crash before that instruction will
not unwind properly.

This does increase the size of libc.so, but only by about 80,000 bytes.

Bug: 132992102

Test: Verified the .debug_frame exists in libc.so only for arm32.
Test: Used the unwind_reg_info to verify that __str_chk gets proper
Test: unwind info. Also use unwind_reg_info on some assembler functions
Test: to make sure that there is no overlapping information.
Change-Id: If9a6de15b3adf08a93c4563da8c89846e4dd059b
2019-05-17 17:52:51 -07:00
Colin Cross
b9667b51a8 Export some symbols for vendor libmemunreachable
Add the malloc symbols used by libmemunreachable to the VNDK, and
make libc_malloc_debug_backtrace vendor_available.

Bug: 132302484
Test: m checkbuild
Change-Id: Ide555195afa084c13eaeaf0eab6ff90787b5f2d0
2019-05-17 14:26:31 -07:00
Jiyong Park
073c259287 Merge "Don't resolve already resolved paths when parsing ld.config.txt"
am: 72aafad950

Change-Id: Iba213a946cc411781a1661e74bc887e93c9c310e
2019-05-16 22:17:11 -07:00
Peter Collingbourne
64db1aec2b Merge "Add bootstrap directory to bootstrap linker's search path."
am: 8bb97d7781

Change-Id: I160f40e11d854dd635fcc523517954e2bfcaf323
2019-05-16 21:19:50 -07:00
Treehugger Robot
72aafad950 Merge "Don't resolve already resolved paths when parsing ld.config.txt" 2019-05-17 04:15:41 +00:00
Peter Collingbourne
8bb97d7781 Merge "Add bootstrap directory to bootstrap linker's search path." 2019-05-17 02:26:29 +00:00
Jiyong Park
341b61e694 Don't resolve already resolved paths when parsing ld.config.txt
When parsing ld.config.txt, paths in *.search.paths properties are
resolved using resolved_paths(). This is causing a number of newfstatat
system calls during a process start-up and is contributing about 3.6%
of the entire linker initialization time.

Optimize the overhead by not resolving already resolved paths; resolved
paths are cached.

Bug: 132348336
Test: strace -C -e newfstatat ls shows the number of the syscalls is
reduced from 131 to 99
Test: simpleperf record --call-graph fp -f 10000000 -o /data/perf.data ls
simpleperf report -g -i /data/perf.data
shows percentage of get_paths() from 2.9% to 2.5%

Change-Id: I79823255a89f6e2a63b80c74e6768850276ab536
2019-05-17 10:09:13 +09:00
Peter Collingbourne
ea11be0cc8 Add bootstrap directory to bootstrap linker's search path.
A proposed set of changes:
https://android-review.googlesource.com/q/topic:"no-dup-hwasans"

will cause the HWASAN runtime to be moved from /system/lib64 to
/system/lib64/bootstrap. This causes a problem in the case where libc is built
with HWASAN but init is not built with HWASAN. In this case, libc.so will have
a DT_NEEDED dependency on the HWASAN runtime but init will not. Currently,
init and other bootstrap executables arrange to load bootstrap libraries by
setting rpath, but rpath only has an effect on libraries directly depended
on by the main executable, not libraries indirectly depended on by it. This
means that the loading of the HWASAN runtime will fail.

Instead of relying on rpath to find the bootstrap libraries, modify the
bootstrap linker so that it searches the bootstrap library directory after
searching the rpath.

Change-Id: I297be32e04ecd316ee12b8e694588e1249e2bb89
2019-05-16 16:10:41 -07:00
Haibo Huang
68bf5131e0 Merge "libc: import ARM strcmp from newlib"
am: b43f0b7993

Change-Id: Ia2107c80513f244a246e5c6879f75fd5521487c3
2019-05-16 13:35:53 -07:00
Haibo Huang
b43f0b7993 Merge "libc: import ARM strcmp from newlib" 2019-05-16 19:28:11 +00:00
Jake Weinstein
bff53b2617 libc: import ARM strcmp from newlib
* Current version is also based on newlib, but an older revision

* The Krait and A9 specific changes no longer seem relevant, so
  let's use A15 directly.

Tested on OnePlus 3 (MSM8996):

Before (Krait strcmp):
                                       iterations      ns/op
BM_string_strcmp/8                          1000k         24    0.322 GiB/s
BM_string_strcmp/64                           20M        123    0.519 GiB/s
BM_string_strcmp/512                           2M        920    0.556 GiB/s
BM_string_strcmp/1024                       1000k       1818    0.563 GiB/s
BM_string_strcmp/8Ki                         200k      14405    0.569 GiB/s
BM_string_strcmp/16Ki                        100k      28762    0.570 GiB/s
BM_string_strcmp/32Ki                         50k      57526    0.570 GiB/s
BM_string_strcmp/64Ki                         10k     114959    0.570 GiB/s

After:
                                       iterations      ns/op
BM_string_strcmp/8                          1000k         28    0.284 GiB/s
BM_string_strcmp/64                           20M        107    0.596 GiB/s
BM_string_strcmp/512                           2M        800    0.639 GiB/s
BM_string_strcmp/1024                       1000k       1579    0.649 GiB/s
BM_string_strcmp/8Ki                         200k      12469    0.657 GiB/s
BM_string_strcmp/16Ki                        100k      24931    0.657 GiB/s
BM_string_strcmp/32Ki                         50k      49843    0.657 GiB/s
BM_string_strcmp/64Ki                         20k      99635    0.658 GiB/s

Test: bionic-benchmarks BM_string_memcmp
Change-Id: Icb3bfb0a381bcc1e10885ca5e9547842c3f620d7
2019-05-16 04:37:26 +00:00
Tom Cherry
c57c5bdb7f pwd/grp: fix pwd _r reentrancy, new tests, clean up
getpwnam_r() and getpwuid_r() clobber the storage used by getpwnam()
and getpwuid().  This isn't likely to be a big issue, but since we do
this right for the group functions, fix this as well as add a test.
Both use more space in buf than is actually required, but well below
their sysconf() suggested values, so we accept that to keep the code
concise.

Add tests for dealing with unaligned input buffers, particularly for
getgrnam_r() and getgrgid_r(), as they require alignment but this
wasn't being tested.

Refactor common initialization code for both passwd and group state
structs.

Remove extraneous null pointer checks; the values they were testing
were offsets of a previous pointer, so guaranteed to never actually be
null.  If the underlying pointer is actually null, we're beyond repair
anyway, so accept that we'll crash.

Test: pwd/grp unit tests

Change-Id: I60c4d00e9ab3cf55daf8314c5029fd914025b696
2019-05-15 15:49:34 -07:00
Josh Gao
3d64506c02 Merge "Annotate no_return and returns_twice functions."
am: 93f79a1a5b

Change-Id: I0e77cc78696f7dcf91f63220422a1d7c5088d51b
2019-05-15 13:59:11 -07:00
Josh Gao
93f79a1a5b Merge "Annotate no_return and returns_twice functions." 2019-05-15 20:26:46 +00:00
Xin Li
c3cfb94466 DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: Ie8ba6a818bbe0d9d982624eb5e8cd9cb618827b1
2019-05-13 15:38:40 -07:00
Josh Gao
3403315521 Annotate no_return and returns_twice functions.
When building the bionic tests, we use -fno-builtins, which turns off
clang's recognition of vfork as a magical function that can return
twice. Explicitly annotate our returns_twice functions to ensure that
we generate correct code even in -fno-builtins (and while we're at it,
annotate the no_return functions as well, so we generate faster code).

Bug: http://b/131856005
Test: treehugger
Change-Id: I465f8042a965f0c7c03caa5f17af67deea8f5d9d
2019-05-13 13:17:51 -07:00
Elliott Hughes
36f53ef0eb Merge "bionic_tests_zipalign: don't explicitly specify no prefix/suffix."
am: 235ccfd19b

Change-Id: I2849e9c6374785e03c5d9d85d39e6ed957ec013e
2019-05-10 18:47:54 -07:00
Treehugger Robot
235ccfd19b Merge "bionic_tests_zipalign: don't explicitly specify no prefix/suffix." 2019-05-11 01:22:26 +00:00
Elliott Hughes
be6c641141 bionic_tests_zipalign: don't explicitly specify no prefix/suffix.
Bug: http://b/129068177
Test: treehugger
Change-Id: If061ba04a0b3396898b6150d8fb1a8c27abb03f8
2019-05-10 16:59:13 -07:00
Dmytro Chystiakov
a339233629 Limit threads in pthread_leak#detach for low power devices.
This patch decreases created threads to 90 (instead of 100)
on devices with 2 cores CPU. This test can fail with timeout
on such devices.

Bug: b/129924384
Test: Run CtsBionic module on 2 core device with command
	"run cts -m CtsBionicTestCases"

Change-Id: Ic770006a324748d7d6dfbe8d4fb301e21e494ff9
Signed-off-by: Dmytro Chystiakov <dmytro.chystiakov@intel.com>
2019-05-10 16:44:49 -07:00
Elliott Hughes
4d00ebc652 Merge "linker: support ldd(1)-like behavior via --list."
am: 96babde2e4

Change-Id: Icc8ece4ed2f58ad4265c53b7c0a8c3cc78bc2356
2019-05-10 08:45:52 -07:00
Elliott Hughes
96babde2e4 Merge "linker: support ldd(1)-like behavior via --list." 2019-05-10 15:35:24 +00:00
Elliott Hughes
90f96b9f48 linker: support ldd(1)-like behavior via --list.
Given that we have both linker and linker64, I didn't really want to have
to have ldd and ldd64, so this change just adds the --list option to the
linkers and a shell script wrapper "ldd" that calls the appropriate
linker behind the scenes.

Test: adb shell linker --list `which app_process32`
Test: adb shell linker64 --list `which date`
Test: adb shell ldd `which app_process32`
Test: adb shell ldd `which date`
Change-Id: I33494bda1cc3cafee54e091f97c0f2ae52d1f74b
2019-05-09 22:12:17 -07:00
George Burgess IV
c67f59fd15 Merge "tests: use clang's -verify instead of FileCheck"
am: af68f04e44

Change-Id: I5fe492fe0ad838a91792b7d259c1e30ea2792de7
2019-05-09 14:26:39 -07:00