Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions
Дата
Msg-id 49A80BE5.6010608@enterprisedb.com
обсуждение исходный текст
Ответ на Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions
Список pgsql-bugs
Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> I think we should instead try to break the PANIC cycle. If we exceed
>> ERRORDATA_STACK_SIZE, and we're already PANICing, we should just die
>> immediately instead of throwing another PANIC about exceeding the stack
>> size. The attached patch does that.
>
> I don't think that's an improvement.
>
> I'm not sure exactly why the previous fix for this type of problem
> failed to cover this case --- did you identify why?

When the conversion function throws an ERROR, we try to send the error
message to the client. As part of that, we try to convert the text
"ERROR" to the client encoding (pq_sendstring does that). That calls the
conversion function again, which errors again, lathe, rinse, repeat.
until ERRORDATA_STACK_SIZE is reached. At that point, the same happens
with the text "PANIC", until ERRORDATA_STACK_SIZE is reached again, and
then we get into an endless recursion.

When the conversion function doesn't work, any attempt to send any text
to the client will fail.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4680: Server crashed if using wrong (mismatch) conversion functions