Commit graph

32897 commits

Author SHA1 Message Date
Treehugger Robot
08bcaac208 Merge "Adding system property tracing" 2020-08-21 09:33:53 +00:00
Bowgo Tsai
d0ecf0b30d Adding system property tracing
Introducing a new systrace tag, TRACE_TAG_SYSPROP, for use with
system property.

For property set, the tracing is added in __system_property_set() instead of
__system_property_update() / __system_property_add() so we can record
control properties like ctl.*, sys.powerctl.*, etc.., which won't be
updated via the latter two functions.

Bug: 147275573
Test: atest CtsBionicTestCases
Test: adb shell perfetto -o /data/misc/perfetto-traces/test_trace -t 10s bionic
Test: adb shell perfetto -o /data/misc/perfetto-traces/test_trace -t 10s sysprop
Test: adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks \
      --benchmark_filter=BM_property --bionic_cpu=4, then compares the results
      of property benchmarks before and after the change, didn't see
      significant difference.

Change-Id: Id2b93acb2ce02b308c0e4889f836159151af3b46
Merged-In: Id2b93acb2ce02b308c0e4889f836159151af3b46
(cherry picked from commit 26970c3493)
2020-08-19 12:47:01 +08:00
Treehugger Robot
97cefc6ea9 Merge "Cast from const void * -> const char * when using memchr()." am: 3ec750e035
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1401905

Change-Id: I3013a0ebad8bd43418cadff37978b4e703dc860e
2020-08-18 15:51:04 +00:00
Treehugger Robot
3ec750e035 Merge "Cast from const void * -> const char * when using memchr()." 2020-08-18 15:34:36 +00:00
Stephen Hines
62165a1808 Cast from const void * -> const char * when using memchr().
bionic/tests/fortify_test.cpp:207:31: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat]
  ASSERT_FORTIFY(printf("%s", memchr(myfoo.a, 'a', asize)));
                         ~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug: http://b/155835175
Test: atest for bionic
Change-Id: I0fa4e63deadffb7391e66ab834ff11e4f1d6dba6
2020-08-18 01:40:41 -07:00
Treehugger Robot
f578e9aac6 Merge "Disable HWASAN on ifunc resolvers." am: 3936985e75
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1397561

Change-Id: Id91403fee6280a835026001720c253a58f268dda
2020-08-13 22:05:10 +00:00
Elliott Hughes
58635533a0 Merge "Various coverage improvements." am: 1c502d46b3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1398334

Change-Id: I12e604e2b6c2652e6221a128779a7256ae2891ae
2020-08-13 22:04:52 +00:00
Treehugger Robot
3936985e75 Merge "Disable HWASAN on ifunc resolvers." 2020-08-13 21:58:58 +00:00
Elliott Hughes
1c502d46b3 Merge "Various coverage improvements." 2020-08-13 21:27:09 +00:00
Vy Nguyen
eb1a99cbfb Merge "Add a thread-properties API (Based on proposal at https://sourceware.org/glibc/wiki/ThreadPropertiesAPI)" am: d4d7efc1f8
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1360925

Change-Id: I984cdfc8e5e0273ece8dba4fa82de824f40cd2d9
2020-08-13 20:25:45 +00:00
Peter Collingbourne
03d89a7068 Disable HWASAN on ifunc resolvers.
We can't have HWASAN enabled in these resolvers because they
may be called before HWASAN is initialized.

We were previously getting away with HWASAN being enabled on these
functions because ANDROID_EXPERIMENTAL_MTE was not defined, which
let the compiler simplify away any HWASAN instrumentation in the
resolvers. But with this build flag enabled (which is currently the
case in FVP, and eventually everywhere once the MTE kernel patches
land) the resolvers end up containing an HWASAN instrumented load of
the _hwcap2 field.

Bug: 135772972
Change-Id: Iac79d02ddc81630c955e107eb7f78389aeb33879
2020-08-13 13:01:44 -07:00
Vy Nguyen
d4d7efc1f8 Merge "Add a thread-properties API (Based on proposal at https://sourceware.org/glibc/wiki/ThreadPropertiesAPI)" 2020-08-13 19:58:03 +00:00
Elliott Hughes
7cebf835f3 Various coverage improvements.
Mostly from extra test cases, but also:

* Move the fgets size < 0 assertion into fgets.

* Use ELF aliases for strtoq/strtouq rather than duplicating code.

* Don't check uname() succeeded, since it can't fail.

Test: treehugger
Change-Id: I2e6b3b88b0a3eb16bd68be68b9bc9f40d8043291
2020-08-12 15:52:14 -07:00
Elliott Hughes
dec52e2097 Merge "Cleanup for #inclusivefixit." am: aadcb07890
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1374048

Change-Id: I9fcd3ce31d73235eed6c51a9ffc97d14c13a5076
2020-08-12 22:16:46 +00:00
Treehugger Robot
842681cb7e Merge "Create per-API versions of the CRT objects." am: d4da7b17a2
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1364178

Change-Id: Id244b76d1f718a755d2921334d4cb6c47295829c
2020-08-12 22:16:11 +00:00
Elliott Hughes
aadcb07890 Merge "Cleanup for #inclusivefixit." 2020-08-12 22:13:11 +00:00
Treehugger Robot
d4da7b17a2 Merge "Create per-API versions of the CRT objects." 2020-08-12 22:01:27 +00:00
Treehugger Robot
333d20bd0d Merge "Show coverage for libm too." am: 944fc8d38f
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1397691

Change-Id: Icb95111df08d2b3a5abc7ee03a4e5c7a004b7c02
2020-08-12 19:30:34 +00:00
Treehugger Robot
944fc8d38f Merge "Show coverage for libm too." 2020-08-12 19:15:43 +00:00
Elliott Hughes
f762275e6a Show coverage for libm too.
Test: manual
Change-Id: Idf50d918ad53ff2d5a3097dfcbd5a392d6f0ed31
2020-08-12 10:25:45 -07:00
Dan Albert
37b3e85a9d Merge "Add api-level.h to dac, improve docs." am: a4110def5c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1393882

Change-Id: Ic1e5243c2dfcfa59edb9e68579e56002348d7523
2020-08-11 23:32:23 +00:00
Dan Albert
a4110def5c Merge "Add api-level.h to dac, improve docs." 2020-08-11 23:19:21 +00:00
Dan Albert
dc503f65ec Create per-API versions of the CRT objects.
Test: treehugger
Bug: http://b/159925977
Change-Id: I3ad629f9370503b26f4a73787bccb3f669c41a0a
2020-08-11 14:14:31 -07:00
Dan Albert
d8f46916b6 Add api-level.h to dac, improve docs.
We don't list most of bionic on dac since it would be overwhelming for
the current layout, but this file in particular seems useful,
especially __ANDROID_API__. Unfortunately, c2devsite doesn't include
macro documentation. Until then, it's still useful to include the
functions defined in this header.

I've also elaborated a bit in the __ANDROID_API__ documentation, since
the existing phrasing led to confusion over whether it was closer to
minSdkVersion or compileSdkVersion. In practice these are identical
for the NDK, but if we switch to weakly-linked APIs via the
availability attribute that would change.

Test: built docs, looked at them
Bug: None
Change-Id: I5cf78a6143b5c15790c369bdf888611e4c1189db
2020-08-11 13:50:04 -07:00
Elliott Hughes
75ae9815f6 Merge "Improve the coverage script." am: 8880f5ecf3
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1393883

Change-Id: Ic8d0b4ad823db73b067847b7bcb4ff1ede801655
2020-08-11 19:42:10 +00:00
Elliott Hughes
8880f5ecf3 Merge "Improve the coverage script." 2020-08-11 19:30:50 +00:00
Elliott Hughes
7f354436f2 Improve the coverage script.
This now works for ARM as well as Intel.

Also combine both the 32-bit and 64-bit results (since we have code
that's only executed in one variant or the other, the union of the two
seems like what we actually want to measure).

Also make the script executable.

Test: ./bionic/build/coverage.sh
Change-Id: I4e3a7f4cd60fda060b956a960cfb9b703d3670e7
2020-08-11 10:00:30 -07:00
Vy Nguyen
d500751443 Add a thread-properties API
(Based on proposal at https://sourceware.org/glibc/wiki/ThreadPropertiesAPI)

This includes API to:
 - locate static and dynamic TLS
 - register thread-exit and  dynamic TLS creation/destruction callbacks

Change-Id: Icd9d29a5b2f47495395645e19d3b2c96826f19c8
2020-08-11 16:51:43 +00:00
Evgenii Stepanov
cc3c685b5f Remove stack address check in cfi_basic test.
This is not actually a property that is guaranteed by the bionic
implementation of CFI shadow. Since the gaps between libraries are not
completely inaccessible, it is possible for a stack mapping to sneak in,
which would cause the callback to register in the test library.

This is not a correctness issue in CFI as the actual __cfi_check
callback will reject such address anyway, at a small CPU cost.

Bug: 156218352
Test: CtsBionicTestCases-cfi_test#basic
Change-Id: I8d04fb7132e1eac2a8abfbc48a37c8eac6e25a09
Merged-In: I8d04fb7132e1eac2a8abfbc48a37c8eac6e25a09
(cherry picked from commit 0f6b504e0c)
2020-08-11 00:50:24 +00:00
Elliott Hughes
5a90662915 Merge "Reimplement our no-op utmp.h functions more simply." am: f08e70a0d9
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1394164

Change-Id: I8fb549f2ffb93a3ef79b4d638ba1bed8a91aee6e
2020-08-10 15:57:39 +00:00
Elliott Hughes
f08e70a0d9 Merge "Reimplement our no-op utmp.h functions more simply." 2020-08-10 15:41:13 +00:00
Elliott Hughes
9a1d3976f1 Reimplement our no-op utmp.h functions more simply.
Now we're being marked down for our poor coverage, we may as well remove
more broken cruft. Despite the amount of effort that seems to have gone
into pututline(), it wasn't working with the other utmp.h functions (in
particular, utmpname()), and wasn't declared in the header file!

