pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dirkjan Bussink <d.bussink@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Server crash when describing a FETCH statement after its cursor is closed
Date: Fri, 25 Sep 2026 10:33:12 -0400
Message-ID: <1881624.1790346792@sss.pgh.pa.us> (raw)
In-Reply-To: <7DE248EB-7509-4F8A-9F37-4694A40BBAB7@gmail.com>
References: <7DE248EB-7509-4F8A-9F37-4694A40BBAB7@gmail.com>

Dirkjan Bussink <d.bussink@gmail.com> 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






view thread (6+ messages)  latest in thread

Message-ID: <1881624.1790346792@sss.pgh.pa.us>
Permalink:  ../1881624.1790346792@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1881624.1790346792@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, d.bussink@gmail.com
  Subject: Re: Server crash when describing a FETCH statement after its cursor is closed
  In-Reply-To: <1881624.1790346792@sss.pgh.pa.us>
  References: <7DE248EB-7509-4F8A-9F37-4694A40BBAB7@gmail.com> <1881624.1790346792@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox