BUG #4953: Crash with xml functions
The following bug has been logged online:
Bug reference: 4953
Logged by: Giorgio Valoti
Email address: giorgio_v@me.com
PostgreSQL version: 8.4.0
Operating system: Mac OS X 10.5.8
Description: Crash with xml functions
Details:
I get a crash when I invoke xml function like xml_is_well_formed.
It works with static xml but not if it’s dynamically generated.
It crashes even if I first create the xml dynamically and then invoke the
function with static text.
Here is the log:
LOG: server process (PID 84683) was terminated by signal 11: Segmentation
fault
LOG: terminating any other active server processes
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted; last known up at 2009-07-29 10:19:17
CEST
LOG: database system was not properly shut down; automatic recovery in
progress
LOG: record with zero length at 0/1F9EBF8
LOG: redo is not required
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
On Wednesday 29 July 2009 11:39:03 Giorgio Valoti wrote:
I get a crash when I invoke xml function like xml_is_well_formed.
It works with static xml but not if it’s dynamically generated.
It crashes even if I first create the xml dynamically and then invoke the
function with static text.
Please provide a reproducible test case.
Hi,
I’m forwarding this mail exchange with Peter Eisentraut to the bugs
list.
pgSQL version: 8.4
OS: Mac OS X 10.5.8
Let me know any needed additional detail or how I can help, thank you
in advance.
Da: Peter Eisentraut <peter_e@gmx.net>
Data: 29 luglio 2009 21:43:10 GMT+02:00
A: Giorgio Valoti <giorgio_v@me.com>
Oggetto: Re: [BUGS] BUG #4953: Crash with xml functionsPlease send it to the bugs list.
On Wednesday 29 July 2009 21:47:59 you wrote:
Il giorno 29/lug/09, alle ore 11:26, Peter Eisentraut ha scritto:
On Wednesday 29 July 2009 11:39:03 Giorgio Valoti wrote:
I get a crash when I invoke xml function like xml_is_well_formed.
It works with static xml but not if it’s dynamically generated.
It crashes even if I first create the xml dynamically and then
invoke the
function with static text.Please provide a reproducible test case.
select xml_is_well_formed(xmlelement(name root)::text);
mmh, this is too easy!
There must be something wrong with my setup. Any clues?
Grazie
--
Giorgio Valoti
Import Notes
Reference msg id not found: 200907292243.11148.peter_e@gmx.net | Resolved by subject fallback
Giorgio Valoti wrote:
Hi,
I’m forwarding this mail exchange with Peter Eisentraut to the bugs
list.
pgSQL version: 8.4
OS: Mac OS X 10.5.8
I can reproduce this, and the reason seems to be the same problem we
fixed in core XML and that Tom was saying a couple of days ago that was
present in contrib/xml2 as well:
#0 0x00007f1ac590f065 in *__GI_raise (sig=<value optimized out>)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007f1ac5912153 in *__GI_abort () at abort.c:88
#2 0x000000000078cbcf in ExceptionalCondition (
conditionName=0x920548 "!(((header->context) != ((void *)0) && (((((Node*)((header->context)))->type) == T_AllocSetContext))))",
errorType=0x920421 "BadArgument",
fileName=0x9203a0 "/pgsql/source/84_rel/src/backend/utils/mmgr/mcxt.c",
lineNumber=589) at /pgsql/source/84_rel/src/backend/utils/error/assert.c:57
#3 0x00000000007b2862 in pfree (pointer=0x120bfc0)
at /pgsql/source/84_rel/src/backend/utils/mmgr/mcxt.c:589
#4 0x00007f1ac345e186 in pgxml_pfree (ptr=0x120bfc0)
at /pgsql/source/84_rel/contrib/xml2/xpath.c:86
#5 0x00007f1ac66da12b in xmlCleanupCharEncodingHandlers__internal_alias ()
at encoding.c:1398
#6 0x00007f1ac66e3103 in xmlCleanupParser__internal_alias () at parser.c:13836
#7 0x00007f1ac345e5c5 in xml_is_well_formed (fcinfo=0x7fffcec1b0e0)
at /pgsql/source/84_rel/contrib/xml2/xpath.c:187
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.