Bug 518750
Summary: | Thread creation via class QThread triggers data races | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Bart Van Assche <bart.vanassche+redhat> |
Component: | qt | Assignee: | Than Ngo <than> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 13 | CC: | kevin, ltinkl, rdieter, than |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-06-27 14:21:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Bart Van Assche
2009-08-22 10:01:09 UTC
There is no qt4 package in Fedora anymore, reassigning to qt. Source code of the test program: $ svn cat -r10854 svn://svn.valgrind.org/valgrind/trunk/drd/tests/qt4_mutex.cpp /// Qt4 mutex test. #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "config.h" #include <QMutex> // class QMutex #include <QThread> // class QThread #include <cassert> #include <cstdio> // fprintf() #include <cstdlib> // atoi() #include <new> #include <pthread.h> // pthread_barrier_t #include <vector> static pthread_barrier_t s_barrier; static QMutex* s_pMutex; static int s_iterations; static int s_counter; class IncThread: public QThread { virtual void run(); }; void IncThread::run() { int i; pthread_barrier_wait(&s_barrier); for (i = s_iterations; i > 0; i--) { s_pMutex->lock(); s_counter++; s_pMutex->unlock(); } } int main(int argc, char** argv) { int i; const int n_threads = 10; std::vector<QThread*> tid(n_threads); s_iterations = argc > 1 ? atoi(argv[1]) : 1000; fprintf(stderr, "Start of test.\n"); { // Stack-allocated mutex. QMutex M(QMutex::Recursive); M.lock(); assert(M.tryLock()); M.unlock(); M.unlock(); } #if defined(HAVE_QTCORE_QMUTEX_TRYLOCK_INT) { QMutex M(QMutex::NonRecursive); assert(M.tryLock(1)); assert(! M.tryLock(1)); M.unlock(); } #endif pthread_barrier_init(&s_barrier, 0, n_threads); s_pMutex = new QMutex(); for (i = 0; i < n_threads; i++) { tid[i] = new IncThread; tid[i]->start(); } for (i = 0; i < n_threads; i++) { tid[i]->wait(); delete tid[i]; } delete s_pMutex; s_pMutex = 0; pthread_barrier_destroy(&s_barrier); if (s_counter == n_threads * s_iterations) fprintf(stderr, "Test successful.\n"); else fprintf(stderr, "Test failed: counter = %d, should be %d\n", s_counter, n_threads * s_iterations); return 0; } I'd suggest upstreaming this to nokia , esp since there's a test-case. (after confirming it's still a problem with qt-4.6.x). A related upstream bug report can be found here: http://bugreports.qt.nokia.com/browse/QTBUG-5655. This bug report has already been acknowledged by Nokia. This message is a reminder that Fedora 11 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 11. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '11'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 11's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 11 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping This message is a reminder that Fedora 13 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '13'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 13's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 13 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |