Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
The QDnsLookupThreadPool::start function calls QObject::moveToThread(). Since, presumably, the start() function can be called from a non-GUI thread, and not the same one that managed to construct the object in Q_GLOBAL_STATIC (double-checked locking doesn't guarantee anything here; moving this initialization code from start() to the QDLTP ctor would guarantee), this is violating the moveToThread() precondition that the currentThread() is the same as the current QObject::thread() (from https://doc.qt.io/qt-6/qobject.html#moveToThread)
Warning: This function is not thread-safe; the current thread must be same as the current thread affinity. In other words, this function can only "push" an object from the current thread to another thread, it cannot "pull" an object from any arbitrary thread to the current thread.
QTBUG-113836 fixed this for 6.6+, but Qt ≤ 6.5 is still affected.
Attachments
Issue Links
- is covered by
-
QTBUG-113836 Port QDnsLookupThreadPool to Q_APPLICATION_STATIC
- Closed
- relates to
-
QTBUG-113838 Data Race on QDnsLookupThreadPool::signalsConnected
- Closed