summaryrefslogtreecommitdiff
path: root/cmds/app_process/app_main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Disable pointer authentication in app processes."Elliott Hughes2022-03-101-5/+0
| | | | | | | | | | | | | Revert "Disable pointer authentication in app processes." Revert submission 1954983-master-I3030c47be9d02a27505bd4775c1982a20755758c Reason for revert: PAC has shipped with S, and we're going with app compat outreach rather than regressing security. Reverted Changes: I3030c47be:Disable pointer authentication in app processes. I3030c47be:Disable pointer authentication in app processes. Change-Id: I75c4d2d3cf59aecf99d9c9d37c6750f999e74de8
* Disable pointer authentication in app processes.Peter Collingbourne2022-01-191-0/+5
| | | | | | | | | | Unfortunately we have discovered that some applications in the wild are using PAC instructions incorrectly. To keep those applications working on PAC enabled devices, disable PAC in application processes for now. Bug: 212660282 Change-Id: I3030c47be9d02a27505bd4775c1982a20755758c
* Use ABI_STRING.Elliott Hughes2018-03-231-16/+2
| | | | | | Bug: N/A Test: builds Change-Id: I5a9d2a6604887f1f0e9583086e012a086042b7df
* Merge "app_main: silence static analyzer warnings"George Burgess IV2017-07-121-0/+6
|\ | | | | | | | | | | am: cf188f664a Change-Id: Ibad16ec8fabb4edaaa832bc43505f81fefb10ec7
| * app_main: silence static analyzer warningsGeorge Burgess IV2017-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Stop hwbinder threads from app_process.Martijn Coenen2017-04-191-1/+3
|/ | | | | | | | | To prevent it from hanging up. Bug: 37500397 Bug: 34085250 Test: DismissDialogsInstrumentation test Change-Id: Ia69f6a5676666bc9286272b82f242d7b1d0ee286
* app_process: don't use PR_SET_NO_NEW_PRIVS.Josh Gao2017-01-171-4/+0
| | | | | | | | selinux should provide equivalent protection, and this prevents transitioning to a helper binary for crash dumping. Bug: http://b/30705528 Change-Id: I64b05236931d418f268b193418e937ab6b0985e0
* app_process: Forward -cp/-classpath to ART.Igor Murashkin2016-10-031-0/+46
| | | | | | | | | | | | | * 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
* app_main: failure to PR_SET_NO_NEW_PRIVS is always fatal.Narayan Kamath2016-09-141-7/+1
| | | | | | | | | 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
* Remove unused includes.Dmitriy Filchenko2016-08-181-1/+0
| | | | | | BUG: 29824203 Change-Id: I795f8abe31575f70da263921c6ec13b73b24dc7b
* Handle long process names correctly.Dmitriy Filchenko2016-07-181-3/+1
| | | | | | 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
* Remove calls to set_process_name.Dmitriy Filchenko2016-07-121-2/+3
| | | | | | BUG:29824203 Change-Id: I67a1eb350cf9ea28c554166986df8fc251b666eb
* zygote: Remove NativeLoader initialization stepDimitry Ivanov2016-04-271-2/+0
| | | | | | | This now done by art Runtime::Start() Bug: http://b/28320913 Change-Id: Icf9b11954b732c9f953e02bba9ae52eb91117457
* Renamed the function initialing nativeloaderDimitry Ivanov2016-03-171-1/+1
| | | | | | Bug: http://b/27546414 Change-Id: Ia0b65540772ca4bd1cdab391973325b18cd278a0 (cherry picked from commit bf1082e9a1ae833718321ac58ab64e281d0e3614)
* Fix ASAN builds after app_process change.Nicolas Geoffray2016-02-261-1/+1
| | | | | | | | Bug:27245894 (cherry picked from commit 573895bbea7cf349d615606004cdb85ba2ca814d) Change-Id: I1b879f23cd2bb49070cbfee40ae1b8a586a328dc
* zygote to preload public native librariesDimitry Ivanov2016-02-261-0/+2
| | | | | | | | | | | | | 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
* Allow debugging only for apps forked from zygoteSebastien Hertz2015-08-101-2/+2
| | | | | | | | | | 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
* Better systrace slices for application startup.Narayan Kamath2015-06-161-3/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* app_main missing include for sys/stat.hMark Salyzyn2015-04-011-5/+6
| | | | | | | | | | | | 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
* Add mips64 support to app_process.Douglas Leung2014-12-171-1/+3
| | | | Change-Id: Ieb05a212606f02ebad119a0aea0ed92773ace214
* Frameworks/base: Turn on -Wall -Werror in cmdsAndreas Gampe2014-11-071-1/+1
| | | | | | Fix small warnings, turn on -Wall -Werror. Change-Id: Iab1f01a7c7ebd6ba832b75067c5e395f380a1b8b
* Clean entire arg block when setting process name.Jeff Brown2014-09-111-9/+20
| | | | | | | | | | | | | | 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 /dalvik-cache to be owned by root.Alex Light2014-08-281-3/+3
| | | | | | | | Bug: 16875245 (cherry picked from commit 79bf4007f559e194205f632b23d2bfb6f8d1e7ba) Change-Id: I29a70215a2207bc4e0db02ab751d32a68edf4b66
* Fix x86 build in app_process.Narayan Kamath2014-04-301-1/+1
| | | | | | Look for __i386__ and not __x86__. Change-Id: Iffa3709f9d0c96cce17f3183a6f036a78eccc787
* Merge "Create arch specific cache dirs during zygote startup."Narayan Kamath2014-04-301-0/+42
|\
| * Create arch specific cache dirs during zygote startup.Narayan Kamath2014-04-301-0/+42
| | | | | | | | | | | | | | | | The runtime expects them to exist before it's launched. The boot image / art files are created during the first zygote launch. Change-Id: I5ed0ad4854dc7785246344c8f6eaf54e560feb7d
* | Set NO_NEW_PRIVS on zygote initNick Kralevich2014-04-291-0/+10
|/ | | | | | | | | | | | 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
* Fix a typo in an assertion.Elliott Hughes2014-04-231-1/+1
| | | | Change-Id: I3e97bb3cb8070c0ec0c6b97769f1da3e7b4ef8f5
* Don't compare String8s to NULL.Narayan Kamath2014-04-121-1/+1
| | | | | | | | 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
* Dual zygote cleanup.Narayan Kamath2014-04-101-2/+7
| | | | | | | | - 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
* Make zygotes aware of their supported ABIs.Narayan Kamath2014-04-091-1/+19
| | | | | | | | | | 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
* Clean up argc / argv processing for runtime args.Narayan Kamath2014-04-091-40/+59
| | | | | | | | | | | | - 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
* Remove ProcessState::mArgc,mArgV,mArgLenNarayan Kamath2014-04-031-22/+24
| | | | | | | | | | | | 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
* revert ADDR_COMPAT_LAYOUT workaround.Nick Kralevich2013-09-181-29/+0
| | | | | | | | | | | | | Stop working around bad applications by setting ADDR_COMPAT_LAYOUT. ADDR_COMPAT_LAYOUT is undesirable because it reduces the amount of address space available to an application. The Android emulator, in both 4.3 and 4.4, does not set ADDR_COMPAT_LAYOUT. Anyone needing to test their application on a version of Android without ADDR_COMPAT_LAYOUT can use the emulator and reproduce the failures. Change-Id: I8f753acc205798bd7f031026c7ece12d26de562c
* am 35587a0c: Merge "Don\'t set ADDR_COMPAT_LAYOUT on the emulator"Nick Kralevich2013-04-231-1/+5
|\ | | | | | | | | * commit '35587a0c47c33a8eed7817dc705dbf502f7b5b60': Don't set ADDR_COMPAT_LAYOUT on the emulator
| * Don't set ADDR_COMPAT_LAYOUT on the emulatorNick Kralevich2013-04-231-1/+5
| | | | | | | | | | | | Don't work around third party app bugs on the emulator. Change-Id: I4440fcd56b72e3a74881ddec2a469f037a060525
* | Disable tracing from ZygoteJamie Gennis2013-04-161-0/+4
|/ | | | | | | | | This change disables all atrace tracing in Zygote immediately after it is initialized. This is necessary because Zygote has no way to receive notifications that the enabled trace tags have been changed. Tracing is re-enabled when other processes fork from Zygote. Change-Id: If2983858fb0c4890ba9ab041849b1c4d98f66c13
* app_process: don't pollute the environmentNick Kralevich2013-03-151-0/+1
| | | | | | Give a hoot — don't pollute! Change-Id: I30d6c05cecab483f0e9d8063907f7bc0ef2bb104
* Never call app_main more than onceNick Kralevich2013-03-151-4/+3
| | | | | | | | | | | | Different kernels seem to handle ADDR_COMPAT_LAYOUT differently, sometimes passing it to its children, sometimes not. If it's not passed to its child successfully, we can end up in a restart loop. Instead of testing for the presence of ADDR_COMPAT_LAYOUT, use an environment variable instead, which is handled more predictably. Bug: 8392487 Change-Id: Ia531dd2abb4e1cd46f3430d844e644f53581f530
* Don't use ADDR_COMPAT_LAYOUT on the emulatorNick Kralevich2013-03-141-5/+10
| | | | | | | | | | | | | For the emulator, we want people to see memory as it actually is, not how we're hacking around buggy apps. Don't set ADDR_COMPAT_LAYOUT on the emulator. For reasons that I don't understand, personality(ADDR_COMPAT_LAYOUT) does not persist across an exec on the emulator. app_main gets into a tight loop restarting itself because of this. This change also works around that bug. Change-Id: Ia73a7d2d623c25cf39d248145d97307945d554da
* Respawn app_main if ADDR_COMPAT_LAYOUT is not setNick Kralevich2013-03-141-1/+22
| | | | | Bug: 8358800 Change-Id: Id81aa26d74dfd16a49f0ee5926ea2cdb3c2106d8
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-1/+1
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-2/+2
| | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
* Eliminate single-process mode.Jeff Brown2011-07-081-14/+6
| | | | | | Bug: 5010576 Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
* Support wrapping app processes to inject debug instrumentation.Jeff Brown2011-05-241-30/+41
| | | | | | Bug: 4437846 Change-Id: I4552501c693716b14714afb5c5248edaca9547ab
* Replace a custom AndroidRuntime::findClass with a more targeted fix.Elliott Hughes2011-04-131-20/+41
| | | | | | | This seems simpler and more contained, and I think the comment explaining why hoop-jumping is necessary is a bit clearer now. Change-Id: Ief4afd7cbb42188ed835fce23e497520bdb753a8
* Move LOG_ALWAYS_FATAL to end of app_processBrian Carlstrom2010-10-071-1/+1
| | | | | | | Since LOG_ALWAYS_FATAL is always fatal and code after it is by definition unreachable, put the call after other diagnostic output. Change-Id: Ib3a515a04125d8e4f6e8af3a6f59226e8f0dd9cd
* move libbinder's header files under includes/binderMathias Agopian2009-05-201-2/+2
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+180
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-180/+0
|