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 1jQuAc-0005IZ-09 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 14:46:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQuAa-0001CC-Tx for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 14:46:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQuAa-0001Bp-Nu for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2020 14:46:40 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQuAY-00032m-9Q for pgsql-bugs@postgresql.org; Tue, 21 Apr 2020 14:46:40 +0000 Received: from Davids-MacBook-Pro.local (c-73-39-102-148.hsd1.md.comcast.net [73.39.102.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 978D65465C; Tue, 21 Apr 2020 14:46:35 +0000 (UTC) Subject: Re: Bug with memory leak on cert validation in libpq To: Michael Paquier , Roman Peshkurov Cc: pgsql-bugs@postgresql.org References: <20200421044235.GA6436@paquier.xyz> From: David Steele Message-ID: <62894bf0-4bde-1d5b-75a2-20d44fc47fe6@pgmasters.net> Date: Tue, 21 Apr 2020 10:46:34 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200421044235.GA6436@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/21/20 12:42 AM, Michael Paquier wrote: > On Mon, Apr 20, 2020 at 08:40:06PM +0300, Roman Peshkurov wrote: >> The problem is incorrect usage of openssl stack "destructor". We noticed it >> on a graphs for the few months. It looked lika an increasing line of res >> memory usage. > > And finally, this needs to be backpatched all the way down to 9.5, so > I'll take care of it if there are no objections. +1. We have similar code in pgBackRest and I can see the leak there as well when I adjust our Valgrind supressions a bit. I also reviewed the OpenSSL code and agree this is the right fix. Regards, -- -David david@pgmasters.net