summaryrefslogtreecommitdiffstats
path: root/libmemunreachable
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-06-13 16:41:58 -0700
committerColin Cross <ccross@android.com>2017-06-15 10:57:37 -0700
commit72d3881412d012bfa06583e4b06bdff16a2e6d8e (patch)
tree12448f01ac1f7d4c79ef4b4fbb92f342d90f0245 /libmemunreachable
parent6cc5927e0d35e2e349268b9688c84f5a28878a10 (diff)
downloadcore-72d3881412d012bfa06583e4b06bdff16a2e6d8e.tar.gz
core-72d3881412d012bfa06583e4b06bdff16a2e6d8e.tar.bz2
core-72d3881412d012bfa06583e4b06bdff16a2e6d8e.zip
Add a helpful error message if GetUnreachableMemory fails
The primary reason for GetUnreachableMemory failing is selinux blocking system apps from ptracing themselves. Add a helpful error message suggesting setenforce 0. Bug: 27945735 Test: dumpsys meminfo --unreachable com.android.systemui Change-Id: Ibfa9507860be36dffd514f82027f7a2f8a72ac48
Diffstat (limited to 'libmemunreachable')
-rw-r--r--libmemunreachable/MemUnreachable.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmemunreachable/MemUnreachable.cpp b/libmemunreachable/MemUnreachable.cpp
index e7c0beb56..1c8474428 100644
--- a/libmemunreachable/MemUnreachable.cpp
+++ b/libmemunreachable/MemUnreachable.cpp
@@ -502,7 +502,10 @@ std::string UnreachableMemoryInfo::ToString(bool log_contents) const {
std::string GetUnreachableMemoryString(bool log_contents, size_t limit) {
UnreachableMemoryInfo info;
if (!GetUnreachableMemory(info, limit)) {
- return "Failed to get unreachable memory\n";
+ return "Failed to get unreachable memory\n"
+ "If you are trying to get unreachable memory from a system app\n"
+ "(like com.android.systemui), disable selinux first using\n"
+ "setenforce 0\n";
}
return info.ToString(log_contents);