Bug 25618 - Field Count Failing Intermittently
Field Count Failing Intermittently
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
7.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Crutcher Dunnavant
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-01 23:39 EST by Chris Cogdon
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-02-02 00:03:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Cogdon 2001-02-01 23:39:11 EST
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-01 23:52:24 EST
Tried the same code on a freebsb box, running perl 5.6.0, and it works fine.
Comment 2 Chris Cogdon 2001-02-02 00:03:24 EST
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 17:50:21 EST
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.

Note You need to log in before you can comment on or make changes to this bug.