Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-67214

Deadlock in tst_QVector_StrictIterators::detachThreadSafety*

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.11
    • Fix Version/s: 5.11.1
    • Component/s: Core: Threads
    • Labels:
      None
    • Environment:
      Linux morten242-arch 4.15.9-1-ARCH #1 SMP PREEMPT Sun Mar 11 17:54:33 UTC 2018 x86_64 GNU/Linux
    • Commits:
      72f8f994b26fe51bf4828e17096b7ec0abe1f0d3

      Description

       

      Running the detachThreadSafety{Int,Movable,Custom} testcases repeatedly will show that it sometimes deadlocks, with the threads in the state shown in the stacktrace below:

      Thread 3 (Thread 0x7fb4aa7fc700 (LWP 27937)):
      #0 0x00007fb4b43d1879 in syscall () from /usr/lib/libc.so.6
      #1 0x00007fb4b5248452 in QtLinuxFutex::_q_futex (val3=0, addr2=0x0, val2=0, val=-2147483643, op=0, addr=<optimized out>)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qfutex_p.h:92
      #2 QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> > (expectedValue=2147483653, futex=...)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qfutex_p.h:107
      #3 futexSemaphoreTryAcquire_loop<false> (u=..., curValue=2147483653, curValue@entry=21474836485, nn=nn@entry=4294967396, timeout=timeout@entry=-1)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qsemaphore.cpp:221
      #4 0x00007fb4b5248554 in futexSemaphoreTryAcquire<false> (u=..., n=100, timeout=timeout@entry=-1)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qsemaphore.cpp:260
      #5 0x00007fb4b5248310 in QSemaphore::acquire (this=<optimized out>, n=<optimized out>)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qsemaphore.cpp:320
      #6 0x0000563f5803919a in void tst_QVector_StrictIterators::detachThreadSafety<int>() const::{unnamed type#1}::run() (this=<optimized out>)
      at /home/morten242/projects/qt/5.11/src/qtbase/tests/auto/corelib/tools/qvector/tst_qvector.cpp:2848
      #7 0x00007fb4b5255b69 in QThreadPrivate::start (arg=0x7ffc03cd8550) at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qthread_unix.cpp:367
      #8 0x00007fb4b4f8908c in start_thread () from /usr/lib/libpthread.so.0
      #9 0x00007fb4b43d6e7f in clone () from /usr/lib/libc.so.6
      
      Thread 2 (Thread 0x7fb4b0d15700 (LWP 27487)):
      #0 0x00007fb4b4f8f6fd in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
      #1 0x00007fb4b52560fd in QWaitConditionPrivate::wait_relative (time=300000, this=0x563f59a1f4d0)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:133
      #2 QWaitConditionPrivate::wait (time=300000, this=0x563f59a1f4d0)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:141
      #3 QWaitCondition::wait (this=this@entry=0x563f59a1e400, mutex=mutex@entry=0x563f59a1e3f8, time=300000)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:215
      #4 0x00007fb4b58b9915 in QTest::WatchDog::run (this=0x563f59a1e3e0) at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:1003
      #5 0x00007fb4b5255b69 in QThreadPrivate::start (arg=0x563f59a1e3e0) at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qthread_unix.cpp:367
      #6 0x00007fb4b4f8908c in start_thread () from /usr/lib/libpthread.so.0
      #7 0x00007fb4b43d6e7f in clone () from /usr/lib/libc.so.6
      
      Thread 1 (Thread 0x7fb4b5867bc0 (LWP 27486)):
      #0 0x00007fb4b4f8f3bd in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
      #1 0x00007fb4b52561e7 in QWaitConditionPrivate::wait (time=18446744073709551615, this=0x563f59a20970)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:143
      #2 QWaitCondition::wait (this=this@entry=0x563f59a21ae0, mutex=mutex@entry=0x563f59a21ac0, time=time@entry=18446744073709551615)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:215
      #3 0x00007fb4b5255601 in QThread::wait (this=<optimized out>, time=18446744073709551615)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/thread/qthread_unix.cpp:779
      #4 0x0000563f5803a46e in tst_QVector_StrictIterators::detachThreadSafety<int> (this=<optimized out>)
      at /home/morten242/projects/qt/5.11/src/qtbase/tests/auto/corelib/tools/qvector/tst_qvector.cpp:2866
      #5 0x0000563f58025905 in tst_QVector_StrictIterators::detachThreadSafetyInt (this=0x7ffc03cd8e20)
      at /home/morten242/projects/qt/5.11/src/qtbase/tests/auto/corelib/tools/qvector/tst_qvector.cpp:2872
      #6 0x0000563f58034ef5 in tst_QVector_StrictIterators::qt_static_metacall (_o=_o@entry=0x7ffc03cd8e20, _c=_c@entry=QMetaObject::InvokeMetaMethod,
      _id=_id@entry=117, _a=_a@entry=0x7ffc03cd8710) at .moc/tst_qvector.moc:594
      #7 0x00007fb4b541dbcd in QMetaMethod::invoke (this=<optimized out>, object=0x7ffc03cd8e20, connectionType=connectionType@entry=Qt::DirectConnection,
      returnValue=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/corelib/kernel/qmetaobject.cpp:2287
      #8 0x00007fb4b58b7504 in QMetaMethod::invoke (val9=..., val8=..., val7=..., val6=..., val5=..., val4=..., val3=..., val2=..., val1=..., val0=...,
      connectionType=Qt::DirectConnection, object=<optimized out>, this=<optimized out>)
      at ../../include/QtCore/../../../../src/qtbase/src/corelib/kernel/qmetaobject.h:123
      #9 QTest::TestMethods::invokeTestOnData (this=this@entry=0x7ffc03cd8d60, index=index@entry=110)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:899
      #10 0x00007fb4b58b82c3 in QTest::TestMethods::invokeTest (this=this@entry=0x7ffc03cd8d60, index=index@entry=110, data=data@entry=0x0,
      watchDog=watchDog@entry=0x563f59a1e3e0) at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:1085
      #11 0x00007fb4b58b8a02 in QTest::TestMethods::invokeTests (this=this@entry=0x7ffc03cd8d60, testObject=0x7ffc03cd8e20)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:1402
      #12 0x00007fb4b58b9072 in QTest::qRun () at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:1835
      #13 0x00007fb4b58b91d2 in QTest::qExec (testObject=<optimized out>, argc=<optimized out>, argv=<optimized out>)
      at /home/morten242/projects/qt/5.11/src/qtbase/src/testlib/qtestcase.cpp:1722
      #14 0x0000563f58034fb7 in main (argc=<optimized out>, argv=0x7ffc03cd8f28)
      at /home/morten242/projects/qt/5.11/src/qtbase/tests/auto/corelib/tools/qvector/tst_qvector.cpp:2936

      This has caused a failure in CI: http://coin.intra.qt.io/coin/integration/qt/qtbase/tasks/1521674247

       

        Attachments

        1. run2.log
          7 kB
        2. run.log
          5 kB
        3. run.log
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            manordheim Mårten Nordheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes