Commit graph

9259 commits

Author SHA1 Message Date
Elliott Hughes
8251d4419f Add lp32 and lp64 shorthands to SYSCALLS.TXT.
Bug: N/A
Test: updating the generated stubs is a no-op
Change-Id: I7f6f9bcfd8c054f0a2d7e5f488eacb88cefb8d15
2018-11-09 13:57:34 -08:00
Ken Chen
b9de32f6f0 Merge "Free memory when it is no more used" 2018-11-09 03:28:44 +00:00
Ken Chen
f945716bf9 Free memory when it is no more used
Memory leak happen when Android data framework updates identical DNS
information to netd.

(cherrypick of c466fe95dc641d879683700aea4233ffd42bc762.)

Bug: 115595601
Test: netd_unit_test, netd_integration_test
Change-Id: Idcc0956729286563603f482258f488a1ccd75e6a
2018-11-08 13:29:13 -08:00
Josh Gao
8fd93e6ea5 Merge "Increase the size of the signal stack on 64-bit." 2018-11-08 21:24:51 +00:00
Josh Gao
f90687c4ec Increase the size of the signal stack on 64-bit.
The signal stack is sufficiently large for a single invocation of the
signal handler, but in cases where the signal handler needs to recurse,
(e.g. if our address space is limited by RLIMIT_AS), it's too small for
us to get to the part where we recognize that we've recursed and bail
out.

Bug: http://b/118772392
Test: /data/nativetest64/debuggerd_test/debuggerd_test64 --gtest_filter=CrasherTest.seccomp_crash_oom
Change-Id: Ic7a2cf8b01b3f7ea7f4a2318a3ec22a0c3649da6
2018-11-08 21:24:31 +00:00
Elliott Hughes
bf925b0580 Merge "Remove obsolete workaround." 2018-11-08 20:09:49 +00:00
Neil Fuller
10265a8cbe Merge "Finalize the name of the apex package" 2018-11-08 08:18:59 +00:00
Chih-hung Hsieh
b3fe0136d8 Merge "Revert "Disable lld, libc_malloc_debug failed to boot."" 2018-11-08 04:59:14 +00:00
Chih-hung Hsieh
56794421fc Revert "Disable lld, libc_malloc_debug failed to boot."
This reverts commit 0e87940961.

Reason for revert: This should have been fixed.
Bug: 78118944

Change-Id: I796ff2420ec3682dd54a059175a8428868b75c23
2018-11-07 23:49:37 +00:00
Neil Fuller
fd522d0132 Finalize the name of the apex package
The package name in the manifest.json is changing to
remove apex so the hardcoded path must change.

Bug: 119026403
Test: build
Change-Id: I906b595a1325b40f8af8c37d7d08cd543c988cc8
2018-11-07 15:42:43 +00:00
Elliott Hughes
eadf50601b Remove obsolete workaround.
Bug: b/37423073
Test: builds
Change-Id: Ib0ad58abc7303967a80bb933501cc1247bb36385
2018-11-06 11:17:34 -08:00
Elliott Hughes
8178c417f6 ART isn't using the ART-specific linker features any more.
Bug: N/A
Test: ran tests
Change-Id: Ide3c295035687019608a2c4716a4a21cb889d121
2018-11-06 11:15:17 -08: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
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
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
Josh Gao
6f3a56bb18 Merge "Revert "bionic: Allocate a shadow call stack for each thread."" 2018-11-01 01:32:00 +00: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
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
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
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
Elliott Hughes
6032c38fb3 Merge "Add getloadavg(3)." 2018-10-24 16:31:21 +00:00
Christopher Ferris
8daea556e9 Comment the M_PURGE option.
Test: Compiles.
Change-Id: Ib9e6f9a3f4b57a930a1ec5c149d273663f97a443
2018-10-23 13:43:48 -07: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
Logan Chien
aede30d316 libc: Add default __STRING implementation
This commit defines a default `__STRING()` definition.  There should be
a default definition because the unit test cases of versioner will
include `android/versioning.h` directly.  We cannot include
`sys/cdefs.h` in `android/versioning.h` either because that will lead to
circular inclusion.

