[Koha-bugs] [Bug 10400] New: Text::CSV_XS error-checking should be standardized

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jun 4 16:36:09 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10400

            Bug ID: 10400
           Summary: Text::CSV_XS error-checking should be standardized
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Label printing
          Assignee: cnighswonger at foundations.edu
          Reporter: gmcharlt at gmail.com

As reported by Doug Kingston on koha-devel on 2013-06-02, if version 0.97 of
Text::CSV_XS is installed, it can segfault.  From Doug's email:

"The error from t/Labels.t is a segmentation fault when calling
$csv->error_input() in Labels/Label.pm.

sub _get_text_fields {
    my $format_string = shift;
    my $csv = Text::CSV_XS->new({allow_whitespace => 1});
    my $status = $csv->parse($format_string);
    my @sorted_fields = map {{ 'code' => $_, desc => $_ }}
                        map { $_ eq 'callnumber' ? 'itemcallnumber' : $_ }
# see bug 5653
                        $csv->fields();
    my $error = $csv->error_input();
    warn sprintf('Text field sort failed with this error: %s', $error) if
$error;
    return \@sorted_fields;
}"

A ticket was opened with the maintainer of Text::CSV_XS
(https://rt.cpan.org/Ticket/Display.html?id=85810), and he fixed the segfault
bug in version 0.98 of the module.

Nonetheless, Koha code that uses Text::CSV_XS should follow the module's
documentation more closely; in particular, it looks like the correct thing to
do is the check the value of the $status returned by $csv->parse() before
deciding whether to invoke error_input().

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list