Bug#916657: qtscript-opensource-src: Segmentation fault in libQt5Script.so.5.11.2 building qbs
Source: qtscript-opensource-src
Version: 5.11.2+dfsg-2
Severity: normal
Tags: patch
Dear Maintainer,
Please look at analysis for qbs build failure here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916626
The segementation fault occurs because the code in currentThreadStackBase()
incorrectly adds the stack size to the stack address returned by
pthread_attr_getstack(). The stack on hppa grows up.
With the attached patch, I had a successful build of qtscript-opensource-src:
https://buildd.debian.org/status/fetch.php?pkg=qtscript-opensource-src&arch=hppa&ver=5.11.2%2Bdfsg-2%2Bb1&stamp=1545000897&raw=0
The patch probably fixes the bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=880034
Regards,
Dave Anglin
-- System Information:
Debian Release: buster/sid
APT prefers buildd-unstable
APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)
Kernel: Linux 4.14.88+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Index: qtscript-opensource-src-5.11.2+dfsg/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
===================================================================
--- qtscript-opensource-src-5.11.2+dfsg.orig/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ qtscript-opensource-src-5.11.2+dfsg/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -672,7 +672,12 @@ static inline void* currentThreadStackBa
pthread_attr_destroy(&sattr);
stackThread = thread;
}
+#if defined(__hppa__)
+ // Stack grows up.
+ return static_cast<char*>(stackBase);
+#else
return static_cast<char*>(stackBase) + stackSize;
+#endif
#else
#error Need a way to get the stack base on this platform
#endif
Reply to: