aboutsummaryrefslogtreecommitdiff
path: root/libc/async_safe
Commit message (Collapse)AuthorAgeFilesLines
* Make libasync_safe available in com.android.virtShikha Panwar2022-04-061-0/+1
| | | | | | | | | | This is required because virtualization_service use libtombstoned_client_rust which has transitive dependency on libasync_safe Test: atest MicrodroidHostTestCases Bug: 202153827 Change-Id: I9e670d02995f9ed9e67791aaecb300b6bfdbdb03
* Add %m and %#x support for async_safe loggingzijunzhao2022-02-171-5/+24
| | | | | | Bugs: None Test: None Change-Id: I889015b89b85e222e26f8aa20e35d46a86a0cb7c
* bp2build: remove some bp2build_available props, use package_allowlist instead.Jingwen Chen2021-03-191-1/+0
| | | | | | | Test: build/bazel/scripts/milestone-2/demo.sh full Test: bazel query //bionic/... Change-Id: I737574766be898279d8bf6f3f0adb43dcc40c220
* Add min_sdk_version for ART module.Nicolas Geoffray2021-03-081-0/+1
| | | | | | Bug: 180399951 Test: m Change-Id: I54eb06ae4a695ae184de4fb72fc0092910836652
* Add LOCAL_LICENSE_KINDS to bionicBob Badour2021-02-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Mark cc_library_headers targets as being bp2build_available.Rupert Shuttleworth2021-02-161-0/+1
| | | | | Test: build/bazel/scripts/bp2build-sync.sh write. Change-Id: I78a491d20779f50757b55c8e5305b588bf613839
* Add "product_available" to product available modulesJustin Yun2020-11-111-0/+1
| | | | | | | | | | | | | | | "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
* Merge "Make vendor_ramdisk_available."Yifan Hong2020-10-291-0/+1
|\
| * Make vendor_ramdisk_available.Yifan Hong2020-10-271-0/+1
| | | | | | | | | | | | Test: pass Bug: 156098440 Change-Id: I8fe2deb8fa3b24c227202be02d8af648629cffeb
* | Rename ART release APEX to com.android.art.Martin Stjernholm2020-10-211-1/+1
| | | | | | | | | | | | | | Test: See https://r.android.com/1457217 Bug: 169639321 Change-Id: I71c75987ebfb1196d63f452945c5d387f2976d86 Merged-In: I71c75987ebfb1196d63f452945c5d387f2976d86
* | async_safe: don't call libc's socket.Josh Gao2020-08-211-2/+13
|/ | | | | | | | | | 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
* linker: CHECK() or async_safe_fatal() rather than abort().Elliott Hughes2020-06-101-7/+7
| | | | | | | | | | | 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
* Set apex_available propertyJiyong Park2020-04-081-0/+14
| | | | | | | | | | | 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
* Make ramdisk_available.Yifan Hong2020-01-221-0/+1
| | | | | | Test: pass Bug: 147347110 Change-Id: I142311a7558a19d209bcd63207a88e12cf6f130e
* Add a README.md for async_safeTom Cherry2020-01-171-0/+10
| | | | | | | | Particularly to document why both this and liblog exist, when they do essentially the same thing. Test: n/a Change-Id: I216194402a12270cfbb6bc9b840d054dc9c1dc16
* Enable native_bridge_supportdimitry2019-05-061-0/+2
| | | | | | | | | | 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
* Mark lib_async_safe_headers as supporting linux_bionicAlex Light2019-02-191-0/+1
| | | | | | | | 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
* libasync_safe: stop clobbering other folks' identifiers.Elliott Hughes2019-02-143-38/+67
| | | | | | | | | | | | 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
* Add libc_headers header libLogan Chien2019-01-191-0/+1
| | | | | | | | | | | | | | | | | 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
* Add async_safe_format_fd_va_listRyan Prichard2018-10-082-3/+9
| | | | | | Bug: none Test: bionic unit tests Change-Id: I8c6b2d1d118f4182dd7bf1cbfba78f20b3cefc79
* Modernize codebase by replacing NULL with nullptrYi Kong2018-08-021-1/+1
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5b4123bc6709641315120a191e36cc57541349b2
* Introduce api to track fd ownership in libc.Josh Gao2018-07-191-2/+9
| | | | | | | | | | | | | 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
* Build recovery variant of the dynamic linkerJiyong Park2018-06-081-0/+1
| | | | | | | | | | | | | | | | | 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
* Fix async_safe_fatal overflow handlingRyan Prichard2018-05-011-1/+1
| | | | | | Bug: b/79116392 Test: manual Change-Id: I46cd1007be165489db27cdcd4b42ec69de40d645
* Switch the rest of our internal headers to #pragma once.Elliott Hughes2018-02-131-4/+1
| | | | | | | | We've been using #pragma once for new internal files, but let's be more bold. Bug: N/A Test: builds Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
* Implement pthread_attr_getinheritsched/pthread_attr_setinheritsched.Elliott Hughes2017-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Trivial style fix.Josh Gao2017-10-161-1/+1
| | | | | Test: none Change-Id: I710d29293171c6160558dab66c515eae16b92923
* Improve pthread_create failure handling.Elliott Hughes2017-09-191-14/+1
| | | | | | | | | | | | | | | | | | 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
* Refactor BufferOutputStream.Christopher Ferris2017-08-221-36/+27
| | | | | | | | | | | - 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
* Remove nullability specifications.Elliott Hughes2017-08-011-27/+8
| | | | | | Bug: http://b/64251432 Test: builds Change-Id: I5b1613484783f7478d30b5e694007f77fa626659
* Shave a stack frame off asserts.Elliott Hughes2017-06-202-4/+14
| | | | | | | | | | | | | | | | | | | 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
* make libasync_safe vendor_available:trueJiyong Park2017-06-141-0/+1
| | | | | | | | | | | | | | | | | | | 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)
* Move libc_log code into libasync_safe.Christopher Ferris2017-05-033-0/+707
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