commit qt6-base for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-base for openSUSE:Factory checked in at 2024-10-23 21:08:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-base (Old) and /work/SRC/openSUSE:Factory/.qt6-base.new.26871 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "qt6-base" Wed Oct 23 21:08:34 2024 rev:63 rq:1216969 version:6.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-base/qt6-base.changes 2024-10-17 18:37:41.714143035 +0200 +++ /work/SRC/openSUSE:Factory/.qt6-base.new.26871/qt6-base.changes 2024-10-23 21:10:01.758070721 +0200 @@ -1,0 +2,8 @@ +Tue Oct 22 06:59:37 UTC 2024 - Christophe Marin <christophe@krop.fr> + +- Add patch to fix qxmpp test failures (gh#qxmpp-project/qxmpp#659): + * 0001-QUuid-restore-sorting-order-of-Qt-6.8.patch +- Add patch to fix potential crash with QDirIterator (QTBUG-130142): + * 0001-QDirIterator-don-t-crash-with-next-after-hasNext-ret.patch + +------------------------------------------------------------------- New: ---- 0001-QDirIterator-don-t-crash-with-next-after-hasNext-ret.patch 0001-QUuid-restore-sorting-order-of-Qt-6.8.patch BETA DEBUG BEGIN: New:- Add patch to fix potential crash with QDirIterator (QTBUG-130142): * 0001-QDirIterator-don-t-crash-with-next-after-hasNext-ret.patch New:- Add patch to fix qxmpp test failures (gh#qxmpp-project/qxmpp#659): * 0001-QUuid-restore-sorting-order-of-Qt-6.8.patch - Add patch to fix potential crash with QDirIterator (QTBUG-130142): BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-base.spec ++++++ --- /var/tmp/diff_new_pack.r4ly0W/_old 2024-10-23 21:10:02.562104101 +0200 +++ /var/tmp/diff_new_pack.r4ly0W/_new 2024-10-23 21:10:02.562104101 +0200 @@ -43,6 +43,8 @@ Source99: qt6-base-rpmlintrc # Patches 0-100 are upstream patches # Patch0: 0001-QAbstractItemModelPrivate-add-resetting-member.patch +Patch1: 0001-QUuid-restore-sorting-order-of-Qt-6.8.patch +Patch2: 0001-QDirIterator-don-t-crash-with-next-after-hasNext-ret.patch # Patches 100-200 are openSUSE and/or non-upstream(able) patches # # No need to pollute the library dir with object files, install them in the qt6 subfolder Patch100: 0001-CMake-Install-objects-files-into-ARCHDATADIR.patch ++++++ 0001-QDirIterator-don-t-crash-with-next-after-hasNext-ret.patch ++++++ From 55a8050d1e762befeeb5ba557f458b0092cbb44b Mon Sep 17 00:00:00 2001 From: Ahmad Samir <a.samirh78@gmail.com> Date: Wed, 16 Oct 2024 19:26:25 +0300 Subject: [PATCH] QDirIterator: don't crash with next() after hasNext() returned false The typical use-case is calling hasNext() first before using next, but the API docs say that calling next() even when hasNext() is false, should just return an empty string. [ChangeLog][QtCore][QDirIterator] Fixed a crash that happened if you called next() after hasNext() had already returned false. Ideally you should never call next() without first calling hasNext() as that could lead to unexpected results (for example, infinite loops). Fixes: QTBUG-130142 Change-Id: If0a8b1fe7dbd13b45793409a7a241e53c7257f24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit c7691842f743f568a073582c8f0cacd6ee188f98) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> --- src/corelib/io/qdiriterator.cpp | 5 +++++ .../auto/corelib/io/qdiriterator/tst_qdiriterator.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index faea8088cb..7d7fe15684 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -103,6 +103,11 @@ public: void advance() { + // Match the behavior of advance() from before porting to QDirListing, + // that is, even if hasNext() returns false, calling next() returns an + // empty string without crashing. QTBUG-130142 + if (it == lister.end()) + return; currentFileInfo = nextFileInfo; if (++it != lister.end()) { nextFileInfo = it->fileInfo(); diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index a0a8917c27..b739f0eb11 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -86,6 +86,8 @@ private slots: void hiddenDirs_hiddenFiles(); #endif + void hasNextFalseNoCrash(); + private: QSharedPointer<QTemporaryDir> m_dataDir; }; @@ -642,6 +644,15 @@ void tst_QDirIterator::hiddenDirs_hiddenFiles() } #endif // Q_OS_WIN +void tst_QDirIterator::hasNextFalseNoCrash() +{ + QDirIterator iter(u"empty"_s, QDir::NoDotAndDotDot); + // QTBUG-130142 + // No crash if you call next() after hasNext() returned false + QVERIFY(!iter.hasNext()); + QVERIFY(iter.next().isEmpty()); +} + QTEST_MAIN(tst_QDirIterator) #include "tst_qdiriterator.moc" -- 2.47.0 ++++++ 0001-QUuid-restore-sorting-order-of-Qt-6.8.patch ++++++ From 3e8037af63821123eb392f42d717d10f741fb384 Mon Sep 17 00:00:00 2001 From: Thiago Macieira <thiago.macieira@intel.com> Date: Sat, 19 Oct 2024 21:28:48 -0700 Subject: [PATCH] QUuid: restore sorting order of Qt < 6.8 This brings back and adapted version of the sorting code that was removed by commit 15f753ca5a60b5273d243f528978e25c28a9b56d. The issue, as shown in the test, is that we store data1, data2, and data3 as native-endian integers, so the bitcasts in the new code cause them to become mangled in little-endian platforms. Since this is a weird behavior and we'll be changing the sorting order in Qt 7 anyway, I've left a warning for us to think about it at the time. [ChangeLog][QtCore][QUuid] Fixed a regression that caused QUuid sorting order to change for some UUIDs, compared to Qt 6.7 and earlier versions. Fixes: QTBUG-130155 Pick-to: 6.8 Change-Id: I5eeb7b36bfc5ed7218e1fffd6a773c582ad0f6f4 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> --- src/corelib/plugin/quuid.cpp | 3 +++ src/corelib/plugin/quuid.h | 12 +++++++++--- tests/auto/corelib/plugin/quuid/tst_quuid.cpp | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index af7c07d..5cbae60 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -33,6 +33,9 @@ void _q_toHex(char *&dst, Integral value) } } +#if QT_VERSION_MAJOR == 7 +# warning Consider storing the UUID as simple bytes, not as {uint, ushort, short, array} +#endif template <class Integral> bool _q_fromHex(const char *&src, Integral &value) { diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index 435b7bb..0597445 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -132,7 +132,14 @@ private: static constexpr Qt::strong_ordering compareThreeWay_helper(const QUuid &lhs, const QUuid &rhs) noexcept { -#if defined(__cpp_lib_bit_cast) && defined(QT_SUPPORTS_INT128) +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && !defined(QT_BOOTSTRAPPED) + if (const auto c = Qt::compareThreeWay(lhs.data1, rhs.data1); !is_eq(c)) + return c; + if (const auto c = Qt::compareThreeWay(lhs.data2, rhs.data2); !is_eq(c)) + return c; + if (const auto c = Qt::compareThreeWay(lhs.data3, rhs.data3); !is_eq(c)) + return c; +#elif defined(__cpp_lib_bit_cast) && defined(QT_SUPPORTS_INT128) quint128 lu = qFromBigEndian(std::bit_cast<quint128>(lhs)); quint128 ru = qFromBigEndian(std::bit_cast<quint128>(rhs)); return Qt::compareThreeWay(lu, ru); @@ -144,13 +151,12 @@ private: }; if (const auto c = Qt::compareThreeWay(make_int(lhs), make_int(rhs)); !is_eq(c)) return c; - +#endif for (unsigned i = 0; i < sizeof(lhs.data4); ++i) { if (const auto c = Qt::compareThreeWay(lhs.data4[i], rhs.data4[i]); !is_eq(c)) return c; } return Qt::strong_ordering::equal; -#endif } friend constexpr Qt::strong_ordering compareThreeWay(const QUuid &lhs, const QUuid &rhs) noexcept { diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp index 8b75817..f1b96e6 100644 --- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp @@ -465,6 +465,7 @@ void tst_QUuid::ordering_data() #define AFTER_NCS(x) ROW(minNCS, x, less) AFTER_NCS(ncs000_0000_0010); AFTER_NCS(ncs000_0000_0100); + ROW(ncs000_0000_0010, ncs000_0000_0100, less); AFTER_NCS(ncs000_0000_1000); AFTER_NCS(ncs000_0001_0000); AFTER_NCS(ncs000_0010_0000); @@ -492,6 +493,13 @@ void tst_QUuid::ordering_data() AFTER_R(ones); #undef AFTER_R #undef ROW + + // due to the way we store data1,2,3 in memory, the ordering will flip + QTest::newRow("qt7-integer-portions") + << QUuid{0x01000002, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0} + << QUuid{0x02000001, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0} + << (QSysInfo::ByteOrder == QSysInfo::BigEndian || QT_VERSION_MAJOR < 7 ? + Qt::strong_ordering::less : Qt::strong_ordering::greater); } void tst_QUuid::ordering() @@ -500,6 +508,7 @@ void tst_QUuid::ordering() QFETCH(const QUuid, rhs); QFETCH(const Qt::strong_ordering, expected); + QCOMPARE(qCompareThreeWay(lhs, rhs), expected); QT_TEST_ALL_COMPARISON_OPS(lhs, rhs, expected); } -- 2.47.0
participants (1)
-
Source-Sync