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.98.2) (envelope-from ) id 1xMtmJ-00000002G9C-06I9 for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Oct 2026 21:04:47 +0000 Received: from localhost ([127.0.0.1]:50644 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xMtmI-0000000CA2Z-1LYi for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Oct 2026 21:04:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:59682) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMtmI-0000000CA2R-0EpM for pgsql-bugs@lists.postgresql.org; Fri, 30 Oct 2026 21:04:46 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMtmF-00000001opN-2ptt for pgsql-bugs@lists.postgresql.org; Fri, 30 Oct 2026 21:04:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 69UL4XD42751952; Fri, 30 Oct 2026 17:04:33 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 69UL4XD42751952 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1793394273; bh=AOsk6Zu4QccJvhWunT/bXJtX1DtJsCij3ry6f1A8yQM=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=dnuP4NycGzhm4cwLn2KB5knZ05bvj1eN/1tMW4cC9awyD0zGISjBCbAqjJZey/Ijg RMRhdYIOtPt/hbJTpi20f1RjBmDVh3eur+Dc8Qh3kugXtuUR/Dtf4cZ2wUVvm4kLw0 JyufSHgyG5FZ+BSdcEfGqRAOwCaWvFMl+O7E2NCQ= From: Tom Lane To: Jacob Champion cc: Matt Carter , Andres Freund , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #19411: libpq 16.x exhibits a memory leak when connections are repeatedly created and destroyed In-reply-to: References: <19411-0440c8897a04b638@postgresql.org> <1702505.1771347709@sss.pgh.pa.us> <1881734.1771354069@sss.pgh.pa.us> <6xylkfh6idnx7ujhfhyoxku3v67ygoeve4yt7z2ytc65vzwvcv@z2sj5jnamhbe> <2114661.1793306838@sss.pgh.pa.us> <2601836.1793379300@sss.pgh.pa.us> <2744647.1793388749@sss.pgh.pa.us> Comments: In-reply-to Jacob Champion message dated "Fri, 30 Oct 2026 13:09:41 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2751950.1793394273.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 30 Oct 2026 17:04:33 -0400 Message-ID: <2751951.1793394273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion writes: > On Fri, Oct 30, 2026 at 12:32 PM Tom Lane wrote: >> How can delegation succeed if there's nothing to delegate? > IIUC, GSS_C_NO_CREDENTIAL doesn't actually mean "no credentials" to > gss_init_sec_context(), it means "get the default credentials from > somewhere magic." I don't know enough about the API to know whether > the gss_acquire_cred() call we're making separately is equivalent to > that magic behavior. Oh, that's very interesting! If you look back at v14, there is just one call to pg_GSS_have_cred_cache, and AFAICS it happens unconditionally if we attempt GSS encryption, and we don't reach any other GSS code if it fails. In the code as it stands, my coverage result says it's possible to reach pg_GSS_continue without having already obtained credentials, but I don't quite see how. select_next_encryption_method doesn't look like it will permit using ENC_GSSAPI unless we obtain credentials. Too bad this code is so poorly documented. It's really pretty unclear what the intent is. regards, tom lane