http://qs321.pair.com?node_id=1121728

mark4 has asked for the wisdom of the Perl Monks concerning the following question:

I have a program that has been crashing perl (5.8.8) for about 3 years now. I FINALLY got around to debugging it. I looked and looked and I can't see anything wrong with my code. Orininally I thought this was promlem with running out of memory Because it will only crash if the data base it is working with is large. The system I am running this on is a Windows server 2008 Enterprise with 48BG installed. See the line(s) below with "# IT CRASHES SOMEWHERE IN HERE....." I also show a small output from the run.

if ($sort_dirs) { my @tmp_1; my @tmp_2; my @tmp_3; my @tmp_4; my @tmp_5; my @tmp_6; my $void; print "Sorting directories...\n"; for ($i = 0; $i <= $last_dir; $i++) { #printf ("sort_dirs_debug1: %5d fp: %5d, lp: %5d %s\n", $i +, $first_pointer[$i], $last_pointer[$i], $the_dir[$i]); #define sort order #printf ("%s\n", $the_dir[$i]); #printf ("%s\n", uenc_path_file($the_dir[$i])); $tmp_1[$i] = join ('"|' , $deleted_file[$i] , uenc_path_file($the_dir[$i]) , $the_dir[$i] , $first_pointer[$i] , $last_pointer[$i] , $has_subdir[$i] , $has_iden[$i] ); } @tmp_2 = sort { lc($a) cmp lc($b) } @tmp_1; print "Putting sorted list back...\n"; for($i = 0; $i <= $last_dir; $i++) { ( $deleted_file[$i] , $void , $the_dir[$i] , $first_pointer[$i] , $last_pointer[$i] , $has_subdir[$i] , $has_iden[$i] ) = split (/\"\|/, $tmp_2[$i], 7); #printf ("sort_dirs_debug2: %5d fp: %5d, lp: %5d %s\n", $i +, $first_pointer[$i], $last_pointer[$i], $the_dir[$i]); } # This just makes the file list sequential with the sorted dir +ectories. print "Starting full file sort...\n"; $i = 0; for ($dir_pointer = 0; $dir_pointer <= $last_dir; $dir_pointer +++) { print "i:$i, dir:$dir_pointer $first_pointer[$dir_pointer] + $last_pointer[$dir_pointer]\n"; $start = $first_pointer[$dir_pointer]; $first_pointer[$dir_pointer] = $i; for($file_pointer = $start; $file_pointer <= $last_pointer +[$dir_pointer]; $file_pointer++) { $tmp_1[$i] = $uenc_file_name[$file_pointer]; # IT CRAS +HES SOMEWHERE IN HERE..... $tmp_2[$i] = $dir_and_file_name[$file_pointer]; $tmp_3[$i] = $date_time_mod[$file_pointer]; $tmp_4[$i] = $file_size[$file_pointer]; $tmp_5[$i] = $encpd[$file_pointer]; $tmp_6[$i] = $deleted_file[$file_pointer]; $tmp_7[$i] = $has_iden[$file_pointer]; $i++; } $last_pointer[$dir_pointer] = $i - 1; } print "Putting full file sort back...\n"; for($i = 0; $i <= $last_file; $i++) { $uenc_file_name[$i] = $tmp_1[$i]; $dir_and_file_name[$i] = $tmp_2[$i]; $date_time_mod[$i] = $tmp_3[$i]; $file_size[$i] = $tmp_4[$i]; $encpd[$i] = $tmp_5[$i]; $deleted_file[$i] = $tmp_6[$i]; $has_iden[$i] = $tmp_7[$i]; $finf_valid[$i] = 0; } } # for($i = 0; $i <= $last_dir; $i++) { # printf ("debug4: %5d fp: %5d, lp: %5d %s\n", $i, $first_pointe +r[$i], $last_pointer[$i], $the_dir[$i]); # } print "Exiting get files...\n"; }

program output:

...... i:1539990, dir:1111 1768215 1768216 i:1539992, dir:1112 1422703 1422702 i:1539992, dir:1113 1768217 1768217 i:1539993, dir:1114 1768218 1768218 i:1539994, dir:1115 1768219 1768219 i:1539995, dir:1116 1768220 1768220 i:1539996, dir:1117 1142520 1142535 i:1540012, dir:1118 1140894 1140925 i:1540044, dir:1119 1140926 1140940 i:1540059, dir:1120 1142370 1142399 i:1540089, dir:1121 1142400 1142519 i:1540209, dir:1122 1358128 1358218 i:1540300, dir:1123 1358064 1358127 i:1540364, dir:1124 1347195 1358063 <then crash>

Problem signature:

Problem signature: Problem Event Name: APPCRASH Application Name: perl.exe Application Version: 5.8.8.820 Application Timestamp: 45b6a114 Fault Module Name: perl58.dll Fault Module Version: 5.8.8.820 Fault Module Timestamp: 45b6a113 Exception Code: c0000005 Exception Offset: 00085bc1 OS Version: 6.1.7600.2.0.0.274.10 Locale ID: 1033 Additional Information 1: f538 Additional Information 2: f538d60ae007f756c6454955fe93e7d0 Additional Information 3: 24d2 Additional Information 4: 24d2d8331230585cafa9b0f2f2190f63 Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 If the online privacy statement is not available, please read our priv +acy statement offline: C:\windows\system32\en-US\erofflps.txt