Don't use System.exit() or atexit handlers on Android |
||
Issue descriptionUnder most circumstances, atexit handlers won't run on Android. The (only, to my knowledge) exception is a manual call to System.exit() because of some catastrophic failure. That can happen before any other shutdown has taken place though (including e.g. stopping message loops / background threads), which then leads to crashes in other, seemingly unrelated places (see e.g. issue 718166). If we want crashes, we should just throw an exception, which will at least give a more useful stack trace :) So, we should: 1) Get rid of calls to System.exit(), replacing them with something that does proper cleanup (e.g. throwing an exception) 2) Make AtExitManager a no-op on Android, just to be on the safe side. Thanks to Anthony for the investigation!
,
May 11 2017
See issue 718166 for an example of the confusion that can be caused by this. One thread called System.exit() causing other threads to crash. The actual reported crash is not from the thread that called System.exit(). The same System.exit() call also sometimes causes crashes in different places in the other threads.
,
Apr 4 2018
Friendly ping. Is there any update on this issue.
,
Apr 4 2018
No, but is this blocking anything? |
||
►
Sign in to add a comment |
||
Comment 1 by torne@chromium.org
, May 10 2017