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 1wFdB5-005NW7-2H for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 19:24:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFdB4-00Eytj-36 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 19:24:02 +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 1wFdB4-00Eytb-2E for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 19:24:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFdB2-00000002Ibr-2WN3 for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 19:24:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 63MJNrXM1309666; Wed, 22 Apr 2026 15:23:53 -0400 From: Tom Lane To: Jacob Champion cc: PostgreSQL Hackers , Daniel Schreiber Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times In-reply-to: References: Comments: In-reply-to Jacob Champion message dated "Wed, 22 Apr 2026 11:29:04 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1309664.1776885833.1@sss.pgh.pa.us> Date: Wed, 22 Apr 2026 15:23:53 -0400 Message-ID: <1309665.1776885833@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion writes: > 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. I agree that we have no real ability to guarantee that. Still, as far as the presented patch goes, it seems like a clear win so I'd vote for fix-and-backpatch. Should we write the arguments as BIO_TYPE_NONE | BIO_TYPE_SOURCE_SINK rather than just BIO_TYPE_SOURCE_SINK? regards, tom lane