Bug 25618

Summary: Field Count Failing Intermittently
Product: [Retired] Red Hat Linux Reporter: Chris Cogdon <chris>
Component: perlAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-02 05:03:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Cogdon 2001-02-02 04:39:11 UTC
I am receiving some very weird errors from the Perl-based UBB code that 
was recently moved to a machine running redhat-7.0 and perl 5.6.0, from 
redhat-6.2 with perl 5.00503. I've narrowed the problem down to the 
following small snippet of code:

#! /usr/bin/perl

$maxfields = 14;


sub OpenFile {
my $FilePath = shift;

my @thisarray = [];
if (-e "$FilePath") {
open (THISONE, "$FilePath") or die( &StandardHTML("OpenFile $FilePath 
failed: $!<p>Check Paths & Permissions") );
@thisarray = <THISONE>;
close (THISONE);
}  else {
@thisarray = "";
}
return(@thisarray);
}

@f = OpenFile ( "test" );
print "count=$#f\n";
print "@f";

while(1) {

        @fields = OpenFile ( "test" );
        $count = $#fields;
        if ( $count > $maxfields ) {
                print "Fields exceeded $count>$maxfields\n";
        }

}


Where the file "test" contains:
1
2
3
4
5
6
7
8
9
10
11
12
13
14


The code will occasionally print out 'Fields exceeded 13>14', which is 
simply ludicrous :)

Comment 1 Chris Cogdon 2001-02-02 04:52:24 UTC
Tried the same code on a freebsb box, running perl 5.6.0, and it works fine.

Comment 2 Chris Cogdon 2001-02-02 05:03:24 UTC
Dropped perl-5.6.0-11.i386.rpm onto the system (from fisher), and the problem 
goes away.

Comment 3 David Lawrence 2001-02-13 22:50:21 UTC
Could not recreate the problem using the sample code with perl-5.6.0-11. User
has stated this version also fixes the problem for him. Closing the report.