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

QDataStream cannot serialize containers > 2Gi elements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • 6.2.4, 6.3.1, 6.4.0 Beta2
    • Core: Serialization
    • None
    • 13
    • fd48ce0b7 (dev)
    • Foundation Sprint 92, Foundation Sprint 93

      The code fails on 64-bit platforms:

      QByteArray ba;
      const QString str =  ~~~ more than 2Gi characters ~~~;
      QDataStream(&ba) << str;
      QString restored;
      QDataStream(ba) >> restored;
      assert(restored == str);
      

      Ditto all other containers.

      The problem seems to be that the serialisation format only allocates a four-octet length field.

      There doesn't appear to be something you can do, unless you change the format to include a longer length indicator.

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

            oyheskes Øystein Heskestad
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes