Control: tag -1 patch

Hello,

I created a patch on top of debian/master in 
https://salsa.debian.org/debian/pacman , attached.
Obviously, feel free to massage the git commit or changelog messages to your
liking.

I built the package locally and tested it in a fresh container, and glibc
install works now.

Pitti
>From 78c30dc86eaef9863807e60262bb8215c1949f65 Mon Sep 17 00:00:00 2001
From: Martin Pitt <[email protected]>
Date: Wed, 10 Jun 2026 12:08:15 +0200
Subject: [PATCH] Fix deadlock in fork()ed child with curl 8.20 threaded
 resolver

Two alternative patches proposed, but not yet applied in upstream pacman:
https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/360
https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/361

Patch already applied in Arch:
https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/commit/387ebf06060fd5f

Closes: #1139622
---
 debian/changelog                              |  8 +++++
 .../invalidate-curl-data-in-child.patch       | 32 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 41 insertions(+)
 create mode 100644 debian/patches/invalidate-curl-data-in-child.patch

diff --git a/debian/changelog b/debian/changelog
index e8831fb..55a81dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pacman-package-manager (7.1.0-2) UNRELEASED; urgency=medium
+
+  * Fix deadlock in fork()ed child with curl 8.20 threaded resolver.
+    Patch proposed, but not yet applied in upstream pacman. Taken from
+    Arch package. (Closes: #1139622)
+
+ -- Martin Pitt <[email protected]>  Wed, 10 Jun 2026 12:06:24 +0200
+
 pacman-package-manager (7.1.0-2) unstable; urgency=medium
 
   * Remove unreproducible date entries from auto-generated manpages.
diff --git a/debian/patches/invalidate-curl-data-in-child.patch 
b/debian/patches/invalidate-curl-data-in-child.patch
new file mode 100644
index 0000000..516c9b2
--- /dev/null
+++ b/debian/patches/invalidate-curl-data-in-child.patch
@@ -0,0 +1,32 @@
+From: Christian Hesse <[email protected]>
+Date: Thu, 30 Apr 2026 12:31:13 +0200
+Subject: libalpm: invalidate curl data in child
+Forwarded: https://gitlab.archlinux.org/pacman/pacman/-/merge_requests/360
+
+Touching that data inside the child makes it crash. So let's invalidate
+and ignore it there.
+
+https://github.com/curl/curl/issues/21466
+
+---
+ lib/libalpm/util.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+Taken from 
https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/commit/387ebf06060fd5f
+
+diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
+index 6739161b..8a99ef87 100644
+--- a/lib/libalpm/util.c
++++ b/lib/libalpm/util.c
+@@ -673,6 +673,11 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char 
*cmd, char *const argv[],
+                       close(cwdfd);
+               }
+ 
++#ifdef HAVE_LIBCURL
++              /* invalidate the curl data - we must not touch it in child */
++              handle->curlm = NULL;
++#endif
++
+               /* use fprintf instead of _alpm_log to send output through the 
parent */
+               /* don't chroot() to "/": this allows running with less caps 
when the
+                * caller puts us in the right root */
diff --git a/debian/patches/series b/debian/patches/series
index 704efb4..6567661 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ bash-path.patch
 fix-shebangs.patch
 fix-test-t64.patch
 versioned-po-path.patch
+invalidate-curl-data-in-child.patch
-- 
2.53.0

Reply via email to