When compiling on/for at least Lollipop, always use the fortified
versions of FD_X macros. This works around side-effect issues (which
are explicitly called out in the specification) and generally
increases robustness of code.
(cherry picked from commit 00a6d5fe0a)
Bug: 77986327
Test: mmma bionic
Test: m
Test: bionic_unit_tests
Merged-In: I9096c6872770e46ba5ab64e7375ff83fc0518e07
Change-Id: I9096c6872770e46ba5ab64e7375ff83fc0518e07
Vendors that use config.fs will have their own uniquely named
user/group names for uids/gids that fall in the OEM ranges. We
continue to allow lookup via oem_## for these values, however the
returned structs will always include the name from config.fs, so we do
not check it for anything in the tests.
Bug: 77549259
Test: bionic unit tests with uid 5000 as AID_CRAS
Merged-In: I27fc1fdd0e22063fea82b4c9d2a6fb8b865c5d7b
Change-Id: I27fc1fdd0e22063fea82b4c9d2a6fb8b865c5d7b
(cherry picked from commit b4c25c882e)
This change enables the tracer process to be able to call ptrace(2) on
the worker process, which is does not have a direct-ancestor dependency.
Bug: 77146512
Test: adb shell \
/data/nativetest{,64}/bionic-unit-tests{,-static}/bionic-unit-tests-{,-static} \
--gtest_filter='spawn*' # aosp_sailfish and Chrome OS
Test: cts-tradefed run singleCommand cts --skip-preconditions \
-m CtsBionicTestCases --test 'PtraceResumptionTest*' # aosp_sailfish
# and Chrome OS
Change-Id: I9e41b3ddde64c0623ba9299cede9d5b2001c8e30
Merged-In: I9e41b3ddde64c0623ba9299cede9d5b2001c8e30
(cherry picked from commit 7300d83b2e)
The default behavior for a real-time signal is to terminate the process.
If the child we fork sends a SIGRTMIN signal before we've set up the
ScopedSignalHandler for it, then the parent is terminated.
Test: adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static --gtest_filter=spawn.signal_stress --gtest_repeat=1000
Bug: b/77554047
Change-Id: Ib44cbea8ccf506644405d8f426d9ad24e77cfa33
(cherry picked from commit a1bc826c37)
The tests can run in parallel, and if they do, one test can truncate
ld.config.txt while another test is reading it (via the loader). Fix the
issue by using a TemporaryFile as the LD_CONFIG_FILE.
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=dl.exec_with_ld_config_file:dl.exec_with_ld_config_file_with_ld_preload:dl.disable_ld_config_file --gtest_repeat=1000
Bug: b/77555708
Change-Id: I9763caa076ece30d1a0eb9c8892a310ac51543b6
(cherry picked from commit 6c3f97d236)
* Specify "nocrt: true" to avoid calling __cxa_finalize.
* Define a dummy __aeabi_unwind_cpp_pr0 for arm32.
Bug: b/62815515
Bug: b/73873002
Test: boot AOSP hikey960-userdebug
Test: run ndk_cxa_example in special /system/bin/debug namespace
Test: run Bionic unit tests
Change-Id: I59bcb100a2753286b59c51a47d7a183507219a07
(cherry picked from commit 470b66644b)
Other build rules create and use a test config file in the intermediate
directory containing $(LOCAL_BUILT_MODULE). Currently, this makefile
deletes $(dir $(LOCAL_BUILT_MODULE)) (aka $(dir $@)), so it can delete
the config file after it's created and before it's used. Avoid this
issue by using $(dir $@)/zipdir as the working directory for
constructing a zip file.
Bug: b/74524170
Test: mmma bionic
Test: run Bionic unit tests
Change-Id: Icee4d7bc72ba1c136385a0cb2c28491649598e7c
(cherry picked from commit ef59154d41)
Changes
- Refactor the code so that only guards require creating a special header
for every pointer allocated.
- Store only a single copy of every backtrace. This saves memory so that
turning on the backtrace option doesn't result in 10X memory usage.
- Added new option track_allocs that only verifies pointers are valid for
free/malloc_usable_size/realloc.
- Remove suffix from test names.
- Add the TRACK_ALLOCS options to all guard options.
- Add new option verify_pointers that is a lightweight way to verify
pointers that are passed to allocation routines.
- Do auto-formatting of the code.
- Updated documentation for all of these changes.
Bug: 74361929
Test: Ran unit tests.
Test: Ran libmemunreachable unit tests.
Test: Ran an app with backtrace enabled.
Change-Id: I3246c48ae4f9811f64622d90d0a9b4d9d818702c
(cherry picked from commit 4da2503d70)
Behavior is compliant with
https://tools.ietf.org/html/draft-ietf-dprive-padding-policy-04
EDNS0 is only enabled when the netcontext requests it, i.e. in DNS-over-TLS
mode.
Bug: 69623036
Bug: 64133961
Test: Wireshark verified. Integration tests echo padding and pass.
Merged-In: Ie5439b0ad505ebf393a83c87845fd02549afc4a2
Merged-In: I274d659782870818274526d23d3a3c4640cad92d
Change-Id: I5ef600e02a572d281441e890cc981614f150629b
(cherry picked from commit 23e4081009bb58d9c09e615186208b77749e72de)
Several privileged syscalls are still needed before a zygote-fork hangs
over the execution to the apps.
Test: system starts, different apps run
Bug: 63944145
Bug: 76461821
Change-Id: I78da54dac509eb073bc2aa7b820a1f6b0c39a775
Merged-In: I78da54dac509eb073bc2aa7b820a1f6b0c39a775
Bug: 77236525
Test: 'make tests dist' and verify that these libraries are in the
*-continuous_native_tests-*.zip
(cherry picked from commit ce10b16294)
Change-Id: I85c2476e4523fd3cb0fbc1bf7845ca5f042ba7e0
Test: 'make tests dist' and verify that these libraries are in the
*-continuous_native_tests-*.zip
(cherry picked from commit c53e8b88d5)
Bug: http://b/77276121
Change-Id: I310f999c6cf2ef2d53b37bc7c53590fe9e0e2fe3
System libc talks to out-of-process daemon thus it's better to not
duplicate that functionality in native bridge.
Bug: 67993967
Test: make
Change-Id: Iabc887a94082806d048bc98bf8d3b21c7531d60d
(cherry picked from commit 5956847acc)
As a follow up to Ibba98f5d88be1c306d14e9b9366302ecbef6d534, where we
added a work around to convert the CLOCK_REALTIME timeouts to
CLOCK_MONOTONIC for pthread and semaphore timed wait functions, we're
introducing a set of _monotonic_np versions of each of these functions
that wait on CLOCK_MONOTONIC directly.
The primary motivation here is that while the above work around helps
for 3rd party code, it creates a dilemma when implementing new code
that would use these functions: either one implements code with these
functions knowing there is a race condition possible or one avoids
these functions and reinvent their own waiting/signaling mechanisms.
Neither are satisfactory, so we create a third option to use these
Android specific _monotonic_np functions that completely remove the
race condition while keeping the rest of the interface.
Specifically this adds the below functions:
pthread_mutex_timedlock_monotonic_np()
pthread_cond_timedwait_monotonic_np()
pthread_rwlock_timedrdlock_monotonic_np()
pthread_rwlock_timedwrlock_monotonic_np()
sem_timedwait_monotonic_np()
Note that pthread_cond_timedwait_monotonic_np() previously existed and
was removed since it's possible to initialize a condition variable to
use CLOCK_MONOTONIC. It is added back for a mix of reasons,
1) Symmetry with the rest of the functions we're adding
2) libc++ cannot easily take advantage of the new initializer, but
will be able to use this function in order to wait on
std::steady_clock
3) Frankly, it's a better API to specify the clock in the waiter function
than to specify the clock when the condition variable is
initialized.
Bug: 73951740
Test: new unit tests
Change-Id: I23aa5c204e36a194237d41e064c5c8ccaa4204e3
This effectively enables these features only in TLS mode
Test: Integration tests pass
Bug: 69623036
Bug: 64133961
Merged-In: Idbfbc0343e21ad713d9b4204fc48d63fb5b8dcd4
Merged-In: Ie3ae2390f01dbdcccf55fdd4e87b8a258702cfbc
Change-Id: I153a259b0c07717f664ee268b43da867a9b42152
(cherry picked from commit e7190ce3f2)
This change does not enable EDNS0, so it should not
result in any behavior change. However, enabling EDNS0
should now be possible with only a small additional change
to "flip the switch".
This change has also landed in NetBSD upstream
(http://gnats.netbsd.org/52578) so this change reduces
divergence from upstream.
Most of the code in this change is for caching of queries that contain
an additional section.
Bug: 15132200
Bug: 64133961
Test: Added integration tests for fallback to the netd suite.
Merged-In: I9b0abc6e4f3ff7f9c23a5cb921d392d2d3065d99
Merged-In: I9c06bbaf1883de4bdebd822f9a052901bf3efc04
Merged-In: Ie438b77bc1aeea0b0c700a90998cec31ac9a0015
Change-Id: Ic64bed0754e1d529dc0c0ab6a5e2f1ea201ff0d5
(cherry picked from commit 6eed8e1bb6)
For apps built for Android < P, return EBUSY.
For apps built for Android >= P, abort.
This is to keep old apps work, and help debugging
apps built for >= P.
Bug: http://b/74632097
Test: run bionic-unit-tests.
Test: run bionic-benchmark.
Change-Id: I5271565a1a6ad12678f85d558a7f862a2b7aab4b
(cherry picked from commit 9651fdf93a)
This is for passing additional instructions through stages of the
DNS resolution pipeling.
Test: as follows
- builds, flashes, boots
- system/netd/tests/runtests.sh passes
Bug: 34953048
Bug: 64133961
Bug: 70694619
Bug: 72345192
Merged-In: I81c49586d675160b66dc2c51b76ad183cc418213
Merged-In: Ie8a8ee5784407d4ec304b3f40a6b234ebeaf6376
Merged-In: Icdec53cf5b210db5ad833dd3b64fa3d8ae74100a
Change-Id: I5a86cc5192e6cfa09c375ac9f5810102da3aba20
(cherry picked from commit 391143e51b)
Kernel expects a 64 bit offset, so if a
user's offset is 32 bit, the wrapper will
drop the sign. To fix, sign extend the
32 bit value before doing the syscall.
Bug: 31225071
Test: pwritev02 32 bit passes
(cherry picked from commit f55dbc0516)
Change-Id: Ie81d29a37cf4e99c9279cffc89f4fa1b4da9a898