From: Jan Palus Date: Wed, 22 Sep 2021 14:06:26 +0000 (+0200) Subject: quick and ugly hack for infinite loop in QMap X-Git-Tag: auto/th/qt4-4.8.7-35~1 X-Git-Url: https://git.pld-linux.org/?p=packages%2Fqt4.git;a=commitdiff_plain;h=db331ed1a3162a7c83243fd56699e27f9270d3ef quick and ugly hack for infinite loop in QMap as noted by qboosh in https://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2021-September/026364.html the root cause is essentially a mismatch between address of QMapData::shared_null as seen in library and application. since `shared_null` acts basically as '\0' in strings -- stop point, only compared by address -- just make sure application always receives same address as library. still to be determined why that happens exactly (all of my attempts at reduced reproducer failed) and proper fix should be delivered. --- diff --git a/qmap_inf_loop.patch b/qmap_inf_loop.patch new file mode 100644 index 0000000..ad98fa7 --- /dev/null +++ b/qmap_inf_loop.patch @@ -0,0 +1,11 @@ +--- qt-everywhere-opensource-src-4.8.7.orig/src/corelib/tools/qmap.h 2015-05-07 14:14:48.000000000 +0000 ++++ qt-everywhere-opensource-src-4.8.7/src/corelib/tools/qmap.h 2021-09-22 13:03:35.852354885 +0000 +@@ -179,7 +179,7 @@ + } + + public: +- inline QMap() : d(&QMapData::shared_null) { d->ref.ref(); } ++ inline QMap() : d(QMapData::shared_null.backward) { d->ref.ref(); } + inline QMap(const QMap &other) : d(other.d) + { d->ref.ref(); if (!d->sharable) detach(); } + inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); } diff --git a/qt4.spec b/qt4.spec index 030be06..9b703a3 100644 --- a/qt4.spec +++ b/qt4.spec @@ -133,6 +133,7 @@ Patch51: gcc9.patch Patch52: gcc9-qforeach.patch Patch53: cxx11.patch Patch54: gcc11.patch +Patch55: qmap_inf_loop.patch URL: http://qt-project.org/ %{?with_ibase:BuildRequires: Firebird-devel} %{?with_openvg:BuildRequires: Mesa-libOpenVG-devel} @@ -1574,6 +1575,7 @@ Programas exemplo para o Qt versão. %patch52 -p1 %patch53 -p1 %patch54 -p1 +%patch55 -p1 %{__sed} -i -e 's,usr/X11R6/,usr/g,' mkspecs/linux-g++-64/qmake.conf \ mkspecs/common/linux.conf