Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.3
-
-
2022wk26FOQtforAndroid, 2023wk40FOQtforAndroid, 2023wk44FOQtforAndroid, 2023wk46FOQtforAndroid, 2023wk50FOQtforAndroid, 2023wk52FOQtforAndroid, 2024wk02FOQtforAndroid
Description
The problem was observed on Android 11 and 12, Android 10 seems to work as expected.
When the Android app goes to background, the events from the main ui thread's queue are not processed. But some other threads and event loops can still operate, generate events and put them in main ui thread's event loop. Those events should be properly consumed when the app goes back to foreground and main thread is resumed. The attached sample apps reproduce such situation in two different ways.
The crash happens when some background thread generates events intended to be consumed by the main ui thread. The event handler on the qml side must change the UI state.
Two scenarios has been tested, in both of them it's easy to end up with crash:
- events are generated by some c++ worker run in a separate thread, communicating with the qml gui via signals/slots.
- events are generated using WorkerScript, no C++ code is involved
The crash was observed when qml handler was modifying gui in a following way:
- items added to the model used by ListView or GridView
- items added to the model used by Repeater or Instantiator
- items are created using Component.createObject() and displayed on the scene
After going back to foreground for the first time there is a black screen. The second attempt ends up with a segfault.
Attachments
Issue Links
- duplicates
-
QTBUG-102594 [REG 5.15.6 -> 5.15.9] Many ANR issues by QtAccessibility
- Closed