Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMCbK-0005dw-O0 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 16:31:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMCbJ-0001zP-LB for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 16:31:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMCbJ-0001zI-F3 for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 16:31:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMCbH-0003BN-9X for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 16:31:20 +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 12GGVH973255515; Tue, 16 Mar 2021 12:31:17 -0400 From: Tom Lane To: Jelte Fennema cc: Michael Paquier , duspensky@ya.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption In-reply-to: References: <16160-18367e56e9a28264@postgresql.org> <20191213063915.GE1942@paquier.xyz> <20191214092456.GB70616@paquier.xyz> Comments: In-reply-to Jelte Fennema message dated "Tue, 16 Mar 2021 16:34:17 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3255513.1615912277.1@sss.pgh.pa.us> Date: Tue, 16 Mar 2021 12:31:17 -0400 Message-ID: <3255514.1615912277@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jelte Fennema writes: > We ran into this memory leak on PG11 in production. The lea was determined > to be the root cause of OOM errors we were seeing. There was a combination > of a things that caused this leak to become serious enough for these OOM > errors to happen: I follow the argument that a leak in the postmaster's SIGHUP processing could accumulate enough to be a problem. However, how sure are you really that this specific bug accounts for all of the leakage you saw? I'm wondering about that because I see some other stuff in be_tls_init() that looks like it might get leaked, notably the root_cert_list read from the ssl_ca_file. This code was originally meant to be run exactly once at postmaster start, so it's not too surprising that it's not as careful as it now needs to be. regards, tom lane