Commit graph

35547 commits

Author SHA1 Message Date
Bowgo Tsai
9a2d3cac37 [automerger skipped] Revert "bionic_systrace: moving global static variables" am: 2ebdb61620 -s ours
am skip reason: Merged-In If59e3dc25684a3c2b1d3ff74f995311afe6c6e89 with SHA-1 3ec21f527a is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/15353072

Change-Id: Ied2856102c8310ccae1d63e213b602e0e5ab4b5c
2021-07-23 18:12:39 +00:00
Joel Galenson
11fa022647 Merge changes from topic "rust-property-bindings" am: a67c7fdca8 am: 0504d629aa
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1773608

Change-Id: I396b2c42804abf0b3f260db2610aa2158a6fd90d
2021-07-23 15:22:21 +00:00
Joel Galenson
75989112f5 Migrate keystore2's Rust system library bindings to bionic. am: e1f1e79310 am: 13e81f8712
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1773607

Change-Id: Ic13580d7167049288dbb0c30bf6cd3718fcd2543
2021-07-23 15:22:19 +00:00
Joel Galenson
0504d629aa Merge changes from topic "rust-property-bindings" am: a67c7fdca8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1773608

Change-Id: I89e98a821a6ca7735b0f7e1e2b24e9a8836d9f76
2021-07-23 15:04:57 +00:00
Joel Galenson
13e81f8712 Migrate keystore2's Rust system library bindings to bionic. am: e1f1e79310
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1773607

Change-Id: I6e088ac03ce5e98a81b335456fd6f6a43269ac05
2021-07-23 15:04:54 +00:00
Joel Galenson
a67c7fdca8 Merge changes from topic "rust-property-bindings"
* changes:
  Improve the Rust property bindings.
  Migrate keystore2's Rust system library bindings to bionic.
2021-07-23 14:46:55 +00:00
Christopher Ferris
b7b14b73b0 Merge "Fix NOTICE file." am: e780ad0c24 am: 103efe0c08
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1775588

Change-Id: I0e84b6e3899f790009f42445f8d074905442a2a5
2021-07-23 05:57:17 +00:00
Christopher Ferris
103efe0c08 Merge "Fix NOTICE file." am: e780ad0c24
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1775588

Change-Id: I55dc3bb98b057fe0e2b257dada9c142b58d40d67
2021-07-23 05:38:42 +00:00
Christopher Ferris
e780ad0c24 Merge "Fix NOTICE file." 2021-07-23 05:19:07 +00:00
Christopher Ferris
5c49616f70 Fix NOTICE file.
Test: Uploads.
Change-Id: I23fb9413dd62aa06ffa26e5e7fc0f7e26fa8cde4
2021-07-22 22:37:19 +00:00
Colin Cross
02f813703a Rename cc_object default_shared_libs to system_shared_libs
default_shared_libs has been removed, go back to the system_shared_libs
property that now has the same behavior.

Bug: 193559105
Test: m checkbuild
Change-Id: I9edac93f7e6d9d4b99883b7a7b14ab52942c0ef2
2021-07-22 12:02:10 -07:00
Treehugger Robot
a9519cd8bc Merge "Move system_shared_libs into target.bionic clause" am: 2ffa0eb7d3 am: 9328d2f1d8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1764658

Change-Id: Ie784751c7ec83aea0a00b2133e0402a7877d30e6
2021-07-22 19:00:11 +00:00
Treehugger Robot
9328d2f1d8 Merge "Move system_shared_libs into target.bionic clause" am: 2ffa0eb7d3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1764658

Change-Id: I0b2facf4a49d0683683be9ba12f5f975fa7018b5
2021-07-22 18:28:58 +00:00
Treehugger Robot
2ffa0eb7d3 Merge "Move system_shared_libs into target.bionic clause" 2021-07-22 17:44:32 +00:00
Bowgo Tsai
c75fbc7b8a Revert "Adding system property tracing"
Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Bug: 193050299
Test: build and boot a device
Change-Id: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
Merged-In: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
(cherry picked from commit 61a5a8380d)
2021-07-22 12:37:21 +08:00
Bowgo Tsai
2ebdb61620 Revert "bionic_systrace: moving global static variables"
This reverts commit 1e1c7845aa.

Reason for revert: makes property get/set non-reentrant

Bug: 193050299
Test: build and boot a device
Change-Id: If59e3dc25684a3c2b1d3ff74f995311afe6c6e89
Merged-In: If59e3dc25684a3c2b1d3ff74f995311afe6c6e89
(cherry picked from commit 3ec21f527a)
2021-07-22 12:37:00 +08:00
Joel Galenson
4aebf55257 Improve the Rust property bindings.
Add a utility function to get the current value of a property and
remove some keystore2-specific strings.

