aboutsummaryrefslogtreecommitdiff
path: root/libc/malloc_hooks
Commit message (Collapse)AuthorAgeFilesLines
* Use SKIP_WITH_HWASAN macro from libbase.Florian Mayer2022-04-151-0/+1
| | | | Change-Id: I83681d2191bf4184e52d84d1107d61065927bb24
* Skip other_malloc_functions on HWASan.Florian Mayer2022-04-061-0/+1
| | | | | Bug: 227801493 Change-Id: I98b0c2d1a9dc450b97d2de5c02c68bcfd38088bf
* Silence -Wnon-power-of-two-alignment for a testPirama Arumuga Nainar2022-01-281-0/+4
| | | | | | | | | | Bug: http://b/214080353 The wrong alignment to aligned_alloc() is deliberate. Silence the warning around the test. Test: build with clang-r445002 Change-Id: I73bad7775423c908c2bbe1c550e8ce5aeede129d
* 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
* Revert "[LSC] Add LOCAL_LICENSE_KINDS to bionic"Elliott Hughes2021-02-161-9/+0
| | | | | | | | This reverts commit 48d43034d7b5a419ba56f052856696d53a7bd979. Reason for revert: bionic is multiple projects, not just one. Change-Id: Ib31e1bb8888cc85c6e7736c4e2a1d4652fd23935
* [LSC] Add LOCAL_LICENSE_KINDS to bionicBob Badour2021-02-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added SPDX-license-identifier-Apache-2.0 to: libdl/Android.bp tools/versioner/src/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: benchmarks/Android.bp libc/malloc_debug/Android.bp libc/system_properties/Android.bp linker/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: Android.bp libc/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-ISC SPDX-license-identifier-MIT legacy_unencumbered to: tools/Android.bp tools/versioner/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 tests/headers/Android.bp tests/headers/posix/Android.bp Added legacy_notice to: apex/Android.bp benchmarks/linker_relocation/gen/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I76cad00578b9b99180ee5dd1e04b4646d5c5fedf
* Work around issues with `aligned_alloc()` and -O2.Stephen Hines2020-09-241-0/+1
| | | | | | | | | | | | The latest LLVM update to r399163 has exposed an issue with optimization of `aligned_alloc()` at -O2. Invalid inputs are treated as valid, which results in assertions being hit. This WAR is to make sure that the test keeps running while we fix the issue upstream. Bug: http://b/169206016 Bug: http://b/155835175 Test: atest malloc_hooks_system_tests:malloc_hooks_system_tests.MallocHooksTest#aligned_alloc_hook_error -- --abi x86 Change-Id: I74b290b73826481c62db3a99ac1a690c8a8a8db3
* malloc_hooks README.md: fix example compilation failuresSteven Moreland2020-04-251-2/+2
| | | | | | Bug: N/A Test: N/A Change-Id: I017f47990417446f1bff5fc7a5bf7e53e8e1f85e
* Add automatic running of tests on bionic changes.Christopher Ferris2019-11-151-1/+3
| | | | | | | | | | | | | | | | | | | 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
* Rename iterate to malloc_iterate internally.Christopher Ferris2019-11-083-4/+4
| | | | | | | | | | | | I have no idea why I used the iterate name internally which is completely unlike every other function name. Change this to match everyone else so that it's now malloc_iterate everywhere. This is probably the last chance to change this before mainline modules begin, so make everything consistent. Test: Compiles, unit tests passes. Change-Id: I56d293377fa0fe1a3dc3dd85d6432f877cc2003c
* libc_malloc_[debug|hooks] are not available for platformJiyong Park2019-10-071-0/+9
| | | | | | | | | | | | | | The libs are not available for platform. Thus removing '//apex_available:platform' from the apex_available property. However, since there are test modules that statically links the libs, we exceptionally make the static variant of the libs available to the platform. Test: m Test: mm under bionic does not create out/target/product/<name>/system/lib[64]/libc_malloc_[debug|hooks].so Change-Id: Ia6d473658c4231b04b5db511f9dacbbdf0f207b0
* Make bionic_malloc.h a platform header.Christopher Ferris2019-09-162-2/+8
| | | | | | | | | | | | Instead of having platform directories directly include the private header, create a platform header directory and export it. Bug: 130763340 Test: Builds. Change-Id: Ie0f092b3fe077a3de8b90266c0b28bfbc20d0dfa Merged-In: Ie0f092b3fe077a3de8b90266c0b28bfbc20d0dfa (cherry picked from commit 8f582ef2f8a77d953d0e9f33387f592d20f852e2)
* Move all leak info functions to android_mallopt.Christopher Ferris2019-04-191-13/+10
| | | | | | | | | | | Bug: 130028357 Test: malloc_hooks unit tests. Test: Enable backtrace for mediaserver, run dumpsys media.player -m Test: Enable backtrace for calendar, run am dumpheap -n <PID> <FILE> Change-Id: I6774e28ccd9b3f2310127a5b39ccd15fe696a787 Merged-In: I6774e28ccd9b3f2310127a5b39ccd15fe696a787 (cherry picked from commit 3aadc5e80a5e2cf6b6760ed90d528709223bb449)
* Remove gMallocLeakZygoteChild.Christopher Ferris2019-04-161-2/+2
| | | | | | | | | | | | | | | Remove this global variable and change the setting of it to non-zero to a call to android_mallopt. In addition, change the initialize function to use pass a bool* instead of int*. Bug: 130028357 Test: Ran malloc_debug/malloc_hooks/perfetto tests. Change-Id: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 Merged-In: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 (cherry picked from commit 5225b342f0810c027df3d09fbbcef4d324b19b93)
* Refactor the malloc_info code.Christopher Ferris2019-03-074-9/+9
| | | | | | | | | | | | | | malloc_info needs to be per native allocator, but the code treated it like a global function that doesn't depend on the native memory allocator. Update malloc debug to dump the actual pointers that it has been tracking. Test: bionic-unit-tests pass. Test: malloc debug tests pass. Test: malloc hook tests pass. Change-Id: I3b0d4d748489dd84c16d16933479dc8b8d79013e Merged-In: I3b0d4d748489dd84c16d16933479dc8b8d79013e (cherry picked from commit a3656a98b10d2a4a6194a5d9705ad9c2cc5877b0)
* Make aligned_alloc match the standard.Christopher Ferris2019-03-011-1/+1
| | | | | | | | | | | | | | | | Jemalloc does not verify that the size parameter is a multiple of alignment. Fix this since it only went into P. Fix the unit tests, and fix malloc debug/malloc hooks to handle this new restrictive behavior. Bug: 126944692 Test: Ran bionic unit tests. Test: Ran bionic unit tests with malloc hooks enabled (no new tests fail). Test: Ran bionic unit tests with malloc debug enabled (no new tests fail). Test: Ran malloc debug unit tests. Change-Id: I4d50785928815679c781ca729f998454d76b9192
* Fix malloc_hooks for hooks_write_malloc_leak_info.Florian Mayer2018-07-183-0/+7
| | | | Change-Id: I99f9ee0221bc7bbb5e7dd173ae5a6007f0fa871d
* Fix name of env variable in malloc_hooks README.Florian Mayer2018-05-311-3/+3
| | | | Change-Id: I172ef71c9d74ec6e4bc51fe2bd8e4587b801b71c
* Implement malloc hooks.Christopher Ferris2018-02-136-0/+880
Use the malloc debug framework to implement the malloc debug hooks since it can introduce a performance issue. Also, modify the bionic/tests/utils.h slightly to dump an error message when the exe failed. Bug: 30561479 Test: Ran malloc hook unit tests. Test: Ran malloc debug unit tests. Test: Enabled malloc hooks and ran bionic unit tests and verified no Test: unexpected failures. Test: Enabled malloc debug and malloc hooks and verified malloc debug wins. Test: Enabled malloc debug using env, property, and property with name Test: still works. Change-Id: Ib50046a0493c5c2050cf831befb812310bdcc249 (cherry picked from commit d6a1dc23796696f73f483943534d4c5c4b312d39)