Test: treehugger
Change-Id: I1a583984189c751168c11c01431433f96f8c548b
2020-08-07 17:07:31 -07:00
Treehugger Robot
66433b0c97 Merge "Make swab(3) inline prior to API 28." am: 5ca9a15245
Original change: https://android-review.googlesource.com/c/platform/bionic/+/984334

Change-Id: If93298073870b214aba2367f7be69f65a6c30c17
2020-08-07 22:40:58 +00:00
Treehugger Robot
5ca9a15245 Merge "Make swab(3) inline prior to API 28." 2020-08-07 22:11:17 +00:00
Elliott Hughes
f17844764d Merge "Switch to musl memmem (via OpenBSD)." am: 422b2044ea
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1393677

Change-Id: I38e63db202a1673058b17912b8cec139e947c4a2
2020-08-07 20:16:08 +00:00
Dan Albert
2dbea434d1 Make swab(3) inline prior to API 28.
Test: make checkbuild
Bug: https://stackoverflow.com/q/54392471/632035
Change-Id: Iaeb55231ea2395d7e1e31be63034f5db19025060
2020-08-07 13:10:51 -07:00
Elliott Hughes
422b2044ea Merge "Switch to musl memmem (via OpenBSD)." 2020-08-07 20:01:17 +00:00
Treehugger Robot
43aef78d7b Merge "Allow native_bridge to intercept __get_thread()->stack_top" am: cc8f1ea9e1
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1382566

Change-Id: I4e9cef8185eb96f3cb47709b5d5bf23cd8fd5efc
2020-08-07 06:07:22 +00:00
Treehugger Robot
cc8f1ea9e1 Merge "Allow native_bridge to intercept __get_thread()->stack_top" 2020-08-07 05:52:52 +00:00
Treehugger Robot
1caae5f7f5 Merge "Trivial strxfrm coverage improvement." am: 6900a09fe7
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1393618

Change-Id: I6f1c5da693359c9e40d10117beb28e34157e7a44
2020-08-06 22:46:51 +00:00
Treehugger Robot
6900a09fe7 Merge "Trivial strxfrm coverage improvement." 2020-08-06 22:23:50 +00:00
Elliott Hughes
5633caa285 Switch to musl memmem (via OpenBSD).
Similar to the musl strstr. This patch also increases test coverage for
memmem, again similar to the strstr tests.

Test: treehugger
Change-Id: I7f4a2ab93a610cb692994d06d2512976e657ae9f
2020-08-06 14:33:48 -07:00
Elliott Hughes
2e71c17778 Trivial strxfrm coverage improvement.
Test: treehugger
Change-Id: I450bd3324c3f0f8ab95cecebe0f57dc85acc2996
2020-08-06 13:53:40 -07:00
Christopher Ferris
2fe12d2666 Merge "Update to v5.8 kernel headers." am: eebb1ec687
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1389023

Change-Id: I178c772e3d46dc650083fa91cfe3a7b18d41c32b
2020-08-06 16:49:01 +00:00
Christopher Ferris
eebb1ec687 Merge "Update to v5.8 kernel headers." 2020-08-06 16:31:03 +00:00
Treehugger Robot
1dd87472d5 Merge "Add linkerconfig to the host exports." am: 7f65348eb0
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1391220

Change-Id: I9c8c2f54f2f3bbc18b90b953ae00c651c49597c6
2020-08-06 10:46:16 +00:00
Treehugger Robot
7f65348eb0 Merge "Add linkerconfig to the host exports." 2020-08-06 10:25:39 +00:00
Martin Stjernholm
d6e35f1cc8 Add linkerconfig to the host exports.
ART runs it on host to create the linker config for its chroot test
environment. This avoids problems building linkerconfig in the reduced
master-art manifest.

Even though linkerconfig currently is in platform/system I'm adding it
to the Bionic module exports based on discussions that the linkerconfig
binary should be part of the Runtime (Bionic) APEX due to its close
ties to the linker.

Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
  then try the prebuilt snapshot with art/tools/buildbot-build.sh in
  master-art
Bug: 162819454
Change-Id: I4d43d7f0b980af48b193d5eb358e4f010eea541b
2020-08-06 11:21:40 +01:00
Treehugger Robot
9ee924ce64 Merge "Add a script to generate coverage." am: 8743c15a64
Original change: https://android-review.googlesource.com/c/platform/bionic/+/1392425

Change-Id: I12692bc77c79adb5e06a5dc11e52dd92cc1c04a6
2020-08-06 01:16:07 +00:00
Treehugger Robot
8743c15a64 Merge "Add a script to generate coverage." 2020-08-06 01:04:57 +00:00