Subject: | segfault when cloning after parse() |
Perl segfaults when cloning a Text::CSV_XS object after running parse(). Code to reproduce on my system is below.
System:
Strawberry Perl x64 5.16.3 and x32 5.16.1
Text::CSV_XS versions 0.98, 0.99, 1.01 (did not test with 1.00)
Clone version 0.34
It also occurs with YAML::Syck::Dump, but I have not included that in the code below.
It does not occur with Text::CSV_XS 0.91 if I remember correctly.
Regards,
Shawn.
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use Text::CSV_XS;
use Clone;
$| = 1;
say 'Using Text::CSV_XS version ' . Text::CSV_XS->version;
say 'Using Clone version ' . $Clone::VERSION;
my $csv = Text::CSV_XS->new ({sep_char => ','});
say 'Cloning...';
my $clone1 = eval { Clone::clone $csv };
say 'Cloned before parsing';
$csv->parse ('a,b');
say 'Ran $csv->parse.';
say 'Cloning...';
my $clone2 = eval { Clone::clone $csv };
say 'Cloned after parsing';