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

QDataStream transaction wrongly commits

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.7.1
    • 5.7.0 RC
    • Core: I/O
    • None
    • 3c93286f08a80b6e1821d7d63d361742b25c6578, 902a5e7aaa0ec156d19b5a7988eff1809a6a2046

    Description

      When deserializing some types (QList, QLinkedList, QSet) using QDataStream::startTransaction and QDataStream::commitTransaction, in some cases commitTransaction returns true whereas the full container could not be read. It happens when the bytes available for read stop at an exact boundary between two items of the container.
      This is because QDataStream has the following test between each item deserialization :

      if (s.atEnd())
      break;


      Then nothing is read from the datastream, so the status never goes to ReadPastEnd, and the transaction commits successfully.

      The current workaround is to simply add a qint8 after the container, so that its deserialization switches the datastream status to ReadPastEnd.

      Attachments

        For Gerrit Dashboard: QTBUG-54022
        # Subject Branch Project Status CR V

        Activity

          People

            alex1973tr Alex Trotsenko
            ericlemanissier Eric Lemanissier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes