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

QFile write / read sequence is racy when executed from different threads

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.4.0
    • Core: I/O, Core: Threads
    • None
    • Linux/X11

    Description

      In order to reproduce run the following test: https://codereview.qt-project.org/c/qt/qtbase/+/463358.

      Example output:

      69: PASS   : tst_QFile::initTestCase()
      69: QDEBUG : tst_QFile::sequentialWriteAndReadInThreads() Doesn't exists, iteration: 52
      69: FAIL!  : tst_QFile::sequentialWriteAndReadInThreads() Compared values are not the same
      69:    Actual   (w->result()): ""
      69:    Expected (data)       : "Line with spaces"
      69:    Loc: [/home/jarek/dev/qt-dev/qtbase/tests/auto/corelib/io/qfile/tst_qfile.cpp(4050)]
      69: QDEBUG : tst_QFile::sequentialWriteAndReadInThreads() Can't open, iteration: 54 exists: false
      69: FAIL!  : tst_QFile::sequentialWriteAndReadInThreads() Compared values are not the same
      69:    Actual   (w->result()): ""
      69:    Expected (data)       : "Line with spaces"
      69:    Loc: [/home/jarek/dev/qt-dev/qtbase/tests/auto/corelib/io/qfile/tst_qfile.cpp(4050)]
      

      or:

      69: PASS   : tst_QFile::initTestCase()
      69: QDEBUG : tst_QFile::sequentialWriteAndReadInThreads() Doesn't exists, iteration: 0
      69: FAIL!  : tst_QFile::sequentialWriteAndReadInThreads() Compared values are not the same
      69:    Actual   (w->result()): ""
      69:    Expected (data)       : "Line with spaces"
      69:    Loc: [/home/jarek/dev/qt-dev/qtbase/tests/auto/corelib/io/qfile/tst_qfile.cpp(4050)]
      69: QDEBUG : tst_QFile::sequentialWriteAndReadInThreads() Doesn't exists, iteration: 6
      69: FAIL!  : tst_QFile::sequentialWriteAndReadInThreads() Compared values are not the same
      69:    Actual   (w->result()): ""
      69:    Expected (data)       : "Line with spaces"
      69:    Loc: [/home/jarek/dev/qt-dev/qtbase/tests/auto/corelib/io/qfile/tst_qfile.cpp(4050)]
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            jkobus Jarek Kobus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes