pgsql: Add a stack overflow check to copyObject().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Add a stack overflow check to copyObject().
Дата
Msg-id E1PPoiE-0003CL-Ca@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add a stack overflow check to copyObject().

There are some code paths, such as SPI_execute(), where we invoke
copyObject() on raw parse trees before doing parse analysis on them.  Since
the bison grammar is capable of building heavily nested parsetrees while
itself using only minimal stack depth, this means that copyObject() can be
the front-line function that hits stack overflow before anything else does.
Accordingly, it had better have a check_stack_depth() call.  I did a bit of
performance testing and found that this slows down copyObject() by only a
few percent, so the hit ought to be negligible in the context of complete
processing of a query.

Per off-list report from Toshihide Katayama.  Back-patch to all supported
branches.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=8b5692809707c0e15d04c530a3fed9347350ea01

Modified Files
--------------
src/backend/nodes/copyfuncs.c |    4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Add a stack overflow check to copyObject().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Add a stack overflow check to copyObject().