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 20080110032045.GE22548@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>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #3860: xpath crashes backend when is querying xmlagg result
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: BUG #3865: ERROR: failed to build any 8-way joins