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 03:20:46
Message-ID: 20080110032045.GE22548@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Tom Lane escribió:
> I wonder whether the real issue here isn't that we have some functions
> that invoke libxml without ultimately doing xmlCleanupParser() ---
> xml_in being the first obvious candidate. Maybe that is the mechanism
> through which libxml ends up with dangling pointers.

Hmm. I see that xml_in uses xml_parse, which does call
xmlCleanupParser. However, I see that xml_in calls xmlFreeDoc _after_
xmlCleanupParser. Maybe that's a bug in itself. However, I doubt that
explains the issue at hand, because as far as the segmentation fault,
nobody has called xmlCleanupParser yet. Perhaps look for another
candidate.

Another thing I'm wondering is why xml_parse is wasting time returning
the parsed document, if all callers just call xmlFreeDoc() on it
immediately.

Hmm ... parse_xml_decl is seen calling xml_init and libxml functions,
but not xmlCleanupParser.

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2008-01-10 07:48:37 Re: BUG #3865: ERROR: failed to build any 8-way joins
Previous Message Tom Lane 2008-01-10 01:36:52 Re: BUG #3860: xpath crashes backend when is querying xmlagg result

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-01-10 13:59:05 Re: Revised patch for fixing archiver shutdown behavior
Previous Message Bruce Momjian 2008-01-10 03:01:21 Re: DOC: Wal update