Skip Menu |

This queue is for tickets about the XML-SAX-Expat-Incremental CPAN distribution.

Report information
The Basics
Id: 23838
Status: resolved
Priority: 0/
Queue: XML-SAX-Expat-Incremental

People
Owner: Nobody in particular
Requestors: nperez [...] cpan.org
Cc:
AdminCc:

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



Subject: Leaks like a mofo
It leaks memory. You have circular references. Attached is a test case that shows the leak and the output of stderr and stdout redirected into a file. One of the circular references is your fault, the other is your ascendant class (XML::SAX::Expat). To get an OO like functionality implemented, the author stored a reference of $self into $expat->{__XSE} (instead of passing along a weaken reference into the user data portion to be used in callbacks like he is supposed to do). I am going to submit a bug report with him. If you want your code functional until he can do a new release, you need to weaken two references: $p->{_expat_nb_obj}; and $p->{_xml_parser_obj}->{__XSE}; As it stands, I can't do a release of POE::Component::Jabber because of the leaking issue (POE::Filter::XML is instantiated upon reconnect which in turn instantiates a new parser, which means every reconnect means POE::Component::Jabber leaks memory). Thanks
Subject: test_leak_filter.pl
use warnings; use strict; use POE::Filter::XML::Handler; use XML::SAX::Expat::Incremental; use Devel::Leak; use Devel::Cycle; my $handler = POE::Filter::XML::Handler->new(); for(0..100) { my $parser = XML::SAX::Expat::Incremental->new('Handler' => $handler); $parser->parse_string(''); eval { $parser->parse_done(); }; warn Devel::Leak::NoteSV(my $foo); find_cycle($parser); }
Subject: stderr.log
Download stderr.log
application/octet-stream 38.2k

Message body not shown because it is not plain text.

blah, i didn't see this ticket... Really sorry about that =( Anyway, 0.05 coming up with your fix. The __XSE thing hasn't been resolved yet so I'm weakening that too.