Priority: P1: Critical
Affects Version/s: 5.12.8, 5.13.2, 5.14.2, 5.15.0
Component/s: Core: Threads
Environment:Huawei FLA-AL20, Android 9
Huawei nova 3i (HWINE), 3840MB RAM, Android 9
Huawei FIG-LX1 (HWFIG-H), 2816MB RAM, Android 9
Huawei HUAWEI Y9 Prime 2019 (HWSTK-HF), 3840MB RAM, Android 9
QT application periodically crashes at the destructors of std::thread and std::mutex when it is closed with 'back button' on the device with the following call stack:
and there are some other crashes, see [my blog post|https://developernote.com/2020/04/qt-app-crashes-at-the-destructor-of-std-thread-on-android-10/] for more information.
I discussed this on [stackoverflow.com|https://stackoverflow.com/questions/61321845/qt-app-crashes-at-the-destructor-of-stdthread-on-android-10-devices] and another developer confirmed that he has the same crashes in his app and found a workaround.
The workaround is to call System.exit(0) in Java code when 'back button' is pressed on the device (to prevent C++ deinitialization)
These crashes are hard to reproduce, so theoretically there can be some kind of a data race.
QT: 5.14 and 5.15
Android: 10 (lesser 9, but not previous versions)
|For Gerrit Dashboard: QTBUG-85449|
|318099,3||Android: Remove startQtApplication exit||dev||qt/qtbase||Status: ABANDONED||-2||0|
|331906,7||Android: make calling exit() conditional on an environment variable||dev||qt/qtbase||Status: MERGED||+2||0|
|337260,2||Android: make calling exit() conditional on an environment variable||tqtc/lts-5.15||qt/tqtc-qtbase||Status: MERGED||+2||0|
|337550,3||Android: make calling exit() conditional on an environment variable||5.12||qt/qtbase||Status: MERGED||+2||0|
|337607,3||Android: make calling exit() conditional on an environment variable||6.1||qt/qtbase||Status: MERGED||+2||0|
|337608,2||Android: make calling exit() conditional on an environment variable||6.0||qt/qtbase||Status: MERGED||+2||0|