Bug: 182498247
Test: Build
Change-Id: Ie7e9903546a4d4cd6c54a118c42257a23510dda6
2021-07-21 15:21:29 -07:00
Joel Galenson
e1f1e79310 Migrate keystore2's Rust system library bindings to bionic.
This is purely a port: it does not add or change any functionality
(other than renaming the library).

Bug: 182498247
Test: Use library.
Change-Id: I4cb8f1c22ca4ca5a398116952fb9957d283d235b
2021-07-21 15:21:27 -07:00
Treehugger Robot
17b40a00de [automerger skipped] Merge changes from topic "revert_sysprop_trace" am: dc42a98763 -s ours am: 7d657de0bd -s ours
am skip reason: Merged-In Id2b93acb2ce02b308c0e4889f836159151af3b46 with SHA-1 16d5161a43 is already in history. Merged-In was found from reverted change.

Original change: https://android-review.googlesource.com/c/platform/bionic/+/1767728

Change-Id: I731f62c5dac391e5dddb2dbdf53839859cca2bf1
2021-07-21 12:05:51 +00:00
Treehugger Robot
7d657de0bd [automerger skipped] Merge changes from topic "revert_sysprop_trace" am: dc42a98763 -s ours
am skip reason: Merged-In Id2b93acb2ce02b308c0e4889f836159151af3b46 with SHA-1 16d5161a43 is already in history. Merged-In was found from reverted change.

Reverted change: https://android-review.googlesource.com/c/platform/bionic/+/1403568

Original change: https://android-review.googlesource.com/c/platform/bionic/+/1767728

Change-Id: Iec76c426cc183b92f9d4efca62c886c101129ddd
2021-07-21 11:56:23 +00:00
Treehugger Robot
dc42a98763 Merge changes from topic "revert_sysprop_trace"
* changes:
  Revert "Adding system property tracing"
  Revert "bionic_systrace: moving global static variables"
2021-07-21 11:43:39 +00:00
Bowgo Tsai
8f14b65032 Revert "Adding system property tracing"
Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Bug: 193050299
Test: build and boot a device
Change-Id: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
Merged-In: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
(cherry picked from commit 61a5a8380d)
2021-07-21 09:15:41 +08:00
Bowgo Tsai
13a960f0ed Revert "bionic_systrace: moving global static variables"
This reverts commit 1e1c7845aa.

Reason for revert: makes property get/set non-reentrant

Bug: 193050299
Test: build and boot a device
Change-Id: If59e3dc25684a3c2b1d3ff74f995311afe6c6e89
Merged-In: If59e3dc25684a3c2b1d3ff74f995311afe6c6e89
(cherry picked from commit 3ec21f527a)
2021-07-21 09:10:41 +08:00
TreeHugger Robot
b285176e58 Merge changes from topic "revert_sysprop_trace-sc-dev-plus-aosp" into sc-dev-plus-aosp
* changes:
  Revert "Adding system property tracing"
  Revert "bionic_systrace: moving global static variables"
2021-07-20 16:30:20 +00:00
Christopher Ferris
f9be3797de Merge "Avoid undefined compiler behavior" am: 98115b7494 am: d5baa2bffa
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1768648

Change-Id: I2ccd631366762d384b230af78d4f022e199a84cf
2021-07-16 06:45:53 +00:00
Christopher Ferris
d5baa2bffa Merge "Avoid undefined compiler behavior" am: 98115b7494
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1768648

Change-Id: Ic248dc211231afb7792bc459407b1d41efa783a9
2021-07-16 06:30:57 +00:00
Christopher Ferris
98115b7494 Merge "Avoid undefined compiler behavior" 2021-07-16 06:18:28 +00:00
Christopher Ferris
a6035ecd41 Avoid undefined compiler behavior
This is a follow-on to commit 5358cc40ab.
I forgot that there were two places the undefined behavior could occur.

Make the literal unsigned in the other place.

Test: TreeHugger
Bug: 189541929
Change-Id: Iaef81507ca61e802d277246bf5995157c93d86ce
2021-07-15 12:58:07 -07:00
Christopher Ferris
d4c01e79db [automerger skipped] Fix race when frees after main thread finishes. am: e9b672b3e0 -s ours
am skip reason: Merged-In I1cfe868987a8f0dc880a5b65de6709f44a5f1988 with SHA-1 33d73379aa is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/15291503

Change-Id: If10f97861fd26a4d349ae9dbbe6669b316c15368
2021-07-15 19:57:17 +00:00
Treehugger Robot
10bcf0f6a6 Merge "Avoid undefined compiler behavior" am: 2e4be55966 am: 242aecc17e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1768285

