Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 8288
Status: resolved
Worked: 20 min
Priority: 0/
Queue: XML-LibXML

Owner: Nobody in particular
Requestors: egor [...]

Bug Information
Severity: Critical
Broken in: 1.58_1
Fixed in: (no value)

Subject: XML::LibXML segfaults on undef of a XML::LibXML::Element
XML::LibXML 1.58, 1.58_1, and CVS version tested. libxml2 2.6.8 and 2.6.15 tested. Linux, glibc 2.3, gcc 3.3. Bug is repeatable approximately in 70% of runs. Please unpack bugz.tar.gz, cd bugz and run: perl -Ilib -It t/Way.t it should segfault in one of the two places in the code. First place where segfault occurs is very highlighted in the code of t/Way.t, look for "WHAT". Second place is at the very end. It all happens at the moment the XML::LibXML::Element is undefined, i.e. it cannot clean memory. Way does a hard job :) or generating a complex tree from a string and hash snippets. See the code in lib/DataSpirit/ at the lines 133 and 151. There are two ways to import XML string into an XML tree, I have tried the both ways. None works stable, it segfaults. The testcase is repeatable and if it will not fail at first, it will fail at second run for sure. Tested on different versions and computers. I can answer all your questions and provide you with a shell if needed. Please help, we're stuck with it.
Download bugz.tar.gz
application/gzip 21.3k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 518b
I'm postponing this bug until you provide a reasonably concise, comprehensible test case. Your lib and test file are too large and I don't have time to debug it all. I can reproduce the crash, I see it happens during deallocation, but it would take me hours to understand what's going on in your code, where do you keep references to $xml and what makes the bindings to deallocate it twice. Also, you seem to be using a lot of elements without ever creating a document, which is a really rare usage of the API.
Download (untitled) / with headers
text/plain 111b
Since the current SVN version does not reproduce the segfault, I'm closing this ticket as 'resolved'. -- Petr

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to