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 1qDdox-0002Sx-MS for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jun 2023 04:27:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qDdow-0006wu-ID for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Jun 2023 04:27:22 +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 1qDdow-0006vB-92 for pgsql-bugs@lists.postgresql.org; Mon, 26 Jun 2023 04:27:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qDdon-000VpW-Pt for pgsql-bugs@lists.postgresql.org; Mon, 26 Jun 2023 04:27:21 +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 35Q4R8pl636985; Mon, 26 Jun 2023 00:27:08 -0400 From: Tom Lane To: Michael Paquier cc: Alexander Lakhin , zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17995: Segmentation fault caused by UPDATE statement In-reply-to: References: <17995-9f20ff3e6389db4c@postgresql.org> <285547.1687636319@sss.pgh.pa.us> <68148dac-a574-f421-2905-51ebde2fe000@gmail.com> Comments: In-reply-to Michael Paquier message dated "Mon, 26 Jun 2023 13:21:47 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <636982.1687753628.1@sss.pgh.pa.us> Date: Mon, 26 Jun 2023 00:27:08 -0400 Message-ID: <636983.1687753628@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Sun, Jun 25, 2023 at 06:00:00AM +0300, Alexander Lakhin wrote: >> BTW, there is a commitfest entry to eliminate a bunch of other stack >> overflow hazards (may be the fuzzer can find some of them too): >> https://commitfest.postgresql.org/43/4239/ > Thanks for the pointer, I'll double-check that. Some of the locations > of stack depth checks proposed involve performance-sensitive code > paths, though, like mcxt.c :/ I hadn't looked at the patch yet, but ... mcxt.c? How is that recursive? Even if there is some path that recurses through that, wouldn't the check be better placed in a less-hot part of the loop? regards, tom lane