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
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: