Commit graph

27265 commits

Author SHA1 Message Date
Christopher Ferris
af1b8ddaa9 Add smoke tests for mallopt options.
Test: Unit tests pass.
Change-Id: If213f4338078011ff12996c1b2a6f6858b51d824
2018-11-07 17:11:42 -08:00
Christopher Ferris
e691069366 Merge "Fix test failures." 2018-11-07 22:48:44 +00:00
Christopher Ferris
9ac0cd5f85 Fix test failures.
- Fix the help output for new benchmarks help output.
- Fix incorrect regex for sanitizing output.

Test: Ran unit tests and they pass.
Change-Id: I227eef3ce8c4ce639321e5ab8a57d0877063ede1
2018-11-07 14:30:55 -08:00
Logan Chien
77a5f95405 Merge "versioner: Port to clang-r344140" 2018-11-07 22:02:50 +00:00
Treehugger Robot
5e099173da Merge "Revert "Do not use clang lld with -z,global"" 2018-11-07 21:43:24 +00:00
Evgenii Stepanov
2b94f124df Merge changes I6ba4b46a,Ic54579e3
* changes:
  Disable a few bionic tests under HWASan.
  Remove timer_delete_multiple test.
2018-11-07 21:35:53 +00:00
Logan Chien
6c148d17e5 versioner: Port to clang-r344140
This commit updates bionic versioner to use clang-r344140.  To be
specific, this commit renames `clang::vfs::FileSystem` to
`llvm::vfs::FileSystem` and updates the headers.

Bug: 111759196
Test: bionic/tools/versioner/run_tests.py
Change-Id: I304ecae79da5a1638ae755dac92b52e314019cf1
2018-11-07 10:35:38 +08:00
Evgenii Stepanov
acd6f4f9f5 Disable a few bionic tests under HWASan.
* HWASan report invalid use of the allocator api (like alignment not
being power of two, or allocation size too large) in a way tests do not
expect.
* Code in .preinit_array runs before HWASan shadow is initialized and
needs to be excluded from instrumentation.
* It looks that mm system calls (mmap/mprotect/etc) will not allow
tagged pointers. In fact, the use of mprotect on malloc()ed memory is
doubtful - one can imagine some kind of speculative load from such
memory, as compiler knows that it is addressable.

Bug: 114279110
Test: bionic-unit-tests with hwasan

Change-Id: I6ba4b46a0d554de77c923ad134cf156ce4ddba1b
2018-11-06 16:59:25 -08:00
Evgenii Stepanov
96bd339c51 Remove timer_delete_multiple test.
According to posix, this test invokes undefined behavior by deleting
a timer twice.

According to hwasan, the second call to timer_delete loads
kernel_timer_id from previously deallocated PosixTimer (i.e.
heap-use-after-free).

Bug: 114279110
Test: bionic-unit-tests with hwasan

Change-Id: Ic54579e3bb41d3f38282b8822dafaba51efd003a
2018-11-06 16:59:21 -08:00
Chih-hung Hsieh
08a0cd082f Revert "Do not use clang lld with -z,global"
This reverts commit 8e462d411a.

Reason for revert: this lld bug has been fixed upstream and in AOSP prebuilts

Bug: 80109858
Change-Id: Ied600324201e1a014a1d4e6742767e2ddd94999a
2018-11-07 00:12:56 +00:00
Logan Chien
0c39bd468d Merge "Add bionic/libc/include to exported_include_dirs" 2018-11-05 08:20:42 +00:00
Neil Fuller
6d1c5cab94 Merge "Changes to support loading tz data from APEX" 2018-11-02 22:34:50 +00:00
Christopher Ferris
9ffd39cdea Merge "Add test for malloc_iterate." 2018-11-02 15:20:54 +00:00
Logan Chien
833cbe4b1c Add bionic/libc/include to exported_include_dirs
This commit adds "include" (full path: "bionic/libc/include") to
exported_include_dirs for libc.  Without this change,
header-abi-checker will strip all functions from ABI dumps.

Bug: 117963950
Test: libc.so.lsdump has a non-empty functions array
Change-Id: I192a4ec0251f1320ced56c6201818076ebd2a2da
2018-11-02 13:21:03 +08:00
Nucca Chen
38b8255866 Merge "getnameinfo: Don't add flag NI_NUMERICHOST for well-known prefix address" 2018-11-02 01:59:20 +00:00
nuccachen
8d65a81fb6 getnameinfo: Don't add flag NI_NUMERICHOST for well-known prefix address
Currently, getnameinfo() will never issue a reverse DNS lookup if the first
byte of the IPv6 address is 0x00. This means it is not possible to do a
reverse DNS lookup for a NAT64 address if the NAT64 prefix is the well-known
prefix. Make this possible by treating the well-known prefix specially. This
is not needed for unicast NAT64 prefixes because they do not start with 0x00.

