]> git.pld-linux.org Git - packages/qt4.git/commitdiff
quick and ugly hack for infinite loop in QMap
authorJan Palus <atler@pld-linux.org>
Wed, 22 Sep 2021 14:06:26 +0000 (16:06 +0200)
committerJan Palus <atler@pld-linux.org>
Wed, 22 Sep 2021 14:15:15 +0000 (16:15 +0200)
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.

qmap_inf_loop.patch [new file with mode: 0644]
qt4.spec

diff --git a/qmap_inf_loop.patch b/qmap_inf_loop.patch
new file mode 100644 (file)
index 0000000..ad98fa7
--- /dev/null
@@ -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<Key, T> &other) : d(other.d)
+     { d->ref.ref(); if (!d->sharable) detach(); }
+     inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }
index 030be06dc64a179b1fb0b0ae6094a30d4e3a4578..9b703a3d390e8d7fdc14949af14e89c4d21315e3 100644 (file)
--- 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
This page took 0.15328 seconds and 4 git commands to generate.