Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.2, 5.4.0 Beta
-
Ubuntu 13.04
-
7ca66b1e66e73a0cb35705df04507ef9f3440cab
Description
Single sql connection should not be used from a different thread that it is created in (and some drivers may have additional limitations). Correct me if I am wrong, but I believe it should be working in a way that I implemented it in attached example.
This does not happen every time, but running this example 10 times usually fails somewhere.
Sometimes error messages are printed, such as:
QObject::moveToThread: Current thread (0x2577340) is not the object's thread (0x2577960). Cannot move to target thread (0x25701e0) QObject::moveToThread: Current thread (0x25759a0) is not the object's thread (0x2577960). Cannot move to target thread (0x25701e0) QObject::moveToThread: Current thread (0x25766e0) is not the object's thread (0x2577960). Cannot move to target thread (0x25701e0)
Sometimes there is an assert:
ASSERT: "!weakref.load()" in file ../../../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h, line 149
It may also get stuck in qt_call_post_routines() (qcoreapplication.cpp) calling (list->takeFirst())() which makes calls to cleanDriverDict continuously.
Sometimes it may even crash (see attachment). Sometimes it crashes inside sqlite library too.
Attachments
For Gerrit Dashboard: QTBUG-42855 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
179497,3 | Fix race condition in QFactoryLoader: lock the mutex we already have | 5.8 | qt/qtbase | Status: MERGED | +2 | 0 |
302588,2 | Add missing lock in QFactoryLoader | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
302625,2 | Add missing lock in QFactoryLoader | dev | qt/qtbase | Status: MERGED | +2 | 0 |