diff options
author | 2020-03-09 14:23:23 -0700 | |
---|---|---|
committer | 2020-04-13 20:44:56 +0000 | |
commit | 36896be3815ce0db8dd5f23accfbee24492d7f8a (patch) | |
tree | fa9c3af4dc45508efa1fe557c9e8d8c65afd9753 /dalvikvm/dalvikvm.cc | |
parent | 69847caf009afebbc299e24a3cba890adb23750e (diff) |
Don't call exit() while threads may be running
It's unsafe to call exit() in C++ while there are running threads.
The remaining threads would race with static destructors, including
those for the standard library. Call _exit instead.
Bug: 150176543
Test: Boot AOSP, TreeHugger
Change-Id: Ieabf68f43e8b520714643e5ec36a8ca72cc83254
Diffstat (limited to 'dalvikvm/dalvikvm.cc')
-rw-r--r-- | dalvikvm/dalvikvm.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dalvikvm/dalvikvm.cc b/dalvikvm/dalvikvm.cc index d46779ecfb..4808a1fa09 100644 --- a/dalvikvm/dalvikvm.cc +++ b/dalvikvm/dalvikvm.cc @@ -214,5 +214,7 @@ extern "C" const char *__asan_default_options() { } int main(int argc, char** argv) { - return art::dalvikvm(argc, argv); + // Do not allow static destructors to be called, since it's conceivable that + // daemons may still awaken (literally). + _exit(art::dalvikvm(argc, argv)); } |