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

[Reg 5.15 -> 6.1.0] QVector print result after growth is invalid

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 6.1.0
    • Fix Version/s: 6.0.1, 6.1
    • Labels:
      None
    • Environment:
      Windows 10, MSVC 16.8.4
    • Platform/s:
      Windows

      Description

      Release mode, 32-bit.

      Program:

      #include <QDebug>
      #include <QVector>
      
      int main(int, char **) {
        QVector<qint64> v;
        for (int i = 0; i < 7; ++i) {
          v.append(i);
          qDebug() << i << v.at(i);
        }
        qDebug() << v;
        return 0;
      }
      

      Expected result:

      0 0
      1 1
      2 2
      3 3
      4 4
      5 5
      6 6
      QList(0, 1, 2, 3, 4, 5, 6)

      Invalid results:

      0 0
      1 1
      2 2
      3 3
      4 4
      5 5
      6 6
      QList(0, 1, 2, 3, 4, -930837747982139387, 6)
      
      ...
      QList(0, 1, 2, 3, 4, 61361544922923013, 6)
      
      ...
      QList(0, 1, 2, 3, 4, 79657418409115653, 6)
      

        Attachments

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

          Activity

            People

            Assignee:
            agolubev Andrei Golubev
            Reporter:
            nodir.temir Nodir Temirkhodjaev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes