Commit graph

30478 commits

Author SHA1 Message Date
Peter Collingbourne
f2b1e03606 Export the unwinder implementation from libc.
This supports the soong commit which causes most platform binaries to stop
statically linking against the unwinder implementation. The soong commit
message has more motivation for this change.

ARM32 uses LLVM libunwind, while all other platforms use libgcc as the
unwinder implementation. This matches the current choices of unwinders on
the various architectures, but means that apps which were directly linking
against the libc.so unwinder symbols on ARM32 are now using LLVM libunwind
instead of libgcc.

Set libc_headers sdk_version to 1 so that libunwind_llvm can depend on it,
and stop statically linking libunwind into libc_malloc_debug.

Bug: 144430859
Change-Id: I52c7f7893d93f500383aeb0b76086c3b6f1935a5
2020-01-10 19:07:59 -08:00
Logan Chien
27a8c60f04 Merge "versioner: Migrate to clang-r370808" 2019-12-06 21:01:35 +00:00
Christopher Ferris
80a51f41b2 Merge "Add mallopt M_PURGE benchmark." 2019-12-06 01:25:55 +00:00
Christopher Ferris
5a3c920051 Add mallopt M_PURGE benchmark.
Update the native allocator documentation to include running of this
benchmark.

Move the malloc_benchmark.cpp to malloc_sql_benchmark.cpp and use
malloc_benchmark.cpp for benchmarking functions from malloc.h.

Bug: 137795072

Test: Ran new benchmark.
Change-Id: I76856de833032da324ad0bc0b6bd85a4ea8c253d
2019-12-05 15:46:22 -08:00
Logan Chien
1da9f96463 versioner: Migrate to clang-r370808
Bug: 139945549
Test: lunch aosp_arm64-userdebug && \
      m versioner && \
      PATH=out/host/linux-x86/bin:$PATH \
      ./bionic/tools/versioner/run_tests.py

Change-Id: I1a548de9d1ce82aee30144a359e215a4daf5fc2b
2019-12-05 14:03:05 -08:00
Treehugger Robot
1752b5b9c0 Merge "Replace LIB_PATH macro with kLibPath" 2019-12-04 22:22:32 +00:00
Ryan Prichard
4d4087dc95 Replace LIB_PATH macro with kLibPath
The string is still "lib" or "lib64" with native bridge. It doesn't need
to be configured in the Android.bp file anymore, so move it to a header
file. This change will ensure that ${LIB} expands to the same thing in
both ld.config.txt and DT_RUN_PATH.

Bug: http://b/145197367
Test: manual
Change-Id: Iab87f3156f2984dd3a20e4ccda423892c8b58763
Merged-In: Iab87f3156f2984dd3a20e4ccda423892c8b58763
2019-12-04 13:31:56 -08:00
Elliott Hughes
b3c1c0a813 Merge "Sync with upstream OpenBSD strstr()."
am: 9416e02757

Change-Id: I95dcc105597aabedf8b934779a1668a9811edef7
2019-12-02 12:18:36 -08:00
Elliott Hughes
9416e02757 Merge "Sync with upstream OpenBSD strstr()." 2019-12-02 20:12:56 +00:00
Dmytro Chystiakov
19b8e2d660 Merge "Fix linker path for emulated architecture"
am: 05dbd9653b

Change-Id: Ia3044c18960ee362f5bde4909b5a02bf7d4c0698
2019-12-02 01:12:01 -08:00
Treehugger Robot
05dbd9653b Merge "Fix linker path for emulated architecture" 2019-12-02 09:04:39 +00:00
Dmytro Chystiakov
595c381841 Fix linker path for emulated architecture
dl#exec_linker* tests are failing on devices with emulated
architecture due to hardcoded path to linker.

Test: bionic-unit-tests --gtest_filter=dl.exec_linker*
Bug: b/141914915

Change-Id: Id6d8d3ee7114e70b07e44034aa62dce0a3e0760e
Signed-off-by: Dmytro Chystiakov <dmytro.chystiakov@intel.com>
2019-11-26 15:32:02 +01:00
Elliott Hughes
c6b38aefa7 Sync with upstream OpenBSD strstr().
Bug: http://b/124855136
Test: treehugger
Change-Id: I6cbeb82bc0e418f50e6c171ac4e38e335c448db8
2019-11-22 11:16:23 -08:00
Martin Stjernholm
35dbf6acb5 Merge "Reland "Add libdl_android to the Runtime (aka Bionic) APEX"."
am: 1134b695bc

Change-Id: If04aadb156fbb3e66a7de54569404723c1516def
2019-11-21 08:29:55 -08:00
Martin Stjernholm
1134b695bc Merge "Reland "Add libdl_android to the Runtime (aka Bionic) APEX"." 2019-11-21 16:17:42 +00:00
Martin Stjernholm
3274cc4692 Reland "Add libdl_android to the Runtime (aka Bionic) APEX".
Before this it ended up in /system.

Test: build & boot
Test: adb shell find system apex -name libdl_android.so | xargs adb shell ls -l
  =>
  apex/com.android.runtime/lib/bionic/libdl_android.so
  apex/com.android.runtime/lib64/bionic/libdl_android.so
  apex/com.android.runtime@1/lib/bionic/libdl_android.so
  apex/com.android.runtime@1/lib64/bionic/libdl_android.so
  system/lib/bootstrap/libdl_android.so
  system/lib/libdl_android.so -> /apex/com.android.runtime/lib/bionic/libdl_android.so
  system/lib64/bootstrap/libdl_android.so
  system/lib64/libdl_android.so -> /apex/com.android.runtime/lib64/bionic/libdl_android.so
Test: atest CtsBionicTestCases
Test: Repro in b/144343305#comment8 together with ag/9754153
Bug: 135753770
Bug: 144343305
Change-Id: I9ccd10b711223ca474e91741711b7b8efd521b2d
2019-11-21 16:15:20 +00:00
Elliott Hughes
1a16af79e5 Merge "Take a bunch of trivial patches from upstream OpenBSD."
am: feb88ff424

Change-Id: I3ad9a0d8195b5a5987742fcb0f8a034ce7ed9631
2019-11-20 18:49:09 -08:00
Treehugger Robot
feb88ff424 Merge "Take a bunch of trivial patches from upstream OpenBSD." 2019-11-21 02:34:06 +00:00
George Burgess IV
d869927574 Merge "fortify: allow diagnostics without run-time checks (attempt #2)"
am: b902de6499

Change-Id: I6af0f6f0fbd79f96cd3d9fe04f6d78e6c0e5c51c
2019-11-20 17:16:50 -08:00
Treehugger Robot
b902de6499 Merge "fortify: allow diagnostics without run-time checks (attempt #2)" 2019-11-21 01:02:56 +00:00
Elliott Hughes
9a4b68e20d Take a bunch of trivial patches from upstream OpenBSD.
Test: treehugger
Change-Id: Ie18a94cddada926eff23b53ac9e4d5e5cabd91ed
2019-11-20 14:57:01 -08:00
Peter Collingbourne
31c20dc04e Merge "Issue a prctl to let the kernel accept tagged pointers in syscall arguments."
am: 0e4af16ad5

Change-Id: I7ca909ca7f793a38f316a9e5d38e4550c54a25d3
2019-11-19 19:30:33 -08:00
Peter Collingbourne
0e4af16ad5 Merge "Issue a prctl to let the kernel accept tagged pointers in syscall arguments." 2019-11-20 03:15:55 +00:00
Peter Collingbourne
1fb79443d6 Issue a prctl to let the kernel accept tagged pointers in syscall arguments.
This is a no-op (kernel returns -EINVAL) if the kernel doesn't understand
the prctl.

