Okay, so I have pruned my original script to a very simplistic one that is completely straightforward. It along with the input file example are below. It is just reading in data, splitting, and storing it into a hash. At some moment (around where there are 8 million records in the hash, i get a seg fault. I've reordered data and it produces different results. By this I mean it won't break on one specific line. It seems to have to do with volume. Also, if I reorder the key vectors of the hash, it will work. If I delete the last one, it will work. I am not at a point where I don't know where to turn. Any help would be GREATLY appreciated.
---- #!/usr/bin/perl -w -Iperl use strict; + + $| = 1; + + my $globalCounter = 0; my %mon_log; + + my $month = "03"; my $year = "2004"; + + + + open(REPORTFILE, "inputfile") or die "$0: Can't open data file : $! +\n"; # open file + + open(DEBUGFILE, "> debug") or die "$0: Can't open debug file : $!\n +"; # open file + + while(<REPORTFILE>){ + + my($fmt_proto, $fmt_dest_ip, $fmt_src_ip, $fmt_dest_port, $fmt_src +_port, $fmt_drp_packets, $fmt_country) = split(/\s+/); + + print DEBUGFILE "{$month.$year}{$fmt_proto}{$fmt_dest_ip}{$fmt_des +t_port}{$fmt_src_ip}{$fmt_src_port}\n"; + + if(!exists($mon_log{$month.$year}{$fmt_proto}{$fmt_dest_ip}{$fmt_d +est_port}{$fmt_src_ip}{$fmt_src_port})){ $globalCounter += 1; print DEBUGFILE $globalCounter,"\n"; } + + $mon_log{$month.$year}{$fmt_proto}{$fmt_dest_ip}{$fmt_dest_port}{$ +fmt_src_ip}{$fmt_src_port} += $fmt_drp_packets; } + + close(REPORTFILE); close(DEBUGFILE); exit(0); --- input file format: icmp 123.45.67.89 123.76.243.210 0 11 + 1 United States icmp 142.156.23.54 12.254.215.10 0 11 + 1 United States

In reply to puzzling seg fault by ttown1079

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.