Bug#780369: libxml-libxml-perl: Segmentation fault (and others) when using replaceNode()

Manfred Stock manfred.stock+debian at gmail.com
Fri Mar 13 12:54:14 UTC 2015


Hi,

On Thu, Mar 12, 2015 at 09:37:54PM +0100, Manfred Stock wrote:
> When I remove the comment sign from '$doc2->adoptNode($node);', I'm not able to
> reproduce the issue anymore. Doing an importNode() instead does not solve the
> issue (which would also be kind-of surprising, as this most likely already gets
> done according to the XML::LibXML::Node documentation). So using adoptNode()
> might be a workaround (maybe actually the proper way to do this, but as far as
> I read and understood the documentation, it should not be necessary - and, in
> my opinion, certainly should not result in a segfault when running a Perl
> script when it is not done...).

please ignore the part about this being a workaround ;). While trying
this in the
actual code base, I noticed that it does not really help. Then I
realized that I was
doing the adoptNode() the wrong way around in the example, which certainly did
not have the intended effect as it resulted in a different output
document. The call
should actually read
    $doc->adoptNode($new_node);
instead of
    $doc2->adoptNode($node);

In the meantime, I quickly tried the test script on FreeBSD 9.3, with
Perl 5.18.4,
libxml2 2.9.2_2, p5-XML-LibXML 2.0118,1, but so far have not noticed
any crashes.

Best regards
Manfred



More information about the pkg-perl-maintainers mailing list