From 177a5a00aad7a096b665b94c556186404c6f6700 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Fri, 31 Oct 2025 06:55:15 -0400 Subject: [PATCH 1/3] libcurl: apply patch for netlink error fix --- L/LibCURL/LibCURL@7/build_tarballs.jl | 2 +- L/LibCURL/LibCURL@8/build_tarballs.jl | 2 +- L/LibCURL/common.jl | 3 ++ L/LibCURL/patches/eventfd-double-close.patch | 35 ++++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 L/LibCURL/patches/eventfd-double-close.patch diff --git a/L/LibCURL/LibCURL@7/build_tarballs.jl b/L/LibCURL/LibCURL@7/build_tarballs.jl index d3617ea0c68..b262ed74f5c 100644 --- a/L/LibCURL/LibCURL@7/build_tarballs.jl +++ b/L/LibCURL/LibCURL@7/build_tarballs.jl @@ -2,4 +2,4 @@ include("../common.jl") build_libcurl(ARGS, "LibCURL", v"7.88.1"; with_zstd=false) -# Build trigger: 2 +# Build trigger: 3 diff --git a/L/LibCURL/LibCURL@8/build_tarballs.jl b/L/LibCURL/LibCURL@8/build_tarballs.jl index 438b3b6242a..cd5df2ae052 100644 --- a/L/LibCURL/LibCURL@8/build_tarballs.jl +++ b/L/LibCURL/LibCURL@8/build_tarballs.jl @@ -2,4 +2,4 @@ include("../common.jl") build_libcurl(ARGS, "LibCURL", v"8.16.0"; with_zstd=true) -# Build trigger: 2 +# Build trigger: 3 diff --git a/L/LibCURL/common.jl b/L/LibCURL/common.jl index 51308d09d26..8ff73cf9c9f 100644 --- a/L/LibCURL/common.jl +++ b/L/LibCURL/common.jl @@ -80,6 +80,9 @@ function build_libcurl(ARGS, name::String, version::VersionNumber; with_zstd=fal # Address atomic_patch -p1 $WORKSPACE/srcdir/memdup.patch + # Address + atomic_patch -p1 $WORKSPACE/srcdir/eventfd-double-close.patch + # Holy crow we really configure the bitlets out of this thing FLAGS=( # Disable....almost everything diff --git a/L/LibCURL/patches/eventfd-double-close.patch b/L/LibCURL/patches/eventfd-double-close.patch new file mode 100644 index 00000000000..8f77ee9f6ce --- /dev/null +++ b/L/LibCURL/patches/eventfd-double-close.patch @@ -0,0 +1,35 @@ +From ff5091aa9f73802e894b1cbdf24ab84e103200e2 Mon Sep 17 00:00:00 2001 +From: Andy Pan +Date: Thu, 12 Dec 2024 12:48:56 +0000 +Subject: [PATCH] async-thread: avoid closing eventfd twice + +When employing eventfd for socketpair, there is only one file +descriptor. Closing that fd twice might result in fd corruption. +Thus, we should avoid closing the eventfd twice, following the +pattern in lib/multi.c. + +Fixes #15725 +Closes #15727 +Reported-by: Christian Heusel +--- + lib/asyn-thread.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c +index a58e4b790494..32d496b107cb 100644 +--- a/lib/asyn-thread.c ++++ b/lib/asyn-thread.c +@@ -195,9 +195,11 @@ void destroy_thread_sync_data(struct thread_sync_data *tsd) + * close one end of the socket pair (may be done in resolver thread); + * the other end (for reading) is always closed in the parent thread. + */ ++#ifndef USE_EVENTFD + if(tsd->sock_pair[1] != CURL_SOCKET_BAD) { + wakeup_close(tsd->sock_pair[1]); + } ++#endif + #endif + + memset(tsd, 0, sizeof(*tsd)); +-- +2.47.1 From 490ebd7b53c96981f217f2b1e34eedb893f0d57d Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Fri, 31 Oct 2025 07:05:29 -0400 Subject: [PATCH 2/3] only v8 --- L/LibCURL/LibCURL@7/build_tarballs.jl | 2 +- L/LibCURL/common.jl | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/L/LibCURL/LibCURL@7/build_tarballs.jl b/L/LibCURL/LibCURL@7/build_tarballs.jl index b262ed74f5c..d3617ea0c68 100644 --- a/L/LibCURL/LibCURL@7/build_tarballs.jl +++ b/L/LibCURL/LibCURL@7/build_tarballs.jl @@ -2,4 +2,4 @@ include("../common.jl") build_libcurl(ARGS, "LibCURL", v"7.88.1"; with_zstd=false) -# Build trigger: 3 +# Build trigger: 2 diff --git a/L/LibCURL/common.jl b/L/LibCURL/common.jl index 8ff73cf9c9f..3a2051ec62d 100644 --- a/L/LibCURL/common.jl +++ b/L/LibCURL/common.jl @@ -64,8 +64,12 @@ function build_libcurl(ARGS, name::String, version::VersionNumber; with_zstd=fal # Disable nss only for CURL < 8.16 without_nss = version < v"8.16.0" + # Apply eventfd patch only for v8+ (USE_EVENTFD doesn't exist in v7) + apply_eventfd_patch = version >= v"8" + config = "THIS_IS_CURL=$(this_is_curl_jll)\n" config *= "MACOS_USE_OPENSSL=$(macos_use_openssl)\n" + config *= "APPLY_EVENTFD_PATCH=$(apply_eventfd_patch)\n" if with_zstd config *= "HAVE_ZSTD=true\n" end @@ -80,8 +84,10 @@ function build_libcurl(ARGS, name::String, version::VersionNumber; with_zstd=fal # Address atomic_patch -p1 $WORKSPACE/srcdir/memdup.patch - # Address - atomic_patch -p1 $WORKSPACE/srcdir/eventfd-double-close.patch + # Address (only for v8+) + if [[ "${APPLY_EVENTFD_PATCH}" == "true" ]]; then + atomic_patch -p1 $WORKSPACE/srcdir/eventfd-double-close.patch + fi # Holy crow we really configure the bitlets out of this thing FLAGS=( From f14265a43d39b3f787a679a7e1ced5e1bf7baa32 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Fri, 31 Oct 2025 07:18:33 -0400 Subject: [PATCH 3/3] roll back to 8.11.1 --- L/LibCURL/LibCURL@8/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L/LibCURL/LibCURL@8/build_tarballs.jl b/L/LibCURL/LibCURL@8/build_tarballs.jl index cd5df2ae052..3e0b2d317cf 100644 --- a/L/LibCURL/LibCURL@8/build_tarballs.jl +++ b/L/LibCURL/LibCURL@8/build_tarballs.jl @@ -1,5 +1,5 @@ include("../common.jl") -build_libcurl(ARGS, "LibCURL", v"8.16.0"; with_zstd=true) +build_libcurl(ARGS, "LibCURL", v"8.11.1"; with_zstd=true) # Build trigger: 3