summaryrefslogtreecommitdiff
path: root/libc/async_safe
AgeCommit message (Collapse)Author
2021-03-19bp2build: remove some bp2build_available props, use package_allowlist instead.Jingwen Chen
Test: build/bazel/scripts/milestone-2/demo.sh full Test: bazel query //bionic/... Change-Id: I737574766be898279d8bf6f3f0adb43dcc40c220
2021-03-08Add min_sdk_version for ART module.Nicolas Geoffray
Bug: 180399951 Test: m Change-Id: I54eb06ae4a695ae184de4fb72fc0092910836652
2021-02-19Add LOCAL_LICENSE_KINDS to bionicBob Badour
Added SPDX-license-identifier-Apache-2.0 to: apex/Android.bp libdl/Android.bp tools/Android.bp tools/versioner/Android.bp tools/versioner/src/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: benchmarks/Android.bp benchmarks/linker_relocation/gen/Android.bp libc/malloc_debug/Android.bp libc/system_properties/Android.bp tests/Android.bp tests/libs/Android.bp tests/libs/Android.build.dlext_testzip.mk tests/make_fortify_compile_test.mk Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-ISC SPDX-license-identifier-MIT legacy_notice legacy_unencumbered to: libc/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered to: libm/Android.bp Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered to: libc/tools/Android.bp Added SPDX-license-identifier-BSD to: benchmarks/linker_relocation/Android.bp benchmarks/spawn/Android.bp libc/async_safe/Android.bp libc/malloc_hooks/Android.bp libfdtrack/Android.bp linker/Android.bp tests/headers/Android.bp tests/headers/posix/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ib05bcaa276b3aa71a7654ccbe8e67e1f16aec9f3
2021-02-16Mark cc_library_headers targets as being bp2build_available.Rupert Shuttleworth
Test: build/bazel/scripts/bp2build-sync.sh write. Change-Id: I78a491d20779f50757b55c8e5305b588bf613839
2020-11-11Add "product_available" to product available modulesJustin Yun
"vendor_available" modules were available to product modules. However, not all "vendor_available" modules are required to be available to product modules. Some modules want to be available only to product modules but not vendor modules. To cover the requirement, we separate "product_available" from "vendor_available". "vendor_available" will not provide product available module. Bug: 150902910 Test: build Change-Id: I13b8222e191333c6c2cb7794ef3344fdcc6ebe98
2020-10-29Merge "Make vendor_ramdisk_available."Yifan Hong
2020-10-27Make vendor_ramdisk_available.Yifan Hong
Test: pass Bug: 156098440 Change-Id: I8fe2deb8fa3b24c227202be02d8af648629cffeb
2020-10-21Rename ART release APEX to com.android.art.Martin Stjernholm
Test: See https://r.android.com/1457217 Bug: 169639321 Change-Id: I71c75987ebfb1196d63f452945c5d387f2976d86 Merged-In: I71c75987ebfb1196d63f452945c5d387f2976d86
2020-08-21async_safe: don't call libc's socket.Josh Gao
Like with close, socket is no longer a simple syscall, so we can get recursive calls that deadlock. Bug: http://b/165206592 Test: bionic-unit-tests on cuttlefish Test: treehugger Change-Id: I2ba77d733d1ebf08a91afd6ca179e7ae6ae3866e
2020-06-10linker: CHECK() or async_safe_fatal() rather than abort().Elliott Hughes
In particular, add the strerror() output if mprotect() fails. Fix the CHECK macro so that you can make assertions involving operator% without that being confused for a printf format specifier. Bug: https://issuetracker.google.com/158645318 Test: treehugger Change-Id: I6817f8ca5f094c52dc2c9067bfac90385a8743f5
2020-04-08Set apex_available propertyJiyong Park
The marked library(ies) were available to the APEXes via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. Bug: 150999716 Test: m Change-Id: I6ea7fee2a135298085d3965d3578d9ecd53ee405
2020-01-22Make ramdisk_available.Yifan Hong
Test: pass Bug: 147347110 Change-Id: I142311a7558a19d209bcd63207a88e12cf6f130e
2020-01-17Add a README.md for async_safeTom Cherry
Particularly to document why both this and liblog exist, when they do essentially the same thing. Test: n/a Change-Id: I216194402a12270cfbb6bc9b840d054dc9c1dc16
2019-05-06Enable native_bridge_supportdimitry
Enable native bridge support for bionic libraries. Makes it possible to use them in binaries for translated architectures. Bug: http://b/77159578 Test: make Change-Id: Iccd4ad7aecfa5260cc15f09ca975d2e18987278a
2019-02-19Mark lib_async_safe_headers as supporting linux_bionicAlex Light
This target is needed by linux_bionic targets and so should support it. Test: ./art/tools/build_linux_bionic.sh com.android.runtime.host Change-Id: Ib12f1cf1d70e606b0921f507b3e460f5d543017e
2019-02-14libasync_safe: stop clobbering other folks' identifiers.Elliott Hughes
The log priorities and ids are in an NDK header, available to everyone. Move CHECK into its own header for now. This would be better if it was more like the <android-base/logging.h> CHECK family, but I don't have an easy way to do that without lots of copy & paste, so punting for now. Bug: https://issuetracker.google.com/issues/119713191 Test: boots Change-Id: I4566be8a0a024fede0e2d257c98b908ec67af2a8
2019-01-19Add libc_headers header libLogan Chien
This commit extracts `libc_headers` for `libasync_safe` and `libpropertyinfoparser` (in the `system/core` repository). Before this change, `libasync_safe` expects that `libc` is automatically added to `system_shared_libs` of the libasync_safe vendor variant even if `libc_defaults` explicitly declines any `system_shared_libs`. This commit defines `libc_headers` for `libasync_safe` and `libpropertyinfoparser` so that they can find the headers from libc without causing circular dependencies. Bug: 123006819 Test: make checkbuild Change-Id: I2435ab61d36ff79ca2b4ef70bd898b795159c725
2018-10-08Add async_safe_format_fd_va_listRyan Prichard
Bug: none Test: bionic unit tests Change-Id: I8c6b2d1d118f4182dd7bf1cbfba78f20b3cefc79
2018-08-02Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
2018-07-19Introduce api to track fd ownership in libc.Josh Gao
Add two functions to allow objects that own a file descriptor to enforce that only they can close their file descriptor. Use them in FILE* and DIR*. Bug: http://b/110100358 Test: bionic_unit_tests Test: aosp/master boots without errors Test: treehugger Change-Id: Iecd6e8b26c62217271e0822dc3d2d7888b091a45
2018-06-08Build recovery variant of the dynamic linkerJiyong Park
In order to support shared libraries in the recovery mode, the dynamic linker is now built with recovery_available: true option. In addition, a few more modules (such as libasync, etc.) are also marked as recovery_available: true as they are transitive dependencies of the dynamic linker. Bug: 63673171 Test: `adb reboot recovery; adb devices` shows the device ID Test: `adb root && adb shell` and then $ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from the /lib directory. Change-Id: Idd981d8cf25568a85b24032cf78e50adfd5f4a7f
2018-05-01Fix async_safe_fatal overflow handlingRyan Prichard
Bug: b/79116392 Test: manual Change-Id: I46cd1007be165489db27cdcd4b42ec69de40d645
2018-02-13Switch the rest of our internal headers to #pragma once.Elliott Hughes
We've been using #pragma once for new internal files, but let's be more bold. Bug: N/A Test: builds Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
2017-10-25Implement pthread_attr_getinheritsched/pthread_attr_setinheritsched.Elliott Hughes
Historically, Android defaulted to EXPLICIT but with a special case because SCHED_NORMAL/priority 0 was awkward. Because the code couldn't actually tell whether SCHED_NORMAL/priority 0 was a genuine attempt to explicitly set those attributes (because the parent thread is SCHED_FIFO, say) or just because the pthread_attr_t was left at its defaults. Now we support INHERIT, we could call sched_getscheduler to see whether we actually need to call sched_setscheduler, but since the major cost is the fixed syscall overhead, we may as well just conservatively call sched_setscheduler and let the kernel decide whether it's a no-op. (Especially because we'd then have to add both sched_getscheduler and sched_setscheduler to any seccomp filter.) Platform code (or app code that only needs to support >= P) can actually add a call to pthread_attr_setinheritsched to say that they just want to inherit (if they know that none of their threads actually mess with scheduler attributes at all), which will save them a sched_setscheduler call except in the doubly-special case of SCHED_RESET_ON_FORK (which we do handle). An alternative would be "make pthread_attr_setschedparams and pthread_attr_setschedprio set EXPLICIT and change the platform default to INHERIT", but even though I can only think of weird pathological examples where anyone would notice that change, that behavior -- of pthread_attr_setschedparams/pthread_attr_setschedprio overriding an earlier call to pthread_attr_setinheritsched -- isn't allowed by POSIX (whereas defaulting to EXPLICIT is). If we have a lot of trouble with this change in the app compatibility testing phase, though, we'll want to reconsider this decision! -*- This change also removes a comment about setting the scheduler attributes in main_thread because we'd have to actually keep them up to date, and it's not clear that doing so would be worth the trouble. Also make async_safe_format_log preserve errno so we don't have to be so careful around it. Bug: http://b/67471710 Test: ran tests Change-Id: Idd026c4ce78a536656adcb57aa2e7b2c616eeddf
2017-10-16Trivial style fix.Josh Gao
Test: none Change-Id: I710d29293171c6160558dab66c515eae16b92923
2017-09-19Improve pthread_create failure handling.Elliott Hughes
Return EAGAIN rather than aborting if we fail to set up the TLS for a new thread. Add a test that uses all the VMAs so we can properly test these edge cases. Add an explicit test for pthread_attr_setdetachstate, which we use in the previous test, but other than that has no tests. Remove support for ro.logd.timestamp/persist.logd.timestamp, which doesn't seem to be used, and which prevents us from logging failures in cases where mmap fails (because we need to mmap in the system property implementation). Bug: http://b/65608572 Test: ran tests Change-Id: I9009f06546e1c2cc55eff996d08b55eff3482343
2017-08-22Refactor BufferOutputStream.Christopher Ferris
- Rewrite BufferOutputStream to handle 0 sized buffers and to get rid of an unnecessary loop. - Add tests to verify overflow corner cases. - Implement async_safe_format_buffer to call async_safe_format_buffer_va_list instead of duplicate the code. Test: Ran new unit tests, booted on angler. Change-Id: I7fb13e209f5b7443d212f55aab4b05ff2e0e8219
2017-08-01Remove nullability specifications.Elliott Hughes
Bug: http://b/64251432 Test: builds Change-Id: I5b1613484783f7478d30b5e694007f77fa626659
2017-06-20Shave a stack frame off asserts.Elliott Hughes
No-one cares about seeing "async_safe_fatal" (which you have to admit is a pretty confusing name for an app developer anyway). On arm: #00 pc 0001a43c /system/lib/libc.so (abort+63) #01 pc 0001a627 /system/lib/libc.so (__assert+14) And aarch64: #00 pc 000000000001d75c /system/lib64/libc.so (abort+120) #01 pc 000000000001dad0 /system/lib64/libc.so (__assert+44) Bug: N/A Test: ran `crasher assert` and `crasher64 assert` Change-Id: I00be71c566c74cdb00f8e95d634777155bc3da03
2017-06-14make libasync_safe vendor_available:trueJiyong Park
This, when used with BOARD_VNDK_VERSION flag, enables the module to be built and installed twice, one for /system, other for /vendor. libasync_safe is used by libbacktrace which is in turn used by libs in /vendor and thus marked as vendor_available. Therefore, libasync_safe is also marked as vendor_available. Details: https://android-review.googlesource.com/368372 Bug: 33241851 Test: BOARD_VNDK_VERSION=current m libasync_safe.vendor successful Merged-In: I4b4de3b99a024d52612109cee3d66b4e5fc12dec Change-Id: I4b4de3b99a024d52612109cee3d66b4e5fc12dec (cherry picked from commit ec0d6b416e6f9c7044c79fdc8a4760f23ade8eb4)
2017-05-03Move libc_log code into libasync_safe.Christopher Ferris
This library is used by a number of different libraries in the system. Make it easy for platform libraries to use this library and create an actual exported include file. Change the names of the functions to reflect the new name of the library. Run clang_format on the async_safe_log.cpp file since the formatting is all over the place. Bug: 31919199 Test: Compiled for angler/bullhead, and booted. Test: Ran bionic unit tests. Test: Ran the malloc debug tests. Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a