Re: Postgresql 8.3 beta crash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgresql 8.3 beta crash
Дата
Msg-id 5341.1193929013@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgresql 8.3 beta crash  (Heikki Linnakangas <heikki@enterprisedb.com>)
Ответы Re: Postgresql 8.3 beta crash  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> I think that (1) we need a call to xml_init here, and hence also a
>> PG_TRY block; 

> xml_init doesn't actually do anything that would need to be free'd in 
> case of error. But yeah, it does seem like a good idea to free the "text 
> writer" and "xml buffer" allocated at the beginning of xmlelement(). 
> They should be allocated by xml_palloc in the current memory context, 
> though, and freed by the memory context reset as usual, but apparently 
> we don't trust that for xml document or dtd objects either.

Well, xml_init calls xmlInitParser() which needs to be cleaned up.
But since xmlelement doesn't need that, maybe we should factor it
out of xml_init.

As for the try/catch blocks instead of relying on memory context
cleanup, I'm not entirely sure if that's still needed or if it's a
hangover from before we understood how to use xmlMemSetup.  The note
at line 27ff of xml.c implies that libxml keeps static pointers to
allocated things that it thinks will survive indefinitely, so we
may have to have these.  I'm suspicious whether xmlelement doesn't
have a problem if the called expressions error out ...

Peter, any comment on this stuff?
        regards, tom lane


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

Предыдущее
От: "Hiroshi Saito"
Дата:
Сообщение: Calculation of a shared memory
Следующее
От: Camilo Porto
Дата:
Сообщение: Re: URGENT HELP about 'duration' stats