Bug#929682: libqt5qml5: QQmlEngine segfaults on ia64

Jason Duerstock <[email protected]>
Newsgroups gmane.linux.debian.ports.ia64
Message-ID <155905911889.13605.13170496900884798581.reportbug__23950.4321756371$1559059416$gmane$org@netsvcs1.gallaudet.edu>
Source: qtdeclarative-opensource-src
Severity: important
Tags: patch
User: [email protected]
Usertags: ia64

Dear Maintainer,

As reported in bug #894726, qtdeclarative-opensource-src has a bug on
systems that use 64-bit pointers with any bits from 63-50 set.  The
attached patch addresses this issue on ia64 by shifting bits 63-61
(which are the "virtual region number" on ia64) into bits 49-47.  Please
include it in the next release.

Thank you.

-- System Information:
Debian Release: 10.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: ia64

Kernel: Linux 5.0.0-trunk-mckinley (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
qtdecl5.patch.1 (text/plain, 759 B)
--- a/src/qml/jsruntime/qv4value_p.h	2019-05-24 21:55:24.436238822 -0400
+++ b/src/qml/jsruntime/qv4value_p.h	2019-05-24 22:08:26.832635233 -0400
@@ -146,12 +146,24 @@
     QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const
     {
         Heap::Base *b;
-        memcpy(&b, &_val, 8);
+#ifdef __ia64
+	quint64 _tmp;
+
+	_tmp = _val & 0x0001c00000000000;
+	_tmp = (_tmp << 14) | (_val ^ _tmp);
+	memcpy(&b, &_tmp, 8);
+#else
+	memcpy(&b, &_val, 8);
+#endif
         return b;
     }
     QML_NEARLY_ALWAYS_INLINE void setM(Heap::Base *b)
     {
         memcpy(&_val, &b, 8);
+#ifdef __ia64
+	_val |= ((_val & 0xa000000000000000) >> 14);
+	_val &= 0x0001ffffffffffff;
+#endif
     }
 #elif QT_POINTER_SIZE == 4
     QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.