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 1xA6zI-00000002STh-3zaw for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2026 14:33:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xA6zG-00000001ApE-2klI for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2026 14:33:18 +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.98.2) (envelope-from ) id 1xA6zG-00000001Ap6-1YIh for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2026 14:33:18 +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 1xA6zE-00000001D7Z-012x for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2026 14:33:17 +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 68PEXC4l1881625; Fri, 25 Sep 2026 10:33:12 -0400 From: Tom Lane To: Dirkjan Bussink cc: pgsql-hackers@lists.postgresql.org Subject: Re: Server crash when describing a FETCH statement after its cursor is closed In-reply-to: <7DE248EB-7509-4F8A-9F37-4694A40BBAB7@gmail.com> References: <7DE248EB-7509-4F8A-9F37-4694A40BBAB7@gmail.com> Comments: In-reply-to Dirkjan Bussink message dated "Fri, 25 Sep 2026 13:29:40 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1881623.1790346792.1@sss.pgh.pa.us> Date: Fri, 25 Sep 2026 10:33:12 -0400 Message-ID: <1881624.1790346792@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dirkjan Bussink writes: > The following extended-protocol sequence crashes a backend (SIGSEGV > in production builds, assertion failure in assert-enabled ones), and > the postmaster terminates all other sessions for crash recovery: Thanks for the report. > The attached patch replaces the Assert with a runtime check returning > NIL, mirroring the guard in UtilityTupleDescriptor(). A regression > test is included. I'm not convinced by this blithe assertion "not our business to raise error". The adjacent case for ExecuteStmt *will* raise an error if it can't find the prepared statement; why shouldn't this case act like that one? IOW, the sequence of client operations that you show is invalid, and I think we ought to push back on that accordingly. regards, tom lane