]> git.cworth.org Git - apitrace/commitdiff
egltrace/android: Fix tracing Zygote processes
authorAlexander Monakov <amonakov@ispras.ru>
Mon, 17 Jun 2013 16:36:06 +0000 (20:36 +0400)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 17 Jun 2013 18:10:40 +0000 (19:10 +0100)
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.

wrappers/trace.cpp

index d79b11bbd306a700e7fac55d485c9210c63f57f8..33b5cf183219773a9d68b27fd2fa11d1f9987626 100644 (file)
@@ -70,7 +70,7 @@ getZygoteProcessName(void)
     assert(fd >= 0);
     len = read(fd, buf, size - 1);
     close(fd);
-    path.truncate(len);
+    path.truncate();
 
     return path;
 }