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

Crash in QList.append() on Windows ARM64 using Clang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.7.0 RC2
    • None
    • Qt 6.7.0 RC2 MSVC2019 ARM64
      Clang 18.1.2 WoA (ARM64)
      Windows 11
    • Windows

    Description

      Using Clang on Windows ARM64 results in a failed assertion when adding more than 2 items to a QList due to the assertion Q_ASSERT(!data || !data->isShared()) failing in QArrayData::reallocateUnaligned.

      QList<QString> list;
      list.append("ONE");
      list.append("TWO");
      list.append("THREE"); // CRASH

      Backtrace:

      Qt6Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 889	C++
      Qt6Cored.dll!qt_assert(const char * assertion, const char * file, int line) Line 67	C++
      Qt6Cored.dll!QArrayData::reallocateUnaligned(QArrayData * data, void * dataPointer, __int64 objectSize, __int64 capacity, QArrayData::AllocationOption option) Line 231	C++
      test.exe!QTypedArrayData<QString>::reallocateUnaligned(QTypedArrayData<QString> * data, QString * dataPointer, __int64 capacity, QArrayData::AllocationOption option) Line 154	C++
      test.exe!QtPrivate::QMovableArrayOps<QString>::reallocate(__int64 alloc, QArrayData::AllocationOption option) Line 867	C++
      test.exe!QArrayDataPointer<QString>::reallocateAndGrow(QArrayData::GrowthPosition where, __int64 n, QArrayDataPointer<QString> * old) Line 224	C++
      test.exe!QArrayDataPointer<QString>::detachAndGrow(QArrayData::GrowthPosition where, __int64 n, const QString * * data, QArrayDataPointer<QString> * old) Line 209	C++
      test.exe!QtPrivate::QMovableArrayOps<QString>::emplace<QString>(__int64 i, QString && args) Line 831	C++
      test.exe!QList<QString>::emplaceBack<QString>(QString && args) Line 866	C++
      test.exe!QList<QString>::append(QString && t) Line 453	C++
      test.exe!main(int argc, char * * argv) Line 12	C++
      

      The same code runs fine using the Visual Studio compiler, but we have other requirements to use Clang.

      The issue happens with Qt 6.5, 6.6, and 6.7.

      Following is the data layout at the point of the crash:

      Attachments

        1. debug-1.png
          debug-1.png
          653 kB
        2. debug-2.png
          debug-2.png
          594 kB
        3. image-2024-03-22-13-55-33-441.png
          image-2024-03-22-13-55-33-441.png
          233 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            fseiffert Frederik Seiffert
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes