Re: BUG #5348: Postgres crashes with index on xpath_string

Lists: pgsql-bugs
From: "Thomas Kellerer" <thomas(at)kellerer(dot)name>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5348: Postgres crashes with index on xpath_string
Date: 2010-02-27 16:28:21
Message-ID: 201002271628.o1RGSLSj096528@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5348
Logged by: Thomas Kellerer
Email address: thomas(at)kellerer(dot)name
PostgreSQL version: 8.4.2
Operating system: Windows XP
Description: Postgres crashes with index on xpath_string
Details:

With the contrib module xml2 (pgxml.sql) installed, run the following
script:

create table t1 (id integer, xml_data xml);
insert into t1 (id, xml_data)
values
(1, '<attributes><attribute name="attr_1">Some
Value</attribute></attributes>');

create index idx_xpath on t1 ( xpath_string
('/attributes/attribute[(at)name="attr_1"]/text()', xml_data::text));

This will crash the backend.

The entry in the logfile is:

2010-02-27 17:21:28 CET STATEMENT: create index idx_xpath on t1 (
xpath_value ('/attributes/attribute[(at)name="attr_1"]/text()',
xml_data::text))
2010-02-27 17:21:55 CET LOG: server process (PID 2544) was terminated by
exception 0xC0000005
2010-02-27 17:21:55 CET HINT: See C include file "ntstatus.h" for a
description of the hexadecimal value.
2010-02-27 17:21:55 CET LOG: terminating any other active server processes
2010-02-27 17:21:55 CET LOG: all server processes terminated;
reinitializing

When restarting the server, the following messages are written to the
logfile:

2010-02-27 17:22:05 CET FATAL: pre-existing shared memory block is still in
use
2010-02-27 17:22:05 CET HINT: Check if there are any old server processes
still running, and terminate them.
2010-02-27 17:22:22 CET LOG: database system was interrupted; last known up
at 2010-02-27 16:22:32 CET
2010-02-27 17:22:22 CET LOG: database system was not properly shut down;
automatic recovery in progress
2010-02-27 17:22:22 CET LOG: redo starts at 3/B77FAB28
2010-02-27 17:22:22 CET LOG: unexpected pageaddr 3/95850000 in log file 3,
segment 183, offset 8716288
2010-02-27 17:22:22 CET LOG: redo done at 3/B784F758
2010-02-27 17:22:22 CET LOG: last completed transaction was at log time
2010-02-27 17:21:20.382+01
2010-02-27 17:22:23 CET FATAL: the database system is starting up
2010-02-27 17:22:23 CET LOG: database system is ready to accept
connections
2010-02-27 17:22:24 CET LOG: autovacuum launcher started

When the following index is created, things seem to work (at least the
backend is not crashing)

create index idx_xpath on t1 ( xpath_string
('/attributes/attribute[(at)name="attr_1"]', xml_data::text))

(note the missing text() in the xpath)


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thomas Kellerer <thomas(at)kellerer(dot)name>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5348: Postgres crashes with index on xpath_string
Date: 2010-02-27 17:42:59
Message-ID: 201002271742.o1RHgx412583@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Yes, we have received a few reports about this and are working on a fix.

---------------------------------------------------------------------------

Thomas Kellerer wrote:
>
> The following bug has been logged online:
>
> Bug reference: 5348
> Logged by: Thomas Kellerer
> Email address: thomas(at)kellerer(dot)name
> PostgreSQL version: 8.4.2
> Operating system: Windows XP
> Description: Postgres crashes with index on xpath_string
> Details:
>
> With the contrib module xml2 (pgxml.sql) installed, run the following
> script:
>
> create table t1 (id integer, xml_data xml);
> insert into t1 (id, xml_data)
> values
> (1, '<attributes><attribute name="attr_1">Some
> Value</attribute></attributes>');
>
> create index idx_xpath on t1 ( xpath_string
> ('/attributes/attribute[(at)name="attr_1"]/text()', xml_data::text));
>
> This will crash the backend.
>
> The entry in the logfile is:
>
> 2010-02-27 17:21:28 CET STATEMENT: create index idx_xpath on t1 (
> xpath_value ('/attributes/attribute[(at)name="attr_1"]/text()',
> xml_data::text))
> 2010-02-27 17:21:55 CET LOG: server process (PID 2544) was terminated by
> exception 0xC0000005
> 2010-02-27 17:21:55 CET HINT: See C include file "ntstatus.h" for a
> description of the hexadecimal value.
> 2010-02-27 17:21:55 CET LOG: terminating any other active server processes
> 2010-02-27 17:21:55 CET LOG: all server processes terminated;
> reinitializing
>
>
> When restarting the server, the following messages are written to the
> logfile:
>
>
> 2010-02-27 17:22:05 CET FATAL: pre-existing shared memory block is still in
> use
> 2010-02-27 17:22:05 CET HINT: Check if there are any old server processes
> still running, and terminate them.
> 2010-02-27 17:22:22 CET LOG: database system was interrupted; last known up
> at 2010-02-27 16:22:32 CET
> 2010-02-27 17:22:22 CET LOG: database system was not properly shut down;
> automatic recovery in progress
> 2010-02-27 17:22:22 CET LOG: redo starts at 3/B77FAB28
> 2010-02-27 17:22:22 CET LOG: unexpected pageaddr 3/95850000 in log file 3,
> segment 183, offset 8716288
> 2010-02-27 17:22:22 CET LOG: redo done at 3/B784F758
> 2010-02-27 17:22:22 CET LOG: last completed transaction was at log time
> 2010-02-27 17:21:20.382+01
> 2010-02-27 17:22:23 CET FATAL: the database system is starting up
> 2010-02-27 17:22:23 CET LOG: database system is ready to accept
> connections
> 2010-02-27 17:22:24 CET LOG: autovacuum launcher started
>
>
> When the following index is created, things seem to work (at least the
> backend is not crashing)
>
> create index idx_xpath on t1 ( xpath_string
> ('/attributes/attribute[(at)name="attr_1"]', xml_data::text))
>
> (note the missing text() in the xpath)
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +


From: Thomas Kellerer <bestellung(at)kellerer(dot)name>
To:
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5348: Postgres crashes with index on xpath_string
Date: 2010-03-05 08:52:37
Message-ID: 4B90C655.2030005@kellerer.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Thanks for the feedback.

Is the problem specific to 8.4.2 or to the Windows platform (or both)?

Regards
Thomas

Bruce Momjian, 27.02.2010 18:42:
>
> Yes, we have received a few reports about this and are working on a fix.
>
> ---------------------------------------------------------------------------
>
> Thomas Kellerer wrote:
>>
>> The following bug has been logged online:
>>
>> Bug reference: 5348
>> Logged by: Thomas Kellerer
>> Email address: thomas(at)kellerer(dot)name
>> PostgreSQL version: 8.4.2
>> Operating system: Windows XP
>> Description: Postgres crashes with index on xpath_string
>> Details:
>>
>> With the contrib module xml2 (pgxml.sql) installed, run the following
>> script:
>>
>> create table t1 (id integer, xml_data xml);
>> insert into t1 (id, xml_data)
>> values
>> (1, '<attributes><attribute name="attr_1">Some
>> Value</attribute></attributes>');
>>
>> create index idx_xpath on t1 ( xpath_string
>> ('/attributes/attribute[(at)name="attr_1"]/text()', xml_data::text));
>>
>> This will crash the backend.
>>
>> The entry in the logfile is:
>>
>> 2010-02-27 17:21:28 CET STATEMENT: create index idx_xpath on t1 (
>> xpath_value ('/attributes/attribute[(at)name="attr_1"]/text()',
>> xml_data::text))
>> 2010-02-27 17:21:55 CET LOG: server process (PID 2544) was terminated by
>> exception 0xC0000005
>> 2010-02-27 17:21:55 CET HINT: See C include file "ntstatus.h" for a
>> description of the hexadecimal value.
>> 2010-02-27 17:21:55 CET LOG: terminating any other active server processes
>> 2010-02-27 17:21:55 CET LOG: all server processes terminated;
>> reinitializing
>>
>>
>> When restarting the server, the following messages are written to the
>> logfile:
>>
>>
>> 2010-02-27 17:22:05 CET FATAL: pre-existing shared memory block is still in
>> use
>> 2010-02-27 17:22:05 CET HINT: Check if there are any old server processes
>> still running, and terminate them.
>> 2010-02-27 17:22:22 CET LOG: database system was interrupted; last known up
>> at 2010-02-27 16:22:32 CET
>> 2010-02-27 17:22:22 CET LOG: database system was not properly shut down;
>> automatic recovery in progress
>> 2010-02-27 17:22:22 CET LOG: redo starts at 3/B77FAB28
>> 2010-02-27 17:22:22 CET LOG: unexpected pageaddr 3/95850000 in log file 3,
>> segment 183, offset 8716288
>> 2010-02-27 17:22:22 CET LOG: redo done at 3/B784F758
>> 2010-02-27 17:22:22 CET LOG: last completed transaction was at log time
>> 2010-02-27 17:21:20.382+01
>> 2010-02-27 17:22:23 CET FATAL: the database system is starting up
>> 2010-02-27 17:22:23 CET LOG: database system is ready to accept
>> connections
>> 2010-02-27 17:22:24 CET LOG: autovacuum launcher started
>>
>>
>> When the following index is created, things seem to work (at least the
>> backend is not crashing)
>>
>> create index idx_xpath on t1 ( xpath_string
>> ('/attributes/attribute[(at)name="attr_1"]', xml_data::text))
>>
>> (note the missing text() in the xpath)
>>
>> --
>> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-bugs
>


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Kellerer <bestellung(at)kellerer(dot)name>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5348: Postgres crashes with index on xpath_string
Date: 2010-03-05 20:57:53
Message-ID: 603c8f071003051257s142178a6jdb66ccfe8e2e43b7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On Fri, Mar 5, 2010 at 3:52 AM, Thomas Kellerer
<bestellung(at)kellerer(dot)name> wrote:
> Thanks for the feedback.
>
> Is the problem specific to 8.4.2 or to the Windows platform (or both)?

Neither, actually.

...Robert


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Thomas Kellerer <bestellung(at)kellerer(dot)name>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5348: Postgres crashes with index on xpath_string
Date: 2010-03-07 02:17:18
Message-ID: 201003070217.o272HIh14640@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Robert Haas wrote:
> On Fri, Mar 5, 2010 at 3:52 AM, Thomas Kellerer
> <bestellung(at)kellerer(dot)name> wrote:
> > Thanks for the feedback.
> >
> > Is the problem specific to 8.4.2 or to the Windows platform (or both)?
>
> Neither, actually.

The fix will be in the next minor Postgres release. Keep an eye out for
it when it is announced.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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