public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Sandro Mani <manisandro@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mingw-winpthreads] f45: Add clear_tls.patch
Date: Tue, 20 Oct 2026 08:05:09 GMT	[thread overview]
Message-ID: <179248350920.1.17237246248804106411.rpms-mingw-winpthreads-fca76e22a342@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/mingw-winpthreads
Branch : f45
Commit : fca76e22a3429eb4aa73be4d884576b7c0ba170e
Author : Sandro Mani <manisandro@gmail.com>
Date   : 2026-10-20T10:03:58+02:00
Stats  : +21/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/mingw-winpthreads/c/fca76e22a3429eb4aa73be4d884576b7c0ba170e?branch=f45

Log:
Add clear_tls.patch

---
diff --git a/clear_tls.patch b/clear_tls.patch
new file mode 100644
index 0000000..1ee9e5f
--- /dev/null
+++ b/clear_tls.patch
@@ -0,0 +1,14 @@
+diff -rupN --no-dereference mingw-w64-v14.0.0/mingw-w64-libraries/winpthreads/src/thread.c mingw-w64-v14.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c
+--- mingw-w64-v14.0.0/mingw-w64-libraries/winpthreads/src/thread.c	2026-03-24 12:26:20.000000000 +0100
++++ mingw-w64-v14.0.0-new/mingw-w64-libraries/winpthreads/src/thread.c	2026-10-20 09:48:35.391884385 +0200
+@@ -1586,6 +1586,10 @@ pthread_create_wrapper (void *args)
+          destroying it again in __dyn_tls_thread later on. */
+       tv->p_clock = PTHREAD_MUTEX_INITIALIZER;
+       tv->ended = 1;
++      /* GH #328 experiment: once ended, tv belongs to whoever joins or detaches
++         us, and may be recycled for a new thread before our DLL_THREAD_DETACH
++         runs -- so that callback must not find it through our TLS slot. */
++      TlsSetValue (_pthread_tls, NULL);
+     }
+   while (pthread_mutex_unlock (&mtx_pthr_locked) == 0)
+    Sleep (0);

diff --git a/mingw-winpthreads.spec b/mingw-winpthreads.spec
index 86f2892..c2f841d 100644
--- a/mingw-winpthreads.spec
+++ b/mingw-winpthreads.spec
@@ -6,7 +6,7 @@
 
 Name:           mingw-winpthreads
 Version:        14.0.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        MinGW pthread library
 
 # The main license of winpthreads is MIT, but parts of this library
@@ -15,6 +15,9 @@ Summary:        MinGW pthread library
 License:        BSD-3-Clause AND MIT AND LicenseRef-Fedora-Public-Domain
 URL:            http://mingw-w64.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/mingw-w64/mingw-w64-v%{version}%{?pre:-%{pre}}.tar.bz2
+# Clear TLS slot to avoid recycled _pthread_v
+# https://sourceforge.net/p/mingw-w64/mingw-w64/ci/c4ec7b6e63fcdcb9d5d9aebd7bf513c28b055cdf/
+Patch0:         clear_tls.patch
 
 BuildArch:      noarch
 
@@ -231,6 +234,9 @@ rm -rf /tmp/wine-winpthreads
 
 
 %changelog
+* Tue Oct 20 2026 Sandro Mani <manisandro@gmail.com> - 14.0.0-3
+- Add clear_tls.patch
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 14.0.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-10-20  8:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179248350920.1.17237246248804106411.rpms-mingw-winpthreads-fca76e22a342@fedoraproject.org \
    --to=manisandro@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox