Re: BUG #15428: "Inception" with recursive prepared statement causes infinite loop
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mborch@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2018-10-15T16:21:41Z
Lists: pgsql-bugs
> 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
Commits
-
Check for stack overrun in standard_ProcessUtility().
- eb01ea2a3644 9.4.20 landed
- db9034bf7653 11.0 landed
- d48da369ab22 12.0 landed
- ca361554c24e 9.6.11 landed
- 9d4212afa100 10.6 landed
- 3a60c8bb1698 9.3.25 landed
- 10412cef11ef 9.5.15 landed