Bug: 113263746
Test: ./bionic/tools/versioner/run_tests.py
Change-Id: Ie99c0eef4414fd687347baf3a2d295468877464f
2018-10-23 21:47:34 +08:00
Dan Willemsen
d4e51a155a Change crtbrand for host bionic
Fixes a build error when PLATFORM_SDK_VERSION is not set.

Bug: 31559095
Test: attempt to build host bionic
Change-Id: I9cbdcea206ef1239c330a5adafbfa5cc797fef5e
2018-10-22 17:15:22 -07:00
Tim Murray
ac578f2587 malloc: add M_PURGE mallopt flag
Add a new mallopt flag that purges any pending decaying pages.

Test: boots and works
bug 117795621

Change-Id: Ib250ae2b705b6a368c1efb801d6a7be54e075acb
(cherry pciekd from commit 5083e833a6)
2018-10-22 16:25:28 -07:00
Florian Mayer
f7f71e3c7b Add RT signal to load heapprofd library.
Tests: Ran malloc_debug_unit_tests
Tests: Flashed to walleye, sent signal, observed
  "Unable to open shared library: heapprofd.so".

Change-Id: Ia8ce216837e29e3edbda8789ca28023d53fa1fda
2018-10-18 21:38:06 +01:00
Josh Gao
7ff7d03286 Merge "Properly fail with ESRCH when pthread_killing an exited thread." 2018-10-18 17:47:17 +00:00
Josh Gao
ddf757e35e Properly fail with ESRCH when pthread_killing an exited thread.
Previously, we were callign tgkill(pid, 0, signal) instead, which would
fail with EINVAL instead.

Test: bionic-unit-tests
Change-Id: I25b127dcf347e0223274502b0516a950b6c2093e
2018-10-17 17:35:56 -07:00
Elliott Hughes
eb61430374 Don't #define __ANDROID_NDK__ for the platform build!
Caused an ODR violation trying to build current ToT of toybox.

Bug: N/A
Test: can successfully build code with `#ifdef __ANDROID_NDK__`
Change-Id: Ia80b8889b267779ee01f6257744e1794db0ebc65
2018-10-17 14:27:36 -07:00
Treehugger Robot
ecf0c7515d Merge "strerror: add missing ERFKILL and EHWPOISON." 2018-10-15 23:56:22 +00:00
Treehugger Robot
daf746b155 Merge "fdsan: reset va_list between varargs traversals" 2018-10-15 21:05:44 +00:00
Elliott Hughes
92a9116100 strerror: add missing ERFKILL and EHWPOISON.
There's little value to having strings for these, but we may as well
for consistency. There's no ELASTERRNO constant we can use to check
whether we've fallen behind again, but these were added in 2009 and
2011 respectively, so we're not likely to have to deal with any more
new errno values any time soon...

Bug: http://b/117755069
Test: ran tests
Change-Id: I5b7155c22cad92c2fe03a0b4c7cae415c37fa186
2018-10-15 13:12:19 -07:00
Greg Hackmann
cc953e08f4 fdsan: reset va_list between varargs traversals
When error_level != ANDROID_FDSAN_ERROR_LEVEL_FATAL, fdsan_error()
traverses the varargs twice.  Each traversal needs its own
va_start()/va_end() pair.  Otherwise async_safe_format_buffer_va_list()
will start consuming arguments where async_safe_format_log_va_list()
stopped, ironically causing the sanitizer runtime to perform bad memory
accesses.

Test: debuggerd_test32
Test: debuggerd_test64

Change-Id: Ic85ca94501e55e9a435410fab89edb273c381a5a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2018-10-15 10:41:34 -07:00
Haibo Huang
bc4f411138 Add support for A76 in bionic
A76 still uses A55 as little core. It should be ok to use the same
setting as A75 for now.

Bug: 117125298
Test: run bionic tests
Change-Id: Idfd15424c20ae60becb6539f6ae855f3e7c264cd
2018-10-12 23:55:06 +00:00
Treehugger Robot
391af2cefe Merge "Allow invoking the linker on an executable." 2018-10-11 01:04:57 +00:00