Re: BUG #3860: xpath crashes backend when is querying xmlagg result

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Sokolov Yura <funny(dot)falcon(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Date: 2008-01-10 00:41:14
Message-ID: 20080110004114.GD22548@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

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 Content-Type Size
xml.patch text/x-diff 4.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-01-10 01:36:52 Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Previous Message Andrew Gilligan 2008-01-10 00:17:03 Re: BUG #3866: Segfault during table update when using convert_from()

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-01-10 01:16:36 Re: Revised patch for fixing archiver shutdown behavior
Previous Message Tom Lane 2008-01-10 00:39:14 Re: Revised patch for fixing archiver shutdown behavior