Bug: 78545619
Test: netd_{unit,integration}_test pass
Test: bionic-unit-tests --gtest_filter='net*' pass
Change-Id: I176d30dcf411a5ffe1eec110db99cd73b48e956f
2018-11-01 16:40:34 +08:00
Logan Chien
e2833f27c1 Merge "versioner: Port to clang-r339409b" 2018-11-01 05:10:36 +00:00
Josh Gao
6f3a56bb18 Merge "Revert "bionic: Allocate a shadow call stack for each thread."" 2018-11-01 01:32:00 +00:00
Treehugger Robot
5c7bece8ca Merge "ld.config.txt for APEX" 2018-10-31 14:04:33 +00:00
Logan Chien
c16d65d70e versioner: Port to clang-r339409b
This commit ports versions to clang-r339409b and utilizes
`libclang-cxx.so`.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: Ib104a6c8c2c69df51cfa2760dbca125f4cfa054b
2018-10-31 14:53:30 +08:00
Jiyong Park
358334145e ld.config.txt for APEX
When executing an executable in an APEX (i.e., /apex/<name>/bin),
ld.config.txt file is read from the same APEX, not from /system/etc.

Bug: 115787633
Test: m apex.test; adb push ...apex.test.apex /data/apex; adb reboot
Test: adb root; adb shell /apex/com.android.example.apex/bin/dex2oat
is runnable.

Change-Id: I6400251f99d24f2379dbaf655ecd84da02490617
2018-10-31 12:21:02 +09:00
Christopher Ferris
bfd3dc497c Add test for malloc_iterate.
Bug: 62621531

Test: New unit tests pass.
Change-Id: Icc50f5b19642225c8f812844d42c904babde8acf
2018-10-30 18:38:39 -07:00
Treehugger Robot
d6ac79300d Merge "Reverse two pthread_internal_t fields" 2018-10-30 23:31:15 +00:00
Neil Fuller
7dfeaf896d Changes to support loading tz data from APEX
The changes needed to pick up time zone data files from
a mounted APEX directory. Code that looks for time zone
data now looks in a new location after checking for
data installed by the time zone updates via APK feature.

This hasn't been tested in combination with a real APEX but
it shouldn't do anything bad if the new path does not exist.

Bug: 115612964
Test: CTS: run cts-dev -m CtsBionicTests
Test: Build / boot without APEX support
Change-Id: I56ae50e26f2cbfa0e537029a0e6f679fa2394327
2018-10-30 20:19:35 +00:00
Ryan Prichard
25c34e0feb Reverse two pthread_internal_t fields
The golang runtime currently expects to find the pthread key data after
the tls slots.

Bug: http://b/78026329
Bug: http://b/118381796
Test: run a golang-based app, bionic unit tests
Change-Id: Idc777d809b803093e1c81d9a2ce4eafcc7d61f8d
Merged-In: Idc777d809b803093e1c81d9a2ce4eafcc7d61f8d
(cherry picked from commit a2c30723da)
2018-10-30 12:30:21 -07:00
Christopher Ferris
6a5dcd6786 Merge "Update to v4.19 kernel headers." 2018-10-30 19:11:33 +00:00
Christopher Ferris
9ce28844db Update to v4.19 kernel headers.
Test: Builds and boots.
Change-Id: I99a9ed79666e143b47f02ca4e59eed94f69b7e4a
(cherry picked from commit a981e2e52e)
2018-10-30 09:21:16 -07:00
Florian Mayer
e898a17e8f Merge "Allow to re-initialize heapprofd." 2018-10-30 11:34:17 +00:00
Peter Collingbourne
7b13dd918e Revert "bionic: Allocate a shadow call stack for each thread."
This reverts commit da1bc79f93.

Reason for revert: Caused OOM in media process

Bug: 112907825
Bug: 118593766
Change-Id: I545663871d75889b209b9fd2131cdaa97166478f
2018-10-29 21:48:59 +00:00
Peter Collingbourne
f284a47544 Merge "bionic: Allocate a shadow call stack for each thread." 2018-10-29 21:05:25 +00:00
Peter Collingbourne
da1bc79f93 bionic: Allocate a shadow call stack for each thread.
Bug: 112907825
Change-Id: I7c1479a0cd68696739bf6aa5e0700ba4f2a137ec
Merged-In: I7c1479a0cd68696739bf6aa5e0700ba4f2a137ec
2018-10-29 19:55:18 +00:00
Florian Mayer
176a47594e Allow to re-initialize heapprofd.
Without this change, any process can only be profiled by heapprofd
once.

Change-Id: I2d0f50eebcc3b219750354ccdc4ea22a2e39c4b6
2018-10-29 12:24:15 +00:00
Christopher Ferris
debcd02d18 Merge "Fix handling of #elif." 2018-10-27 04:42:02 +00:00
Christopher Ferris
f2484aaed7 Fix handling of #elif.
When a construct like:

if defined(something)
  blocks1
