Subject: | Crash on using replaceChild when xml:id is involved |
The attached script causes Perl to crash with a Bus Error (on OSX). GDB
gives me:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
_domReconcileNsAttr (attr=0x13627c0, unused=0xbffff66c) at dom.c:40
40 dom.c: No such file or directory.
in dom.c
The problem happens just the same if there's importNode. It doesn't
happen if the xml:id are removed. I don't know if this is a bug in
libxml or XML::LibXML, and I don't really have the skills to find out.
Any fix would be greatly appreciated, this is crashing one of my
projects.
Thanks!
--
--darobin
Subject: | test-case.pl |
use strict;
use warnings;
use XML::LibXML qw();
my $docOne = XML::LibXML->new->parse_string('<foo><inc xml:id="test"/></foo>');
my $docTwo = XML::LibXML->new->parse_string('<bar><urgh xml:id="foo"/></bar>');
my $inc = $docOne->getElementById('test');
warn $inc->toString . "\n";
my $rep = $docTwo->getElementById('foo');
warn $rep->toString . "\n";
$inc->parentNode->replaceChild($rep, $inc);
warn $docOne->toString . "\n";