Commit graph

34713 commits

Author SHA1 Message Date
Colin Cross
d8b97f48c1 Merge "Define sockaddr_storage in bionic" 2021-07-14 23:59:08 +00:00
Christopher Ferris
33d73379aa Fix race when frees after main thread finishes.
When the main thread is exiting, the code deleted the g_debug global
pointer and destroys the disable pthread key. Unfortunately, if
malloc debug was enabled in a way that requires a header for the pointer,
any frees that occur after the main thread is torn down result in calls
to the underlying allocator with bad pointers.
To avoid this, don't delete the g_debug pointer and don't destroy the
disable pthread key.

Added a new system test that allocates a lot of pointers and frees them
after letting the main thread finish.

Also, fix one test that can fail sporadically due to a lack of unwinding
information on arm32.

Bug: 189541929

Test: Passes new system tests.
Change-Id: I1cfe868987a8f0dc880a5b65de6709f44a5f1988
2021-07-14 16:34:46 -07:00
Colin Cross
d27506716a Define sockaddr_storage in bionic
Bionic currently renames the kernel's __kernel_sockaddr_storage
to sockaddr_storage.  We would like to reuse the bionic kernel
headers for musl, but musl defines its own sockaddr_storage,
causing redefinition errors when the musl and kernel headers
are both included.

Give bionic its own definition of sockaddr_storage so the kernel
one can be left as __kernel_sockaddr_storage, avoiding the
conflict in musl.

Some of the structs in netinet/in.h contain sockaddr_storage members.
There are definitions in linux/in.h, but they now use the
__kernel_sockaddr_storage naming.  To avoid having to copy the structs
from linux/in.h into netinet/in.h, add some #define hackery to
rename __kernel_sockaddr_storage to sockaddr_storage when including
linux/in.h from netinet/in.h.

Bug: 190084016
Test: m checkbuild
Test: bionic-unit-tests
Change-Id: I8f654511722b3a4a8e0bb146e4418ebcd370305c
2021-07-14 14:20:36 -07:00
Colin Cross
b5bfe0bd51 Move system_shared_libs into target.bionic clause
Use target.bionic.system_shared_libs when it is used to limit the
default shared libraries (as opposed to remove them completely).
This avoids attempting to add a host dependency on libc when
system_shared_libs is modified to apply to all variants.

Bug: 193559105
Test: m checkbuild
Change-Id: I8d623321ce5145cf2968f83f78b5cb50711290f4
2021-07-13 16:26:28 -07:00
Treehugger Robot
829b84d236 Merge "Remove obsolete visibility entries from libc_headers" 2021-07-13 16:37:32 +00:00
Evgenii Stepanov
a55c81e36e Merge "Make MTE tests pass with all values of MEMTAG_OPTIONS." 2021-07-13 01:37:06 +00:00
Evgenii Stepanov
53df1f3772 Make MTE tests pass with all values of MEMTAG_OPTIONS.
Do not assume that tests start with Sync MTE; check the initial setting
and change test logic as appropriate.

Bug: 192480262
Test: bionic-unit-tests with MEMTAG_OPTIONS=(off|sync|async)
Change-Id: Id80301e6426af16f89bd80a7a7ab127b6fd60425
2021-07-12 16:33:26 -07:00
Treehugger Robot
df901df77a Merge "Support replacing nested kernel structs" 2021-07-12 23:13:59 +00:00
Colin Cross
ab1b143efa Remove obsolete visibility entries from libc_headers
cc_objects get libc headers by default now unless they opt out through
system_shared_libs: [] or default_shared_libs: [], so they no longer
need explicit visibility.

Fixes: b/153662223
Test: m nothing
Change-Id: Ib61a597cbfee4616a632abdfbf4b4f108d35c2b6
2021-07-12 15:57:01 -07:00
Treehugger Robot
2ef1cd3f44 Merge "Allow the kernel to upgrade ASYNC mode processes to SYNC mode." 2021-07-02 17:58:43 +00:00
Peter Collingbourne
48bf46b968 Allow the kernel to upgrade ASYNC mode processes to SYNC mode.
On devices where the performance of ASYNC mode is similar to SYNC
mode on certain CPUs, OEMs may choose to configure the kernel to
prefer SYNC mode on those CPUs by writing the value "sync" to the
sysfs node: /sys/devices/system/cpu/cpu<N>/mte_tcf_preferred

The kernel will only respect the per-CPU preference if the user program
allows this by specifying the preferred mode as a member of a set of
allowed modes. Since only kernels with r.android.com/1754670 support
specifying multiple modes, fall back to trying to specify a single
mode if that doesn't work.

