Skip Menu |

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

Report information
The Basics
Id: 18881
Status: resolved
Priority: 0/
Queue: POE-Filter-XML

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

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



Subject: SEGFAULT on malformed xml
i wanted to test if my program could gracefully recover if i fed it bad xml. when i did, i got a segfault. but when i bypassed PFX to use XML::SAX::Expat::Incremental directly, the segfault disappeared. the input i used was the html from google's homepage, but i haven't been able to narrow down what specifically in it is triggering the segfault.
What version of X::S::E::I? If it is more recent than 0.02, then I haven't really tested it. I'll give it a whirl and see what's up. I am still trying to catch up on all of the rest of the bit rot. There is a 0.28 release, to fix a small bug dealing with to_str() and update from MakeMaker to Module::build, but it won't address this. Also, are you using PFX inside or outside of POE? Let me see your code, too. And a backtrace from gdb would also help too. Unfortunately, I can't really help out all that much without a simple test case without a lot of variables. On Sat Apr 22 17:10:50 2006, guest wrote: Show quoted text
> i wanted to test if my program could gracefully recover if i fed it bad > xml. when i did, i got a segfault. but when i bypassed PFX to use > XML::SAX::Expat::Incremental directly, the segfault disappeared. > > the input i used was the html from google's homepage, but i haven't been > able to narrow down what specifically in it is triggering the segfault.
On Sun Apr 30 08:11:01 2006, NPEREZ wrote: Show quoted text
> What version of X::S::E::I? If it is more recent than 0.02, then I > haven't really tested it.
0.4 Show quoted text
> There is a 0.28 release, to fix a small bug dealing with to_str() and > update from MakeMaker to Module::build, but it won't address this.
was wondering what this update did- you should have a Changes or ChangeLog file Show quoted text
> Also, are you using PFX inside or outside of POE? Let me see your > code, too.
the segfault occurred inside POE as well as outside, so i'm just including the simple outside test case, as well as the case where X:S:E:I is used directly without segfaulting. Show quoted text
> And a backtrace from gdb would also help too.
sorry, that's beyond my ability. Show quoted text
__________________________ use POE::Filter::XML; my $p = POE::Filter::XML->new(); local $/; my $xml = <>; my $out = eval { $p->get([$xml]) }; use Data::Dump; print Data::Dump::dump($out), "\n"; __END__ # doesn't segfault use XML::SAX::ParserFactory; local $XML::SAX::ParserPackage = "XML::SAX::Expat::Incremental (0.02)"; my $p = XML::SAX::ParserFactory->parser(); local $/; my $xml = <>; my $out = eval { $p->parse_string($xml) }; use Data::Dump; print Data::Dump::dump($out), "\n"; __END__
I just tested it on my machine. No problems here. I get some mismatched tags and generally a lot of warnings thrown, but no segfaults. Send me the exact input so I can test it (your google homepage may be different from mine). On Sun Apr 30 10:02:47 2006, guest wrote: Show quoted text
> On Sun Apr 30 08:11:01 2006, NPEREZ wrote: >
> > What version of X::S::E::I? If it is more recent than 0.02, then I > > haven't really tested it.
> > 0.4 >
> > There is a 0.28 release, to fix a small bug dealing with to_str() and > > update from MakeMaker to Module::build, but it won't address this.
> > was wondering what this update did- you should have a Changes or > ChangeLog file >
> > Also, are you using PFX inside or outside of POE? Let me see your > > code, too.
> > the segfault occurred inside POE as well as outside, so i'm just > including the simple outside test case, as well as the case where > X:S:E:I is used directly without segfaulting. >
> > And a backtrace from gdb would also help too.
> > sorry, that's beyond my ability. > > __________________________ > use POE::Filter::XML; > my $p = POE::Filter::XML->new(); > > local $/; my $xml = <>; > my $out = eval { $p->get([$xml]) }; > use Data::Dump; > print Data::Dump::dump($out), "\n"; > > __END__ > > # doesn't segfault > > use XML::SAX::ParserFactory; > local $XML::SAX::ParserPackage = "XML::SAX::Expat::Incremental (0.02)"; > my $p = XML::SAX::ParserFactory->parser(); > > local $/; my $xml = <>; > my $out = eval { $p->parse_string($xml) }; > use Data::Dump; > print Data::Dump::dump($out), "\n"; > > __END__
I am gonna call this cooked since I could never seem to get the segfault to happen over here. Let me know if you are still having problems and maybe we can work on it again.