summaryrefslogtreecommitdiffstats
path: root/libmemunreachable/include
Commit message (Collapse)AuthorAgeFilesLines
* Make memunreachable_test more robust against false negative leaksColin Cross2018-05-141-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, the memunreachable tests are rock solid on the devices covered by APCT, but catch a ton of false-negatives on hikey960, which show up as failures that look like: system/core/libmemunreachable/tests/MemUnreachable_test.cpp:200: Failure Expected equality of these values: 1U Which is: 1 info.leaks.size() Which is: 0 These happen when a stray copy of a pointer is lying around that points to the memory it is expected to leak. The stray pointers can be on the stack or in the jemalloc thread cache of freed allocations, which is always considered active memory. Add some extra cleanups to get rid of old pointers. 1. Clear the tcache when destructing UnreachableMemoryInfo 2. Clear the stack and tcache before and after each test 3. Make MemunreachbleTest.twice match MemunreachableTest.stack Also fix MemunreachableTest.notdumpable, which was only passing when run as root, which was bypassing what the test was trying to cover. Make the test pass when run as non-root, and skip when the test is running as root. Bug: 79701104 Test: memunreachable_test Test: memunreachable_test as root Change-Id: Ia6c6df11e76405d08118afcc19c1fe80a6684c56
* Move libmemunreachable into namespace androidColin Cross2017-06-221-0/+5
| | | | | | | | Putting libmemunreachable in the global C++ namespace was an oversight, move it into namespace android. Test: m -j checkbuild Change-Id: I0799906f6463178cb04a719bb4054cad33a50dbe
* libmemunreachable: clang-format everythingColin Cross2017-06-221-2/+2
| | | | | | | clang-format -i --sort-includes $(find . -name "*.cpp" -o -name "*.h") Test: builds Change-Id: Ia8e0677fe7f3f26dddba3a851cd2dfab9f14e421
* Combine leaks with same stacktraceColin Cross2016-03-041-3/+12
| | | | | | | | | Combine similar leaks (those with identical stack traces) into a single leak report, and sort the resulting leaks by total leak size across all similar leaks and their references. Bug: 27208635 Change-Id: Ia2bf2ccf3fcbc110d1c7ba60e3b77348d1c63d8d
* Fold leaks that are referenced by other leaksColin Cross2016-03-041-0/+6
| | | | | | | | | Find leaks that have no references at all, or are only referenced by other leaks in the same strongly connected component, and hide all referenced leaks. Bug: 27208635 Change-Id: Ifbfd14e24e2ba0f8af7c1b887e57f34362720f2d
* imprecise mark and sweep native memory leak detectorColin Cross2016-02-191-0/+71
libmemunreachable uses an imprecise mark and sweep pass over all memory allocated by jemalloc in order to find unreachable allocations. Bug: 27208635 Change-Id: Ia70bbf31f5b40ff71dab28cfd6cd06c5ef01a2d4 (cherry picked from commit bcb4ed3eaa92d23949d4ab33dbf1b2604bba8a18)