Bug: 189966263
Change-Id: Ie7ada3b073178b7967f0819cbdadc2d8e3a2c648
2021-07-01 15:39:32 -07:00
Colin Cross
7332139c65 Merge "Add default_shared_libs to crt objects" 2021-07-01 19:00:40 +00:00
Christopher Ferris
30782aa99b Merge "Update to v5.13 kernel headers." 2021-07-01 16:54:38 +00:00
Christopher Ferris
fcc3b4f45d Update to v5.13 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-5.13

Test: Builds, bionic unit tests.
Change-Id: Ia4360ca4a2808206f64187dcb234d73c5752624b
2021-07-01 01:30:21 +00:00
Colin Cross
68ec53e141 Support replacing nested kernel structs
When replacing structs with bits/ includes, count the number of
opening and closing braces to find the end of the struct.

Test: tools/update_all.py
Change-Id: Ic9712a385da517710ceffccbdb223c89ae0b5f65
2021-06-29 14:22:30 -07:00
Treehugger Robot
b4b3166d7b Merge "Document more clearly that we don't plan on using faccessat2(2)." 2021-06-25 20:04:28 +00:00
Elliott Hughes
79dbdc3c22 Document more clearly that we don't plan on using faccessat2(2).
Test: treehugger
Change-Id: Idea76ab97865bf26c1f6b16200ba2c7d1fe50ee8
2021-06-25 09:16:18 -07:00
Treehugger Robot
d17cf31a92 Merge "Stop documenting native_heapdump_viewer." 2021-06-25 00:16:40 +00:00
Elliott Hughes
a9d0c104a6 Stop documenting native_heapdump_viewer.
...since we're removing it anyway.

We recommend Perfetto instead.

Bug: https://github.com/android/ndk/issues/435
Test: treehugger
Change-Id: If932646d869f7df6bbe147b5dce49abdd9f31612
2021-06-24 15:48:31 -07:00
Evgenii Stepanov
58679c8d6a Merge "Add definition of M_MEMTAG_TUNING." 2021-06-24 18:48:55 +00:00
Evgenii Stepanov
d8d561c984 Add definition of M_MEMTAG_TUNING.
Bug: 191769584
Test: N/A
Change-Id: Ief77f95a04411528563787a9fc6d10738fc5688f
2021-06-24 01:21:00 +00:00
Colin Cross
10d9268676 Add default_shared_libs to crt objects
cc_object modules will now honor the default_shared_libs, override
it to empty to avoid circular dependencies.

Bug: 153662223
Test: m checkbuild
Change-Id: I02dd9510fcc0b6bf724d9cdd7c3e80c08430a7b9
2021-06-23 16:44:57 -07:00
Elliott Hughes
e772804d15 Merge "Extend <sys/sysinfo.h> tests slightly." 2021-06-23 15:32:34 +00:00
Elliott Hughes
40c8a8b1ba Extend <sys/sysinfo.h> tests slightly.
We know game developers (and the Games SDK) look at this stuff, so make
a bit more of an effort to ensure it's not completely broken.

Test: treehugger
Change-Id: I20b1c167faa1d9f4f39a94a723dabb848ce34269
2021-06-21 16:50:13 -07:00
Treehugger Robot
80c506f854 Merge "Improve the <sys/select.h> docs." am: 5ebdeb30ab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1740159

Change-Id: If43a2586f6245318d6f9267a8d58ed8c46b8bd8c
2021-06-18 02:28:17 +00:00
Treehugger Robot
5ebdeb30ab Merge "Improve the <sys/select.h> docs." 2021-06-18 01:57:05 +00:00
Elliott Hughes
c849ef1063 Improve the <sys/select.h> docs.
Test: treehugger
Change-Id: I00fc6aededc20e89fb46d8dc033bdcb0530a8052
2021-06-17 14:41:29 -07:00
Colin Cross
224ce15c0b Merge "Remove host_bionic_inject" am: 39259a9b19
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1735414

Change-Id: I7dd2d3be50d3645b68434c46a895547c27d44462
2021-06-16 17:03:59 +00:00
Colin Cross
39259a9b19 Merge "Remove host_bionic_inject" 2021-06-16 16:50:05 +00:00
Nikita Ioffe
d43c3ea0c8 Merge "Explicitly set generate_hashtree: false" am: c8b02e3bec
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1737093

Change-Id: If976b2740e65e055c2726f80a0087c211ec62083
2021-06-15 00:00:22 +00:00
Nikita Ioffe
c8b02e3bec Merge "Explicitly set generate_hashtree: false" 2021-06-14 23:45:23 +00:00
Nikita Ioffe
8f537e8762 Explicitly set generate_hashtree: false
Non-updatable APEXes are going to be only present on a dm-verity
protected read-only partition. For such APEXes there is no need in
embedding a hashtree.

This is a no-op change in preparation of switching default value of
generate_hashtree to true.

Bug: 190621617
Test: m
Change-Id: I426c1fce37ce63200810d69092660644e13291c2
2021-06-14 22:13:42 +01:00
Colin Cross
d87147644c Merge "Don't use prefix_symbols for host bionic linker wrapper" am: 34fead98cb
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1735413

Change-Id: Ic5b6d64d85bb112419f8f844fe694b21140cd42e
2021-06-14 19:42:13 +00:00
Colin Cross
34fead98cb Merge "Don't use prefix_symbols for host bionic linker wrapper" 2021-06-14 19:25:36 +00:00
Colin Cross
331b3887f4 Remove host_bionic_inject
Now that linker_wrapper.o does not use objcopy --prefix-symbols=__dlwrap_
it can reference the _start symbol of the original binary without
colliding with its own __dlwrap__start symbol, which means
host_bionic_inject is no longer necessary.

Test: build and run host bionic binary
Change-Id: I1752efa39fa73a092fab039771bf59c99b7b5974
2021-06-14 12:25:05 -07:00
Colin Cross
a0a591a714 Don't use prefix_symbols for host bionic linker wrapper
The only symbol that actually needs a prefix to avoid a collision is
_start, and that can be handled with a copy of begin.S that uses a
"#define" to rename _start to __dlwrap__start. Removing the prefixed
symbols will also allow simplifying the host bionic build process by
letting it directly reference the real _start.

Test: build and run host bionic binary
Change-Id: I50be786c16fe04b7f05c14ebfb74f710c7446ed9
2021-06-14 12:24:25 -07:00
Treehugger Robot
debbff4f6f Merge "DO NOT MERGE - Merge ab/7272582" am: a882cb5d43
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1735942

Change-Id: Iefafb69fbeb3cabbb9ead86ec38995a212c38929
2021-06-14 07:26:35 +00:00
Xin Li
d470076c47 DO NOT MERGE - Merge ab/7272582 am: d8bd5bd28f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1735942

Change-Id: I0be5c7c9b4717ee3e045e5979700aeeef68b94e8
2021-06-14 07:26:22 +00:00
Treehugger Robot
a882cb5d43 Merge "DO NOT MERGE - Merge ab/7272582" 2021-06-14 07:12:30 +00:00
Xin Li
d8bd5bd28f DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Change-Id: I7d0e41fb466c03c7e8a43d2cc4a271902e4f76eb
2021-06-11 17:33:56 -07:00
Peter Collingbourne
0995a57a9f Merge "Disable return PAC in __pthread_start." am: be1c013280
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1728331

Change-Id: I1b7185474561fd91c2cdd6923f3202abc6b389a2
2021-06-09 01:34:15 +00:00
Peter Collingbourne
be1c013280 Merge "Disable return PAC in __pthread_start." 2021-06-09 01:14:29 +00:00
Christopher Ferris
f45bc90dc4 Merge "Skip the malloc_slack test on native bridge." am: 33b86cc6c1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1730406

Change-Id: Id4224d7e5036bc55b0b5bf49a010dfe47402856f
2021-06-09 00:30:13 +00:00
Christopher Ferris
33b86cc6c1 Merge "Skip the malloc_slack test on native bridge." 2021-06-09 00:11:07 +00:00
Peter Collingbourne
26d83ba7ab Disable return PAC in __pthread_start.
This function doesn't return, but it does appear in stack traces. Avoid
using return PAC in this function because we may end up resetting IA,
which may confuse unwinders due to mismatching keys.

Bug: 189808795
Change-Id: I953da9078acd1d43eb7a47fb11f75caa0099fa12
2021-06-08 16:03:41 -07:00
Christopher Ferris
7c0ce86a00 Skip the malloc_slack test on native bridge.
The allocator for the native bridge is not necessarily going to
allocate the slack data.

Bug: 189606147

Test: Ran on non-native bridge and verified test isn't skipped.
Test: Ran on native bridge and verified test is skipped.
Change-Id: Ia1555be0e9f55896af7ca81830605367133c44a1
2021-06-08 15:33:22 -07:00
Ryan Prichard
81df871c3b Merge "Use ro.build.type instead of ro.debuggable" am: 8ab7ab147c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1728690

Change-Id: Id3d8c0f92a7b6644b143196c6d6effc87faf518c
2021-06-08 21:22:09 +00:00
Ryan Prichard
8ab7ab147c Merge "Use ro.build.type instead of ro.debuggable" 2021-06-08 21:00:22 +00:00
Treehugger Robot
a59b01b988 Merge "Mark abort(3) as nomerge." am: 6236ebd2d6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1729453

Change-Id: I19fdbbc6f84ac6c462f1e053081779b6f3f052e7
2021-06-08 19:53:42 +00:00
Treehugger Robot
6236ebd2d6 Merge "Mark abort(3) as nomerge." 2021-06-08 19:15:18 +00:00