Change-Id: Icca68b4488ea94749e8a95a0abdf30aacd52fd2c
2021-07-15 19:51:45 +00:00
Treehugger Robot
242aecc17e Merge "Avoid undefined compiler behavior" am: 2e4be55966
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1768285

Change-Id: I853671b7def54d6e495f38ce0f169ad06dceb694
2021-07-15 19:33:47 +00:00
Treehugger Robot
2e4be55966 Merge "Avoid undefined compiler behavior" 2021-07-15 18:55:52 +00:00
Greg Kaiser
5358cc40ab Avoid undefined compiler behavior
Technically, shifting a signed value beyond its maximum range is
undefined behavior in C++.  A bare integer literal is signed, and
defaults to 'int'.  On platforms where 'int' is 32-bits, we
shift outside this range with 1 << 31.

We make our literal an unsigned integer to avoid this.

Test: TreeHugger
Bug: 189541929

Change-Id: Iade1bcd3f86d025dd6e10c26622d10c26e2c8295
2021-07-15 08:34:18 -07:00
Bowgo Tsai
61a5a8380d Revert "Adding system property tracing"
Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Bug: 193050299
Test: build and boot a device
Change-Id: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
2021-07-15 20:55:55 +08:00
Bowgo Tsai
3ec21f527a Revert "bionic_systrace: moving global static variables"
This reverts commit 1e1c7845aa.

Reason for revert: makes property get/set non-reentrant

Bug: 193050299
Test: build and boot a device
Change-Id: If59e3dc25684a3c2b1d3ff74f995311afe6c6e89
2021-07-15 20:55:47 +08:00
Christopher Ferris
f1df8fba72 Merge "Fix race when frees after main thread finishes." am: 48e981556e am: 80232a7145
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1755319

Change-Id: I14f71e5cc388cb8c6aa257e0f8cee198d3e1d869
2021-07-15 09:01:55 +00:00
Christopher Ferris
80232a7145 Merge "Fix race when frees after main thread finishes." am: 48e981556e
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1755319

Change-Id: I97f767ba2b220164c140c5c848635a9ca73599d9
2021-07-15 03:25:07 +00:00
Christopher Ferris
e9b672b3e0 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
Merged-In: I1cfe868987a8f0dc880a5b65de6709f44a5f1988
(cherry picked from commit 33d73379aa)
2021-07-15 01:29:17 +00:00
Christopher Ferris
48e981556e Merge "Fix race when frees after main thread finishes." 2021-07-15 01:16:45 +00:00
Colin Cross
4b6dd39e3c Merge "Define sockaddr_storage in bionic" am: d8b97f48c1 am: 3d4251bf70
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1748129

Change-Id: I5fad426d2ff52e476a1458b57a01a95907c65e55
2021-07-15 00:29:15 +00:00
Colin Cross
3d4251bf70 Merge "Define sockaddr_storage in bionic" am: d8b97f48c1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1748129

Change-Id: I40e6af7b85d558f929b7b22fd10c3ccca1b4da8b
2021-07-15 00:12:49 +00:00
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
00fc9de479 [automerger skipped] Merge "Make MTE tests pass with all values of MEMTAG_OPTIONS." into sc-dev am: 1986e6b936 -s ours
am skip reason: Merged-In Id80301e6426af16f89bd80a7a7ab127b6fd60425 with SHA-1 53df1f3772 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/bionic/+/15273278

Change-Id: I69e5915cad140bfd0c90b398d0bc5d8d181c1012
2021-07-13 18:21:30 +00:00
TreeHugger Robot
1986e6b936 Merge "Make MTE tests pass with all values of MEMTAG_OPTIONS." into sc-dev 2021-07-13 17:59:10 +00:00
Treehugger Robot
cac66b92f7 Merge "Remove obsolete visibility entries from libc_headers" am: 829b84d236 am: d50a66277a
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1764027

Change-Id: I7db26cd59921ceedd273d4b3b763593871ee021c
2021-07-13 17:09:58 +00:00
Treehugger Robot
d50a66277a Merge "Remove obsolete visibility entries from libc_headers" am: 829b84d236
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1764027

Change-Id: I19f7daa8d8b04523f6b407e0d1bfde3d5a3f311b
2021-07-13 16:51:25 +00:00
Evgenii Stepanov
72a91823c1 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)
Merged-In: Id80301e6426af16f89bd80a7a7ab127b6fd60425
Change-Id: Id80301e6426af16f89bd80a7a7ab127b6fd60425
(cherry picked from commit 53df1f3772)
2021-07-13 09:42:08 -07:00