NetBSD Problem Report #59720

From dogcow@babymeat.com  Fri Oct 24 01:20:38 2025
Return-Path: <dogcow@babymeat.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 821D61A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 24 Oct 2025 01:20:38 +0000 (UTC)
Message-Id: <aPrUZZagRd-4nRFd@babymeat.com>
Date: Thu, 23 Oct 2025 18:20:37 -0700
From: "T K Spindler (moof)" <dogcow@babymeat.com>
Reply-To: dogcow@babymeat.com
To: gnats-bugs@netbsd.org
Subject: curl hangs or crashes with pthread_cancel enabled
X-Send-Pr-Version: 3.95

>Number:         59720
>Category:       pkg
>Synopsis:       curl hangs or crashes with pthread_cancel enabled
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 24 01:25:00 +0000 2025
>Closed-Date:    Fri Oct 24 23:54:18 +0000 2025
>Last-Modified:  Fri Oct 24 23:55:00 +0000 2025
>Originator:     dogcow@babymeat.com
>Release:        NetBSD 11.0_BETA
>Organization:

>Environment:


System: NetBSD flippy.babymeat.com 11.0_BETA NetBSD 11.0_BETA (FLIPPY) #8: Mon Oct 20 22:34:18 CDT 2025 dogcow@flippy.babymeat.com:/crap/obj/hg11obj/src/hg/11src/sys/arch/amd64/compile/FLIPPY amd64
Architecture: x86_64
Machine: amd64
>Description:
curl 8.16.0 enables use of pthread_cancel in resolver threads; this can
cause hangs and/or coredumps.

see also: https://github.com/curl/curl/issues/18532 and
https://eissing.org/icing/posts/rip_pthread_cancel/ (or the chatter on
ICB on the topic)
>How-To-Repeat:

install curl 8.16.0, run something that uses pthreads and DNS resolution;
it may eventually hit 100%/hang, and/or crash. (In my case, lwp_park and 100%
cpu utilization)
>Fix:

either unconditionally disable pthread_cancel (see
https://github.com/curl/curl/blob/curl-8_16_0/lib/curl_threads.c#L103-L129
for where it's done for FreeBSD), revert to an older version of curl, or
wait for some post-8.16 curl version. This may need to get pulled up to
pkgsrc-2025Q3 (which uses 8.16.)


>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 24 Oct 2025 04:02:25 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-pkgsrc


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59720 CVS commit: pkgsrc/www
Date: Fri, 24 Oct 2025 04:01:11 +0000

 Module Name:	pkgsrc
 Committed By:	riastradh
 Date:		Fri Oct 24 04:01:11 UTC 2025

 Modified Files:
 	pkgsrc/www/curl: Makefile distinfo
 	pkgsrc/www/libcurl-gnutls: Makefile
 Added Files:
 	pkgsrc/www/curl/patches: patch-lib_curl__threads.c

 Log Message:
 www/curl, www/libcurl-gnutls: Disable pthread_cancel.

 This upstream change is broken on just about every platform because
 getaddrinfo is not really cancel-safe, even though it's kinda sorta
 supposed to be in POSIX
 (https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_09_05_02).

 The mistake has been backed out upstream for the next release, but
 that won't come until November and we need to pull up the fix now
 because it's already biting users.

 https://eissing.org/icing/posts/pthread_cancel/
 https://eissing.org/icing/posts/rip_pthread_cancel/
 https://github.com/curl/curl/issues/18532
 https://github.com/curl/curl/pull/18540/files

 PR pkg/59720: curl hangs or crashes with pthread_cancel enabled


 To generate a diff of this commit:
 cvs rdiff -u -r1.300 -r1.301 pkgsrc/www/curl/Makefile
 cvs rdiff -u -r1.219 -r1.220 pkgsrc/www/curl/distinfo
 cvs rdiff -u -r0 -r1.1 pkgsrc/www/curl/patches/patch-lib_curl__threads.c
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/www/libcurl-gnutls/Makefile

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

State-Changed-From-To: needs-pullups->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 24 Oct 2025 23:54:18 +0000
State-Changed-Why:
Pulled up


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59720 CVS commit: [pkgsrc-2025Q3] pkgsrc/www
Date: Fri, 24 Oct 2025 23:53:01 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Fri Oct 24 23:53:01 UTC 2025

 Modified Files:
 	pkgsrc/www/curl [pkgsrc-2025Q3]: Makefile distinfo
 	pkgsrc/www/libcurl-gnutls [pkgsrc-2025Q3]: Makefile
 Added Files:
 	pkgsrc/www/curl/patches [pkgsrc-2025Q3]: patch-lib_curl__threads.c

 Log Message:
 Pullup ticket #7027 - requested by bsiegert
 www/curl: Bug fix
 www/libcurl-gnutls: Bug fix

 Revisions pulled up:
 - www/curl/Makefile                                             1.301
 - www/curl/distinfo                                             1.220
 - www/curl/patches/patch-lib_curl__threads.c                    1.1
 - www/libcurl-gnutls/Makefile                                   1.19

 ---
    Module Name:	pkgsrc
    Committed By:	riastradh
    Date:		Fri Oct 24 04:01:11 UTC 2025

    Modified Files:
    	pkgsrc/www/curl: Makefile distinfo
    	pkgsrc/www/libcurl-gnutls: Makefile
    Added Files:
    	pkgsrc/www/curl/patches: patch-lib_curl__threads.c

    Log Message:
    www/curl, www/libcurl-gnutls: Disable pthread_cancel.

    This upstream change is broken on just about every platform because
    getaddrinfo is not really cancel-safe, even though it's kinda sorta
    supposed to be in POSIX
    (https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_09_05_02).

    The mistake has been backed out upstream for the next release, but
    that won't come until November and we need to pull up the fix now
    because it's already biting users.

    https://eissing.org/icing/posts/pthread_cancel/
    https://eissing.org/icing/posts/rip_pthread_cancel/
    https://github.com/curl/curl/issues/18532
    https://github.com/curl/curl/pull/18540/files

    PR pkg/59720: curl hangs or crashes with pthread_cancel enabled


 To generate a diff of this commit:
 cvs rdiff -u -r1.298 -r1.298.4.1 pkgsrc/www/curl/Makefile
 cvs rdiff -u -r1.219 -r1.219.2.1 pkgsrc/www/curl/distinfo
 cvs rdiff -u -r0 -r1.1.2.2 pkgsrc/www/curl/patches/patch-lib_curl__threads.c
 cvs rdiff -u -r1.17 -r1.17.4.1 pkgsrc/www/libcurl-gnutls/Makefile

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.