Hello,
Since b8d7f053c5c2bf2a7e8734fe3327f6a8bc711755 (Andres in Cc), if you
write queries which result in infinite recursion (or just too many
nested function calls), execution ends with segfault instead of intended
exhausted max_stack_depth:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000df851e in DirectFunctionCall1Coll (
func=<error reading variable: Cannot access memory at address
0x7ffef5972f98>,
collation=<error reading variable: Cannot access memory at address
0x7ffef5972f94>,
arg1=<error reading variable: Cannot access memory at address
0x7ffef5972f88>) at fmgr.c:708
Please find attached a trivial patch to fix this. I'm not sure
ExecMakeTableFunctionResult() is the best or only place that needs to
check the stack depth.
I also attached a simple sql file to reproduce the issue if needed.
Should I add a regression test based on it?
--
Julien Rouhaud
http://dalibo.com - http://dalibo.org
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers