Hi Monks,

First let me start by saying the file I have does apear to be damaged.

Background:

I have a log file parser that uses IO::Uncompress:Bunzip2 so I can open compressed files without needing to uncompress the entire contents. This works out to be much faster as sometimes I only need a few lines from the files. Problem is I have a ascii text file that has a corrupted line, not sure on the contents, it's very large and VIM stalls and truncates at that line. If I use Bunzip2 module to read the file it stalls there and causes a segmentation fault (see the trace below). If I unzip the file so now its just a regular ascii file and use perl's built in open and step through using while($line = <$file>) everything is fine (perl still seems to "pause" at the broken line but eventually moves past it and parses the rest of the file. I'd love to get that reaction from Bunzip2 but I just keep getting the Segmentation faults.

Any help would be appreciated.

>> /home/utils/perl-5.14/5.14.1-threads-64/lib/5.14.1/IO/Uncompress/Ba +se.pm:884: if (*$self->{Encoding}) { >> /home/utils/perl-5.14/5.14.1-threads-64/lib/5.14.1/IO/Uncompress/Ba +se.pm:889: if ($status == STATUS_ENDSTREAM) { >> /home/utils/perl-5.14/5.14.1-threads-64/lib/5.14.1/IO/Uncompress/Ba +se.pm:929: return $buf_len ; >> /home/utils/perl-5.14/5.14.1-threads-64/lib/5.14.1/IO/Uncompress/Ba +se.pm:1092: return $len ; >> /home/utils/perl-5.14/5.14.1-threads-64/lib/5.14.1/IO/Uncompress/Ba +se.pm:1178: my $offset = index($line, $/); Segmentation fault

In reply to Segmenation Fault in IO::Uncompress:Bunzip2 by megaframe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.