diff options
Diffstat (limited to 'libutils/ProcessCallStack.cpp')
-rw-r--r-- | libutils/ProcessCallStack.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libutils/ProcessCallStack.cpp b/libutils/ProcessCallStack.cpp index f837bcb..db07e56 100644 --- a/libutils/ProcessCallStack.cpp +++ b/libutils/ProcessCallStack.cpp @@ -90,6 +90,11 @@ static String8 getThreadName(pid_t tid) { ALOGE("%s: Failed to open %s", __FUNCTION__, path); } + if (procName == NULL) { + // Reading /proc/self/task/%d/comm failed due to a race + return String8::format("[err-unknown-tid-%d]", tid); + } + // Strip ending newline strtok(procName, "\n"); |