Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFd9O-005NTy-0W for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 19:22:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFd9N-00Ews0-1h for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 19:22:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFd9N-00Ewrs-08 for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 19:22:17 +0000 Received: from sienna.cherry.relay.mailchannels.net ([23.83.223.165]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFd9K-00000002IaC-1Tsi for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 19:22:16 +0000 X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A3386401F3E; Wed, 22 Apr 2026 19:22:12 +0000 (UTC) Received: from pdx1-sub0-mail-a261.dreamhost.com (100-96-17-221.trex-nlb.outbound.svc.cluster.local [100.96.17.221]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 34F8C402BA9; Wed, 22 Apr 2026 19:22:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; d=mailchannels.net; s=arc-2022; cv=none; t=1776885732; b=2e7P0tqMET/ztdxBlP4FDqNgnv69Qy8c1xfQdSfEArmLFx5/MzCMTc2YrfO5wYGVx1qWsN /9sADaWpNlzYDuoa+ZKrjEJrPszpCNSpQDsc1lZb5mWAK0gthBprGGw9gRqGQjx6F52Imt EE/Wilhv4gIAkUhCz2aXfjy5TrvxP4FcUzdob1EuCGv86Jh2La91WlQXjG0bQXYuMR+Hcu BtIdtdoZDIL5u65cyDuki7APB5SQxWKNzoTprsBTBhdpb85f9hH51rq9503dbP06SLjMYK 2oNF7Wb0hdEVI03/BIJx3FlJoW+BmWkAvKzC6Lk9UyXwL+N0EpVkCGFbTMHdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1776885732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7wUlsTYs8oewLAiGTURzw5sR6DjFkDYEGlIIwBo5Nfw=; b=IUN3VJcGclZ1D+9dBjGzHM/AQzoua8zgSE4/Ok4TChVhqtj3rZYW06/y3dEYuY1Wuz+6ej oI6rZBkkKoofHKppCW4O2zcKVE5fF+pW05Yz3mHxHZr0ryXAY2X5ajrNkTayhAmh6lg2QZ xEroPBpFGMr6oP1M4NBSL+6wWj66H8My5BlSn1aAZTH7YzXeKmaUt3Vx/TIG6NS4U2sPi5 acyGDn5JoucT8UwtQc+oHM3FT+6G74t1Wi5hpV2gCcJv44MG8dkZwnn+3JECTppajE26Jz uwcrAkHKtucJuvIG0I4gDNTbzWTtCc3wgIiAAI6QXcVR2wJuprXdQujDvtqBEw== ARC-Authentication-Results: i=1; rspamd-b9d4fc544-sdx2b; auth=pass smtp.auth=dreamhost smtp.mailfrom=nico@cryptonector.com X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com X-MailChannels-Auth-Id: dreamhost X-Blushing-Bored: 30f3af060e66c2d3_1776885732524_1529586130 X-MC-Loop-Signature: 1776885732524:1687677033 X-MC-Ingress-Time: 1776885732524 Received: from pdx1-sub0-mail-a261.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.17.221 (trex/7.1.5); Wed, 22 Apr 2026 19:22:12 +0000 Received: from ubby (unknown [75.81.95.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a261.dreamhost.com (Postfix) with ESMTPSA id 4g18HR4dKdz104d; Wed, 22 Apr 2026 12:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1776885732; bh=7wUlsTYs8oewLAiGTURzw5sR6DjFkDYEGlIIwBo5Nfw=; h=Date:From:To:Cc:Subject:Content-Type; b=eZhJEZo5/r4Fd7r1GgGORfvTPREALUZlJflpKH9sSVxz0E1bAzfDaAA8claGJd/Ja 5Q3oX5hD3azoTD/Zp8ilILdDcNXCDCIG7BWuKebBKhijiMNTX9jc8F+HjiLOwSNtNz rGOD1rx9XyPCAwR3j4WdkAmBp9k7aynS7tKwNVlpEJvdOPch5nRl1vzPbwKklRKDy5 wC462icA5axl8UaVG2VlfHboaIV/pB/HikwEdU1vYB5ZJ7ZdZDgSF95cYHyaVDDTcS 2qRJyrXMgqfi28C0Ea0zk6x42Ys4bNlevhtRuQiw1jqPfGhQngFt5uOd6JPsersT3x X7nSkvYU1XwqQ== Date: Wed, 22 Apr 2026 14:22:09 -0500 From: Nico Williams To: Jacob Champion Cc: PostgreSQL Hackers , Daniel Schreiber Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 22, 2026 at 11:29:04AM -0700, Jacob Champion wrote: > > (I'd be surprised if this were the only such resource leak across all > > supported versions and combinations of Kerberos, OpenSSL, OpenLDAP, > > Curl, etc. etc. From a quick search, you're the first to report this > > in the ten years since the leak was introduced, so there may be more > > dragons where you're headed.) > > If anyone has thoughts on that, I'd love to hear them. I don't mind > removing this unnecessary code in HEAD, or even backpatching as a > courtesy -- but if it were up to me, I would not guarantee zero global > resource leaks across libpq and its entire dependency graph. (Even if > we magically had control over all those dependencies, I think it'd > still be reasonable for libpq devs to use "allocate once and move on" > patterns... and I want to continue using those in my new code.) Leaking a dl handle is a way to prevent unloading. Not saying that's a great answer, just that it's a workaround.