Merge "libutils: Don't segfault ProcessCallStack when getting thread name fails" into lmp-dev
This commit is contained in:
commit
6ba555f2ad
1 changed files with 5 additions and 0 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue