From: Alexander Monakov Date: Mon, 17 Jun 2013 16:36:06 +0000 (+0400) Subject: egltrace/android: Fix tracing Zygote processes X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=4460388e76648d908b71f3f5ea46d8ce2af39234;p=apitrace egltrace/android: Fix tracing Zygote processes The root cause of the problem was a bug in the implementation of getZygoteProcessName. When the wrap.$procname approach is used, reading /proc/cmdline produces "$procname\0/system/bin\0--application\0"... (with embedded zero characters). Fixed by simply not supplying length argument to the truncate call, which will truncate to strlen(). The same bug is also present in getProcessName. --- diff --git a/wrappers/trace.cpp b/wrappers/trace.cpp index d79b11b..33b5cf1 100644 --- a/wrappers/trace.cpp +++ b/wrappers/trace.cpp @@ -70,7 +70,7 @@ getZygoteProcessName(void) assert(fd >= 0); len = read(fd, buf, size - 1); close(fd); - path.truncate(len); + path.truncate(); return path; }