pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

qt6-qtbase: fix crash of qt6 apps that uses threads



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Wed Jul 13 22:06:34 2022 +0200
Changeset:	98f2f0557b1bf5f856bfc5ccd3880eafcb902536

Modified Files:
	qt6-qtbase/distinfo
Added Files:
	qt6-qtbase/patches/patch-src_corelib_thread_qthread__unix.cpp

Log Message:
qt6-qtbase: fix crash of qt6 apps that uses threads

qt6-qtbase: fix crash of qt6 apps that uses threads.
clear_thread_data does not ensure that current_thread_datakey
is obtained from pthread_key_create use set_thread_data to
ensure it is.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=98f2f0557b1bf5f856bfc5ccd3880eafcb902536

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 qt6-qtbase/distinfo                                    |  1 +
 .../patches/patch-src_corelib_thread_qthread__unix.cpp | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diffs:
diff --git a/qt6-qtbase/distinfo b/qt6-qtbase/distinfo
index 87997d3eae..15a7c2038e 100644
--- a/qt6-qtbase/distinfo
+++ b/qt6-qtbase/distinfo
@@ -17,6 +17,7 @@ SHA1 (patch-src_corelib_io_qstandardpaths_unix.cpp) = b12a41da19b25e34e12fdf8071
 SHA1 (patch-src_corelib_io_qstorageinfo_unix.cpp) = 9919194e9f6b47f1f311b8f8223a6a7519152073
 SHA1 (patch-src_corelib_qt__cmdline.cmake) = 25fe89821ba1e1323edae87ca1ee0bd5ccf0e407
 SHA1 (patch-src_corelib_thread_qmutex__p.h) = 47047f5af4383b622c59c3969145e44c6ac4bf18
+SHA1 (patch-src_corelib_thread_qthread__unix.cpp) = 41f9db4f26660641e1269287c37622ab6e21b504
 SHA1 (patch-src_corelib_thread_qwaitcondition__unix.cpp) = 9dffdbfc81bc7d3259020cd32b4039b7be6ee2bd
 SHA1 (patch-src_network_configure.cmake) = 754461c21574b99232efc95af3a80765b2edbecc
 SHA1 (patch-src_plugins_platforms_cocoa_qiosurfacegraphicsbuffer.mm) = 01afb2aef1d14370308c897c1d077b05c5e3f0a9
diff --git a/qt6-qtbase/patches/patch-src_corelib_thread_qthread__unix.cpp b/qt6-qtbase/patches/patch-src_corelib_thread_qthread__unix.cpp
new file mode 100644
index 0000000000..a2ada0b960
--- /dev/null
+++ b/qt6-qtbase/patches/patch-src_corelib_thread_qthread__unix.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+* Make sure current_thread_data_key has been obtained from pthread_key_create
+  before before it, set_thread_data ensures this. Fixes crash when closing threaded
+  Qt6 apps on NetBSD.
+
+--- src/corelib/thread/qthread_unix.cpp.orig	2022-07-13 13:11:12.532990932 +0000
++++ src/corelib/thread/qthread_unix.cpp
+@@ -171,8 +171,7 @@ static void set_thread_data(QThreadData 
+ 
+ static void clear_thread_data()
+ {
+-    currentThreadData = nullptr;
+-    pthread_setspecific(current_thread_data_key, nullptr);
++    set_thread_data(nullptr);
+ }
+ 
+ template <typename T>


Home | Main Index | Thread Index | Old Index