This silences two warnings:
frameworks/base/cmds/app_process/app_main.cpp:238:11: warning: Potential
memory leak
frameworks/base/cmds/app_process/app_main.cpp:261:9: warning: Potential
memory leak
As the (existing) comment notes, we nuke argv later in main(), so these
copies are necessary. Since these args need to live for basically the
entire life of the process, it seems pointless to go out of our way to
free them.
Bug: 27101951
Test: mma. Static analyzer warnings are gone.
Change-Id: Icbfabfede9db909f6acb274b697cb6076c3fc11f
To prevent it from hanging up.
Bug: 37500397
Bug: 34085250
Test: DismissDialogsInstrumentation test
Change-Id: Ia69f6a5676666bc9286272b82f242d7b1d0ee286
selinux should provide equivalent protection, and this prevents
transitioning to a helper binary for crash dumping.
Bug: http://b/30705528
Change-Id: I64b05236931d418f268b193418e937ab6b0985e0
Two birds with one stone: simplify the setup (including the modules
required in PRODUCT_PACKAGES) and work around a build system issue
wrt/ sanitized static libraries.
Bug: 33224213
Test: mmma frameworks/base/cmds/app_process && \
mmma SANITIZE_TARGET=address SANITIZE_LITE=true \
frameworks/base/cmds/app_process && \
ls $OUT/system/bin/asanwrapper && \
readelf -s $OUT/system/bin/app_process32 | grep asan && \
readelf -s $OUT/system/bin/asan/app_process32 | grep asan && \
Change-Id: Ieff0ea9a2209cf74cf06f813087b55cb0bcc3896
Clean up the definition of sanitized binaries. Clean up the
Android.mk to share values.
Bug: 33224213
Test: mmma SANITIZE_TARGET=address SANITIZE_LITE=true frameworks/base/cmds/app_process && ls $OUT/system/bin/asan
Change-Id: I70f8d95ff2ec6366fc0a7d252b91dce268186910
* No new functionality was added, this was already possible via
-Djava.class.path=classpath
* However, this makes it a bit more compatible with other tools
that use -cp to invoke the main class.
* Also update the benchmarks README for correct up-to-date vogar
instructions.
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelBenchmark.java
Bug: 31807538
Change-Id: Idb04600fed3dd955437ccac832617dcfd1b52b63
Don't make allowances for older kernels. Kernels must handle this
properly since it is now a CTS requirement.
Also remove some unreachable return statements.
Change-Id: I280c4ed5e461d37672236747b5dbb7d1e97ecfec
bsd_signal is a deprecated synonym for the signal. Nevertheless
there are apps and libraries calling this function.
libsigchain needs to intercept these calls and handle them the same
way it handles signal() call.
Bug: http://b/30562229
Test: readelf --dyn-sym app_process32 and check that bsd_signal is exported
readelf --dyn-sym app_process64 and check that bsd_signal is not exported
Change-Id: Iec584070b42bc7fa43b114c0f884aff2db5a6858
pthread_setname_np() expects 16 or fewer characters for the name argument. When the process name is longer, we should trim it.
Change-Id: I40be3a4212bdaab900c8eb30fa27aeeb7ed1b0d1
Preload public native libraries when starting a zygote
This lets other users of libnativeloader (like dex2oat)
avoid unnecessary cold loads of libandroid.so which could
take up to a second.
Bug: http://b/27245894
(cherry picked from commit b0824979be2653ba300382b52c1b1236fd44f0de)
Change-Id: I04a640c104dba5b585a59d63270e81b6c9ad6f7e
When starting the runtime from app_process, we only pass JDWP options
if starting zygote. It prevents from opening a JDWP connection in
non-zygote programs while Android apps (forked from zygote) remain
debuggable.
Bug: 23050463
Change-Id: If8ea719063a65db4cdeed69a838b52e87b078b08
If an app exposes new/delete from a shared library, the libwilhelm
shared library can wind up using the new from the app shared library,
and the delete from libc++. It is completely legal for the app to
export new/delete in this way, so in order to avoid this situation,
preload libwilhelm in the zygote. This forces libwilhelm to always
resolve the new/delete from libc++.
This library cannot be added to android_runtime since libwilhelm
has a shared library which depends on android_runtime.
Bug: 21032018
Change-Id: Id89c196df62d98d62855a1421f397b75a7e990a9
This change adds three new timeslices :
- PostFork : As soon as possible after the app forks from the
zygote. Can be used in conjunction with the system_server
"Start proc:" event to derive an upper bound on fork() and
zygote overhead.
- RuntimeInit & ActivityThreadMain for ZygoteInit#runtimeInit
and ActivityThread#main.
ActivityThread#handleBindApplication and higher level functions
are already well instrumented in systrace. handleBindApplication
should occur immediately after ActivityThread#main.
Note that we use the Activity manager tag to make it easier to
correlate these new events with surrounding events (Start proc
and handleBindApplication) that are already using the AM tag.
bug: 21632700
Change-Id: Ibc01f1721f962c913f3c02a51763b6feb1eb6a4d
Build both 32 and 64-bit versions and don't limit it to eng.
Change-Id: I5d6cc8005291100d5fe0f1385e8a0b4ba5f4d630
(cherry picked from commit e740b17d2400ed0db17d1f7fce4f052bbbf808ab)
app_main.c gets sys/stat.h inherited from
private/android_filesystem_config.h it should
not rely on this in the future. The intent is
to move fs_config function into libcutils and
thus deprecate any need for sys/stat.h in this
include file.
Bug: 19908228
Change-Id: I477b825e582742113f849aaa1df50c41e496b6f6
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
to export symbols from the static library.
Change-Id: I465806dcffc777a682523f74ae6f7ab61aaa6962
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
Change app_process to be a symlink to the primary version
and have app_process32/app_process64 be the 32-bit/64-bit
versions respectively.
This will make it possible to use the primary zygote for
am/pm commands and other scripts that use app_process and
don't need a specific zygote.
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Change-Id: Ibef545994eb95ddc82101c95df613ad1d06345e6
Look for __i386__ and not __x86__.
(cherry picked from commit 47d526217b3fd0d17ba751c66d25cfaf1c6ed7cd)
Change-Id: I848ba351c378e59ab6744ca1983ae4463ae75ba4
The runtime expects them to exist before it's launched.
The boot image / art files are created during the first
zygote launch.
(cherry picked from commit da738713e4e2120a324e8ab6fd11aa0e54a3c66e)
Change-Id: I7472aa25c16a1cf95791af2bdf80ed0d73123872
When app_process/zygote starts, make sure PR_SET_NO_NEW_PRIVS is set.
This prevents zygote spawned apps from acquiring new privileges
on exec.
In particular, this allows the CTS test
android.os.cts.SecurityFeaturesTest#testNoNewPrivs() to pass if ART is set
as the default runtime.
Change-Id: I81139cda999c7b1430242561aad28f566e9b6da0
Use String8::isEmpty instead. Note that this code path is hit
only if the zygote calls ::exit, and that never happens unless
the VM invocation fails.
Change-Id: I0e7d3a86a79b12b2174ca3bf0dbe1904e33c041a
- Use different process names for the 32 / 64 bit zygote.
- Pass command line arguments correctly. The first unmatched
argument must be passed through to the java main class.
Change-Id: I952ebbdbba941f118d992354b9bd0ada2dade417
Query system properties for the list of ABIs and pass
it as a command line argument to ZygoteInit.
Also add a new Zygote command that returns this list of
ABIs to peers.
Change-Id: I68034c6f63fa626911122579a011a0a25a8cda94
- Make copies of argc, argv before argv is potentially
overwritten with the process name.
- Allow multiple command line arguments to be passed to
ZygoteInit (this is required for some of the 64 bit
zygote work).
- Add an explanatory comment about how these argments
are processed.
Change-Id: I752be69c5c0f97ed17d1a3dded19f46ee00929b0
These look like historical oddities, and weren't really being
used for anything useful.
Process:setArgV0 was being called by android.util.Process, but
that functionality can be moved directly into the implementation
of that class.
bug: 13647418
Change-Id: I216c8f8a4c065f0cf3a61f19f9e32decd26f93f6