Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
5.12.8, 5.13.2, 5.14.2, 5.15.0
-
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
Android 10*
Description
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:
#00 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) #01 /system/lib64/libc++.so (abort_message+232) #02 /system/lib64/libc++.so (demangling_terminate_handler()+44) #03 /system/lib64/libc++.so (std::__terminate(void ())+12) #04 /system/lib64/libc++.so (std::terminate()+52) #05 /system/lib64/libc++.so (std::__1::thread::~thread()+20) #06 /apex/com.android.runtime/lib64/bionic/libc.so (__cxa_finalize+212) #07 /apex/com.android.runtime/lib64/bionic/libc.so (exit+24) #08 /data/app/com.domain.myapp-Rs_sm5VrLR1Jj8QW6oYByA==/lib/arm64/libplugins_platforms_qtforandroid_arm64-v8a.so
or
#00 /apex/com.android.runtime/lib64/bionic/libc.so (abort+176) #01 /apex/com.android.runtime/lib64/bionic/libc.so (__fortify_fatal(char const*, ...)+116) #02 /apex/com.android.runtime/lib64/bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+52) #03 /apex/com.android.runtime/lib64/bionic/libc.so (pthread_mutex_destroy+148) #04 /system/lib64/libc++.so (std::__1::mutex::~mutex()+8) #05 /apex/com.android.runtime/lib64/bionic/libc.so (__cxa_finalize+212) #06 /apex/com.android.runtime/lib64/bionic/libc.so (exit+24) #07 /data/app/com.domain.myapp-hLEaSANDEatnCiV7f2wbeg==/lib/arm64/libplugins_platforms_qtforandroid_arm64-v8a.so
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)
Attachments
Issue Links
- is duplicated by
-
QTBUG-82617 Crash on exit via back button on Huawei Mate 20 Pro
- In Progress
-
QTBUG-83043 Crash in libqtforandroid.so
- Closed
-
QTBUG-84765 Swipe to terminate app will cause QarthPatchMonintor::CheckNotifyEvent
- Closed
- relates to
-
QTBUG-87050 Crash in androidjnimain.cpp
- Closed
For Gerrit Dashboard: QTBUG-85449 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
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 |