elif 1
  blocks2
else
  blocks3
endif

The parser would put the first clause but then simply omit the elif and
put all of blocks2 without a terminating #endif. The code also did
something similar when the #else was an #endif.

Also convert all of the unit tests to real unit tests and only run
them if you run cpp.py by itself. Added new unit tests to cover the
new cases.

Test: Ran cpp.py unit tests.
Test: Reran update_all.py and verified nothing changed, and that running
Test: it on the new kernel headers that exposed this problem.
Change-Id: Ie168511303c4e15afdb60c37baef75a966ca29a8
2018-10-26 22:42:26 +00:00
Logan Chien
90856af78b Merge changes I70ea4b23,Iedcfe36b,I3f21fc71,Ie99c0eef
* changes:
  libc: Match header annotations to version script
  versioner: Build SymbolDatabase from version scripts
  versioner: Add 28 to version list
  libc: Add default __STRING implementation
2018-10-26 01:33:06 +00:00
Treehugger Robot
2bfe37afc8 Merge "Move Bionic slots to the end of pthread_internal_t" 2018-10-26 00:49:21 +00:00
Elliott Hughes
04164f6d05 Merge "Clean up bionic_macros.h a bit." 2018-10-26 00:09:15 +00:00
Ryan Prichard
29d6dbc906 Move Bionic slots to the end of pthread_internal_t
With ELF TLS, the static linker assumes that an executable's TLS segment
is at a known offset from the thread pointer (i.e. __get_tls()). The
segment can be located prior to the TP (variant 2, x86[_64], sparc) or
after it (variant 1, arm{32,64}, ppc, mips, ia64, riscv).

We can't make our pthread_internal_t exactly follow the ordinary arm64
ABI (at least) because TP[5] is used for clang's -fstack-protector on
Android. Instead, reserve extra space after the TP (up to 16 words), which
will be followed by the executable's TLS segment.

Bug: http://b/78026329
Test: boot device, bionic unit tests
Change-Id: I0f3b270b793f9872ba0effeac03f4dec364438d6
Merged-In: I0f3b270b793f9872ba0effeac03f4dec364438d6
(cherry picked from commit f397317e96)
2018-10-25 23:31:17 +00:00
Treehugger Robot
5c722edf2b Merge "linker: Fix fd leak" 2018-10-25 20:15:40 +00:00
Elliott Hughes
5e62b34c0d Clean up bionic_macros.h a bit.
Use <android-base/macros.h> instead where possible, and move the bionic
macros out of the way of the libbase ones. Yes, there are folks who manage
to end up with both included at once (thanks OpenGL!), and cleaning that
up doesn't seem nearly as practical as just making this change.

Bug: N/A
Test: builds
Change-Id: I23fc544f39d5addf81dc61471771a5438778895b
2018-10-25 11:00:00 -07:00
Logan Chien
25bcf59cb3 libc: Match header annotations to version script
According to `libc.map.txt`, `pselect64()` was introduced since API
level 28. This commit adds the annotations to `sys/select.h`.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: I70ea4b23cef92857f1654cebb660e0219238fc95
2018-10-25 14:54:44 +08:00
Logan Chien
9c123230e2 versioner: Build SymbolDatabase from version scripts
This commit adds a version script parser so that versioner can build
SymbolDatabase from version scripts.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: Iedcfe36b51a62693668e07b86aa13592096262db
2018-10-25 14:54:39 +08:00
Bill Yi
c89a3971e9 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: Id036d1c35ff2cd8268ece544c6da2d6a9afbc184
2018-10-24 14:53:40 -07:00
Vic Yang
48b6911397 linker: Fix fd leak
Close the file descriptor before throwing it away.

Test: mmma bionic
Change-Id: I1690c1bb8b619f82070503151b1de73302882310
2018-10-24 14:14:26 -07:00
Elliott Hughes
6032c38fb3 Merge "Add getloadavg(3)." 2018-10-24 16:31:21 +00:00
Christopher Ferris
0ba6644b3e Merge "Comment the M_PURGE option." 2018-10-24 05:06:18 +00:00
Christopher Ferris
8daea556e9 Comment the M_PURGE option.
Test: Compiles.
Change-Id: Ib9e6f9a3f4b57a930a1ec5c149d273663f97a443
2018-10-23 13:43:48 -07:00
Tom Cherry
8828e8ba3a Merge "CTS: allow continue to use the old AIDs on devices launch with P" 2018-10-23 20:18:43 +00:00
Elliott Hughes
2d0b28bc0d Add getloadavg(3).
Lets us build ninja with bionic.

Bug: N/A
Test: ran tests
Change-Id: I97eef1247d794b58a2b9aee4851551632e5a4e48
2018-10-23 11:23:00 -07:00
Christopher Ferris
7562f1ab87 Merge "malloc: add M_PURGE mallopt flag" 2018-10-23 16:36:16 +00:00