Bug: 144799191
Change-Id: I8708e92e31d7a60b2847ae2bc242e46dafb77680
2019-11-19 17:27:42 -08:00
George Burgess IV
8a0cdb15a1 fortify: allow diagnostics without run-time checks (attempt #2)
In configs like ASAN, we can't use _chk functions. This CL builds off of
previous work to allow us to still emit diagnostics in conditions like
these.

Wasn't 100% sure what a good test story would look like here. Opinions
appreciated.

Bug: 141267932
Test: checkbuild on internal-master. TreeHugger for x86_64.
Change-Id: I65da9ecc9903d51a09f740e38ab413b9beaeed88
2019-11-19 14:20:26 -08:00
Peter Collingbourne
e60c78f314 Merge "Stop exporting certain deprecated unwinder symbols from libc.so and libm.so."
am: 2a8bca7495

Change-Id: I2cc5fcb8f5d59150e43f9e54525c0a26917759c0
2019-11-18 10:20:06 -08:00
Treehugger Robot
2a8bca7495 Merge "Stop exporting certain deprecated unwinder symbols from libc.so and libm.so." 2019-11-18 18:10:36 +00:00
Christopher Ferris
88f4c2094d Merge "Add automatic running of tests on bionic changes."
am: b332a2c001

Change-Id: I80775ee78ab16fb7dc9327ec688c3c57ced82d5a
2019-11-16 08:36:55 -08:00
Christopher Ferris
b332a2c001 Merge "Add automatic running of tests on bionic changes." 2019-11-16 16:32:53 +00:00
Mitch Phillips
3a62a3b053 Merge "Call __libc_init_malloc from scudo."
am: b6f26e3b72

Change-Id: I2e04309433d8644d37f76ab085cb2a02639bd9a6
2019-11-15 19:05:59 -08:00
Treehugger Robot
b6f26e3b72 Merge "Call __libc_init_malloc from scudo." 2019-11-16 00:48:29 +00:00
Peter Collingbourne
73166c8bfb Stop exporting certain deprecated unwinder symbols from libc.so and libm.so.
We have data that indicates that we no longer need to export the libgcc
unwinder's implementation detail symbols from libc.so, as well as the entire
unwinder interface from libm.so, so stop exporting them.

Bug: 144430859
Change-Id: Iebb591c4a121abe6368d9854ec96819abe70a006
2019-11-15 15:59:58 -08:00
Christopher Ferris
e4619f7719 Add automatic running of tests on bionic changes.
malloc debug and malloc hooks have been broken for a long time
and no one noticed. So add them to be run by default on bionic
changes since that provides the most coverage.

Change the malloc debug and malloc hooks tests to support isolated
runs.

Changed the name of the malloc hooks unit tests to system tests
because they weren't really unit tests.

Changed the verify leak malloc debug tests to print out extra
information so it is possible to figure out what sized allocation
failed.

Test: Ran tests.
Change-Id: Idea4c864f1d62598148ee78d7c9397e45234b1ca
2019-11-15 14:19:33 -08:00
Elliott Hughes
3ada652896 Merge "sysconf(_SC_ARG_MAX): go back to imitating the kernel."
am: 0b12b00655

Change-Id: I3bd11a1860c7258fb9d00733db7da0e0bc4d3efd
2019-11-15 13:08:32 -08:00
Elliott Hughes
0b12b00655 Merge "sysconf(_SC_ARG_MAX): go back to imitating the kernel." 2019-11-15 20:49:58 +00:00
Mitch Phillips
f7f29f7d29 Merge "Init fork handler after __libc_init_malloc."
am: 17dfa33200

Change-Id: Iff40f552e44f628e382694261a0513e243cdf07e
2019-11-15 11:20:21 -08:00
Treehugger Robot
17dfa33200 Merge "Init fork handler after __libc_init_malloc." 2019-11-15 19:07:46 +00:00
Elliott Hughes
db602e8a47 sysconf(_SC_ARG_MAX): go back to imitating the kernel.
For reasons explained in the code comment, go back to roughly our old
code. The "new" tests are just the old tests resurrected.

This also passes the current toybox xargs tests, which were the
motivation for going back on our earlier decision.

Test: bionic and toybox tests
Change-Id: I33cbcc04107efe81fdbc8166dc9ae844e471173e
2019-11-15 09:24:35 -08:00
Mitch Phillips
c11e39bcff Call __libc_init_malloc from scudo.
Currently, scudo doesn't call libc's malloc initialisers. This causes
problems with any functionality that relies on an initialised__libc_globals
inside of bionic malloc's stubs (e.g. malloc()).

This manifests in two ways (that I can think of):
 1. Dispatch tables don't work with scudo, so malloc_debug has never
 worked in an executable linked against scudo.
 2. Allocators that require initialisation and are called from bionic
 malloc's stubs (GWP-ASan) never get initialised.

Bug: 135634846
Test: atest bionic-unit-tests-scudo
Change-Id: I3e3344d7d510ce4e8d3709cd69c8cb0fe5adedda
2019-11-15 08:42:03 -08:00
Mitch Phillips
1d2aadc036 Init fork handler after __libc_init_malloc.
pthread_atfork may call malloc() during its once-init. This causes
problems with allocators (GWP-ASan) that require explicit initialisation
before calls to malloc().

Bug: 135634846
Test: atest bionic
Change-Id: I1810a00465db99d5aa34fa6f74dea5908a628d3a
2019-11-14 16:02:09 -08:00
Christopher Ferris
4cf1abb187 Merge "Update the native allocator document."
am: 6dc945babd

Change-Id: I17c0d6cc330dfc5bffd9391de37cd36952b48c0a
2019-11-13 16:04:23 -08:00
Christopher Ferris
6dc945babd Merge "Update the native allocator document." 2019-11-13 23:30:48 +00:00
Christopher Ferris
004ad8567a Merge "Remove unused code."
am: fcf1fe48ab

Change-Id: Ica400585a3d084437680a67cfbc58481a3faef54
2019-11-13 14:51:47 -08:00
Christopher Ferris
fcf1fe48ab Merge "Remove unused code." 2019-11-13 22:40:12 +00:00
Christopher Ferris
75edf16f4d Update the native allocator document.
Add extra information I've been using to evaluate scudo.

Test: NA
Change-Id: Ie7ee65890b1a3804c38ba38de504144d43e410b2
2019-11-13 14:00:56 -08:00
Christopher Ferris
ae57a6b641 Remove unused code.
Test: Compiles.
Change-Id: I92095bd0ee59a3b98ee8deba1c3efc4685389a1b
2019-11-13 12:50:50 -08:00
Elliott Hughes
f1b5a7f401 Merge "Update docs/status.md function counts for recent releases."
am: 5e85d1b290

Change-Id: Id94f23b95ab525ce462b29557ca9bf65d12413ec
2019-11-13 08:12:45 -08:00
Elliott Hughes
5e85d1b290 Merge "Update docs/status.md function counts for recent releases." 2019-11-13 15:38:57 +00:00
Jiyong Park
31bf42ca87 Merge "Rename # vndk tag to # llndk"
am: f0210e9300

Change-Id: Iee204bcd98d7355fdc1e57209993f767e36c4bbb
2019-11-12 22:46:06 -08:00
Treehugger Robot
f0210e9300 Merge "Rename # vndk tag to # llndk" 2019-11-13 06:36:36 +00:00