Subject: | Segmentation fault while parsing |
Running on a Mac OS X with perl v5.12 (I believe it also crashes with perl v5.16), when I parse a
list of XML::Twig files one after another, XML::Twig eventually segfaults.
I've attached some sample code with sample inputs.
To reproduce the crash, run "./parse.pl <input dir>" where <input dir> is the directory
containing the contents of xmls.zip
I've also tried the sample code with XML::Parser, and that worked fine and without segfaulting.
Subject: | xmls.zip |
Message body not shown because it is not plain text.
Subject: | parse.pl |
#! /usr/bin/perl
use warnings;
use strict;
use XML::Twig;
my $xmlsdir = $ARGV[0];
print "Reading dir $xmlsdir\n";
opendir (my $dir, $xmlsdir);
while (my $file = readdir($dir)) {
print "$file\n";
next unless $file =~ /\.xml$/;
my $t = XML::Twig->new();
$t->parsefile("$xmlsdir/$file");
}