Subject: | segfault with xml::lang/cloneNode |
--code--
#!/usr/bin/perl -w
use strict;
use XML::LibXML;
my $xml_coredump = '<Foo xml:lang="en-GB"/>';
my $doc = XML::LibXML->new()->$parser->
parse_string($xml_coredump)->getDocumentElement;
my $foo = $doc->cloneNode(1);
print "cloned OK!\n"; # segfaults before this
--code--
segfaults. Making the XML more valid (with doctype etc) makes no
difference, and someone *did* ask for short code :-)
gdb output:
--Starting program: /usr/bin/perl ./libxml_coredump.pl
--Program received signal SIGSEGV, Segmentation fault.
--xmlSearchNs (doc=0x0, node=0x819e470, nameSpace=0x819e5b8 "xml") at
tree.c:4023
--4023 tree.c: No such file or directory.
(passing a null doc?)
Works fine if I cloneNode(0), or leave out the xml:lang attribute.
Thanks,
--
Adam