Thread: Postgres 8.4 Segfault on xpath

Postgres 8.4 Segfault on xpath

From
Frank jansen
Date:
Hi,

I am trying to migrate a 32-Bit server running Postgres 8.3.1 to another
machine running 8.4.0 on 64-bit. I have compiled Postgres 8.4.2 on a
Debian Leeny 64-Bit System and getting constantly Segmentation Faults
(Terminated Postgres Server by Signal 11) when a specific function,
which uses xpath is executed. When i execute the function with the xpath
statement alone in psql, it is working as expected. But if i execute a
cascaded function, whose child is executing the function, which uses the
xpath statement, i get the segfault.

I tried postgres 8.4.0 and 8.4.2 self compiled with  elf compiled
contrib directory,  tried Debians 8.4 backport package with the 8.4
contrib package and all do the same: Segfault and terminated by Signal
11 :-(

I just compiled Postgres 8.3.1 on the new 64-Bit rig and it is running
fine...
But my boss wants me to move to 8.4, so i am a bit lost.

Kind regards,

Frank Jansen

The function:

feedimport.is_blacklisted(p_external_broker_id,xpath_string(l_xml_item,'/immobilie/verwaltung_techn/objektnr_extern'))



Re: Postgres 8.4 Segfault on xpath

From
Dimitri Fontaine
Date:
Frank jansen <jansen@fumarium.de> writes:
> I tried postgres 8.4.0 and 8.4.2 self compiled with  elf compiled contrib
> directory,  tried Debians 8.4 backport package with the 8.4 contrib package
> and all do the same: Segfault and terminated by Signal 11 :-(

Try 8.4.3, which has some XML crash related fix:
  http://developer.postgresql.org/pgdocs/postgres/release-8-4-3.html

Regards,
--
dim

Re: Postgres 8.4 Segfault on xpath

From
Magnus Hagander
Date:
On Mon, Mar 15, 2010 at 11:47, Dimitri Fontaine <dfontaine@hi-media.com> wrote:
> Frank jansen <jansen@fumarium.de> writes:
>> I tried postgres 8.4.0 and 8.4.2 self compiled with  elf compiled contrib
>> directory,  tried Debians 8.4 backport package with the 8.4 contrib package
>> and all do the same: Segfault and terminated by Signal 11 :-(
>
> Try 8.4.3, which has some XML crash related fix:
>  http://developer.postgresql.org/pgdocs/postgres/release-8-4-3.html

Note that 8.4.3 hasn't actually been released yet though - that's the
developer version of the docs.

Expect it out before tomorrow, though ;-)


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Re: Postgres 8.4 Segfault on xpath

From
Frank jansen
Date:
Am 15.03.2010 12:56, schrieb Magnus Hagander:
> On Mon, Mar 15, 2010 at 11:47, Dimitri Fontaine<dfontaine@hi-media.com>  wrote:
>
>> Frank jansen<jansen@fumarium.de>  writes:
>>
>>> I tried postgres 8.4.0 and 8.4.2 self compiled with  elf compiled contrib
>>> directory,  tried Debians 8.4 backport package with the 8.4 contrib package
>>> and all do the same: Segfault and terminated by Signal 11 :-(
>>>
>> Try 8.4.3, which has some XML crash related fix:
>>   http://developer.postgresql.org/pgdocs/postgres/release-8-4-3.html
>>
> Note that 8.4.3 hasn't actually been released yet though - that's the
> developer version of the docs.
>
> Expect it out before tomorrow, though ;-)
>
>
>
Thanks for the tip with 8.4.3, its already available at the ftp mirrors :-)

Now with 8.4.3 the scripts work, but only until it has eaten up my
memory (4 gig).
The function above is executed for ~40000 items, with iteration steps of
300 items, every step memery consumption is increasing till the machine
hangs and process dies.
I am now looking into closing the database connection after every
iteration, hoping this helps.

I am bit concerned cause in postgres 8.3.1 it is/was working fine.

Kind regards,

Frank Jansen

Move to core xml from contrib/xml2

From
Frank jansen
Date:
Hi,

we have encountered huge memory problems (segfault on 8.4.2, out of
memory on 8.4.3) with our xml functions when moving from 8.3 to 8.4, as
mentioned here:
http://archives.postgresql.org/pgsql-general/2010-03/msg00563.php

We think about moving from contrib/xml2 to the core xml support.
But i have no clue how to change the database functions so they use the
core xml support. I have already uninstalled contrib/xml2, but now i
dont know further. I seem to cannot find any information how to use the
core xml support in the manuals or anywhere in the net.

Thanks in advice,

Frank Jansen



Re: Postgres 8.4 Segfault on xpath

From
Alvaro Herrera
Date:
Frank jansen wrote:

> Now with 8.4.3 the scripts work, but only until it has eaten up my
> memory (4 gig).
> The function above is executed for ~40000 items, with iteration
> steps of 300 items, every step memery consumption is increasing till
> the machine hangs and process dies.

Can you describe more fully what you're doing here? (hopefully with
schema details, sample data and queries)  Perhaps there's a memory leak
that needs to be plugged.

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

Re: Move to core xml from contrib/xml2

From
Bruce Momjian
Date:
Frank jansen wrote:
> Hi,
>
> we have encountered huge memory problems (segfault on 8.4.2, out of
> memory on 8.4.3) with our xml functions when moving from 8.3 to 8.4, as
> mentioned here:
> http://archives.postgresql.org/pgsql-general/2010-03/msg00563.php
>
> We think about moving from contrib/xml2 to the core xml support.
> But i have no clue how to change the database functions so they use the
> core xml support. I have already uninstalled contrib/xml2, but now i
> dont know further. I seem to cannot find any information how to use the
> core xml support in the manuals or anywhere in the net.

We have fixed the serious bugs in /contrib/xml2 with the minor releases
that came out today, 2010-03-15.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do

Re: Move to core xml from contrib/xml2

From
Frank jansen
Date:
Am 15.03.2010 22:10, schrieb Bruce Momjian:
> Frank jansen wrote:
>
>> Hi,
>>
>> we have encountered huge memory problems (segfault on 8.4.2, out of
>> memory on 8.4.3) with our xml functions when moving from 8.3 to 8.4, as
>> mentioned here:
>> http://archives.postgresql.org/pgsql-general/2010-03/msg00563.php
>>
>> We think about moving from contrib/xml2 to the core xml support.
>> But i have no clue how to change the database functions so they use the
>> core xml support. I have already uninstalled contrib/xml2, but now i
>> dont know further. I seem to cannot find any information how to use the
>> core xml support in the manuals or anywhere in the net.
>>
> We have fixed the serious bugs in /contrib/xml2 with the minor releases
> that came out today, 2010-03-15.
>
As already said: "out of memory on 8.4.3" (the script consumes up
machines memory till it dies)

My question was how we have to alter our database functions to use the
core xml support, i cannot find any documents about switch from
contrib/xml2 to core xml support? We use xpath_string, xpath and
xpath_nodeset and many more. This page:
http://wiki.postgresql.org/wiki/XML_Support doesnt say much, especially
regarding the move from contrib to core xml.

Kind regards,

Frank Jansen



Re: Move to core xml from contrib/xml2

From
Tom Lane
Date:
Frank jansen <jansen@fumarium.de> writes:
> Am 15.03.2010 22:10, schrieb Bruce Momjian:
>> We have fixed the serious bugs in /contrib/xml2 with the minor releases
>> that came out today, 2010-03-15.
>>
> As already said: "out of memory on 8.4.3" (the script consumes up
> machines memory till it dies)

You were already asked to provide a reproducer for that.  We can only
fix bugs we can test.

            regards, tom lane