From: Tom Lane <tgl@sss.pgh.pa.us>
To: mborch@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15428: "Inception" with recursive prepared statement causes infinite loop
Date: Mon, 15 Oct 2018 12:21:41 -0400
Message-ID: <1316.1539620501@sss.pgh.pa.us> (raw)
In-Reply-To: <15428-b3c2915ec470b033@postgresql.org>
References: <15428-b3c2915ec470b033@postgresql.org>
> Using the extended query message flow, I prepare, bind and execute a query
> as a named statement.
> If I repeat this again with the query "execute <name>" – the backend crashes
> with a segmentation fault due to an infinite recursion (see excerpt
> below).
Hm, yeah. I'm inclined to think that the right fix is a
check_stack_depth() call in standard_ProcessUtility.
That transforms the case into
$ ./test
PQexecPrepared failed: ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
which seems like an adequate response, and would cover some
related scenarios as well.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, mborch@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15428: "Inception" with recursive prepared statement causes infinite loop
In-Reply-To: <1316.1539620501@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