Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.6, 6.3.2, 6.4.1, 6.5.0 FF
-
None
-
-
26ea6157e (dev), 500e16198 (dev), 3642d5680 (dev), c04960134 (dev), f9e9dd19c (6.5), 55bef5d26 (6.5), db7d301f9 (6.5), cea3c2ce0 (6.5), a3d8512fe (6.4), 9f0a75d26 (6.4), 991b5dfe8 (6.4), 845aa0378 (tqtc/lts-6.2), 6fdccc6df (tqtc/lts-6.2), a6ea94cc3 (6.4)
-
Foundation Sprint 72
Description
The QAndroidApplication::runOnAndroidMainThread() function creates a task on QThreadPool::globalInstance()¹ to wait for a timeout and cancel a QFuture. If does so by passing a lambda to QtConcurrent::run()² that captures the future, a local variable, by reference. This is UB when the lambda is ever executed, because the local stack variable's lifetime will have ended.
I'm not sure how to fix it, therefore this ticket.
¹ thereby blocking a full worker thread in QThreadPool::globalInstance() from doing any productive work, possibly delaying actual work being done and, in the last consequence, causing a (timed) deadlock, and False Positive timeouts because work that would unblock the waiter can't be performed
² Isn't QtConcurrent dependent on QtCore, and not the other way around?