[HACKERS] segfault in HEAD when too many nested functions call

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема [HACKERS] segfault in HEAD when too many nested functions call
Дата
Msg-id b0af9eaa-130c-60d0-9e4e-7a135b1e0c76@dalibo.com
обсуждение исходный текст
Ответы Re: [HACKERS] segfault in HEAD when too many nested functions call  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] [WIP] Zipfian distribution in pgbench
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Pluggable storage