Re: Postgresql 8.3 beta crash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Postgresql 8.3 beta crash
Дата
Msg-id 26241.1194291013@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Postgresql 8.3 beta crash  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Heikki Linnakangas wrote:
>> It still feels unsafe to call ExecEvalExpr while holding on to xml
>> structs. It means that it's not safe for external modules to use
>> libxml2 and call xmlMemSetup or xmlSetGenericErrorFunc themselves.

> Well yeah, they shouldn't do that.  I don't think we want to support 
> that.

I'm with Heikki that it would be cleaner/safer if we could allow that.
The particular case that's bothering me is the idea that something like
Perl could well try to use libxml internally, and if so it'd very likely
call these functions.  Now if Perl thinks it's got sole control, and
tries to (say) re-use the results of xmlInitParser across calls, we're
screwed anyway.  But that's not an argument for designing our own code
in a way that guarantees it can't share libxml with other code.

So I'm thinking that we should continue to call xmlMemSetup,
xmlSetGenericErrorFunc, and xmlInitParser (if needed) at the start of
every XML function, and reorganize the code so that we don't call out
to random other code until we've shut down libxml again.

The main disadvantage I can see of reorganizing like that is that
it will increase xmlelement's transient memory consumption, since it
will need to accumulate all the OutputFunctionCall result strings
before it starts to pass them to libxml.  This probably isn't a huge
problem though.

Has anyone started actively working on this yet?  If not, I can tackle
it.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg 8.3beta 2 restore db with autovacuum report
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is necessary to use SEQ_MAXVALUE in pg_dump?