OSDN Git Service

Clean entire arg block when setting process name.
authorJeff Brown <jeffbrown@google.com>
Wed, 10 Sep 2014 23:48:46 +0000 (16:48 -0700)
committerJeff Brown <jeffbrown@google.com>
Thu, 11 Sep 2014 21:19:52 +0000 (14:19 -0700)
commit00c0cd4a24bd0f040055f9e786e2df1fa3b7d2d3
tree87654f391f5e9dca11fd5e84901545890d3d5b16
parent98ff7bce66f03da14e39fa7e532a7202bde7dce6
Clean entire arg block when setting process name.

When Android processes fork from Zygote, we rewrite the command line
with a new name, eg. "system_server".  When we do this, we should
fill the entire block with zeros to remove corrupted argument
information that may otherwise remain in the /proc/<pid>/cmdline buffer
and be seen in tools and stack dumps.

Fixed an issue where VM options could be overwritten after setting
the nice name if the name was too long.

Bug: 17474152
Change-Id: Ie6cf9ed7752a04300a340e26cd6812bb35c59e1b
cmds/app_process/app_main.cpp
core/jni/AndroidRuntime.cpp
include/android_runtime/AndroidRuntime.h