Re: BUG #3860: xpath crashes backend when is querying xmlagg result - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Date
Msg-id 20080110004114.GD22548@alvh.no-ip.org
Whole thread Raw
In response to Re: BUG #3860: xpath crashes backend when is querying xmlagg result  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Re: BUG #3860: xpath crashes backend when is querying xmlagg result
List pgsql-bugs
Tom Lane escribió:

> We might be able to compromise by only resetting the context after
> an error, but this is still only possible if we have a way to make
> libxml let go of *all* pointers to alloc'd objects.  I don't understand
> your comment that xmlCleanupParser solves it --- we call that already,
> and it doesn't seem to be preventing the problem.

With the attached patch, it doesn't crash, but I see the added WARNING
four times in the log, which is proof that the cleanup thing is not
called as the code seems to think.

I wonder -- is this thing supposed to be reentrant?  I think that's the
whole problem with it.

(I think what I'm doing in xml_init in the non-first case is bogus
anyway -- but I post the patch to show my point.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment

pgsql-bugs by date:

Previous
From: Andrew Gilligan
Date:
Subject: Re: BUG #3866: Segfault during table update when using convert_from()
Next
From: Tom Lane
Date:
Subject: Re: BUG #3860: xpath crashes backend when is querying xmlagg result