Re: remove contrib/xml2

From: M Z <jm80008(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: remove contrib/xml2
Date: 2010-02-18 04:31:49
Message-ID: e824728e1002172031q7b592af7u1f344e2e3d76733f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alvaro,

I followed your instruction but put the patch on 8.4.2 as I found it
crashes. It looks like the server still crash in the same way. Can you and
anyone give me some ideas how to fix this bug?

==============================
conifer=# CREATE TABLE xpath_test (id integer NOT NULL, t xml);
CREATE TABLE
conifer=# INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
INSERT 0 1
conifer=# SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int',
'true') as t(id int4);
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>
==============================

Best,
M Z

>
> > CREATE TABLE xpath_test (id integer NOT NULL, t xml);
> > INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
> > SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
> > as t(id int4);
>
> > Hmm. Well, all I know is that the first thing I tried crashed the
> server.
>

> This trivial patch lingering on my system fixes this crasher (this is
> for the 8.3 branch). It makes the "problem in alloc set ExprContext"
> warning show up instead.
>
> There are still lotsa other holes, but hey, this is a start ...
>
> Index: contrib/xml2/xpath.c
> ===================================================================
> RCS file: /home/alvherre/Code/cvs/pgsql/contrib/xml2/xpath.c,v
> retrieving revision 1.16.2.1
> diff -c -p -r1.16.2.1 xpath.c
> *** contrib/xml2/xpath.c 26 Mar 2008 01:19:11 -0000 1.16.2.1
> --- contrib/xml2/xpath.c 27 Jan 2010 15:30:56 -0000
> *************** xpath_table(PG_FUNCTION_ARGS)
> *** 793,798 ****
> --- 793,801 ----
> */
> pgxml_parser_init();
>
> + PG_TRY();
> + {
> +
> /* For each row i.e. document returned from SPI */
> for (i = 0; i < proc; i++)
> {
> *************** xpath_table(PG_FUNCTION_ARGS)
> *** 929,934 ****
> --- 932,944 ----
> if (xmldoc)
> pfree(xmldoc);
> }
> + }
> + PG_CATCH();
> + {
> + xmlCleanupParser();
> + PG_RE_THROW();
> + }
> + PG_END_TRY();
>
> xmlCleanupParser();
> /* Needed to flag completeness in 7.3.1. 7.4 defines it as a no-op. */
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-02-18 04:34:24 A thought: should we run pgindent now?
Previous Message Tom Lane 2010-02-18 04:13:40 Re: NOTIFY/LISTEN on read-only slave?