perl-5.8.0-90.4 The following test program returns the wrong value with RHEL3's Perl: ---8<--- #!/usr/bin/perl open(F, ">>somefile"); $a=tell(F); print "$a\n"; print F "end"; $a=tell(F); print "$a\n"; close(F); ---8<--- On RHEL3: # rm -f somefile # perl foo.pl 0 3 # perl foo.pl 0 3 # perl foo.pl 0 3 On RHEL4: # perl foo.pl 0 3 # perl foo.pl 3 6 Upstream bug seemed to be: http://guest:guest@rt.perl.org/rt2//Ticket/Display.html?id=18711 With the patch at: http://public.activestate.com/cgi-bin/perlbrowse?patch=18471
Created attachment 126221 [details] perl-5.8.0-perlio-tell-bug-fix.patch Rediff'ed patch from the upstream fix. It isn't enough to fix the bug though, as the first tell after an open() is still broken: # perl foo.pl 0 3 # perl foo.pl 0 6
I compared the code for flush, open and tell in the the current HEAD: http://public.activestate.com/cgi-bin/perlbrowse?file=perlio.c&rev= and with the patched version and couldn't find any significant differences to explain why it didn't fix it.
Created attachment 126240 [details] Patch which fixes issue in perl-5.8.0-90.9 Here's a patch which fixes the issue, which I'm applying in perl-5.8.0-90.9 . The PerlIOUnix_open function also needed to lseek(fd,0,SEEK_END) if the file was opened in append mode - this was fixed with a previous upstream patch.
Now fixed with perl-5.8.0-90.9, available from: http://people.redhat.com/~jvdias/perl/RHEL-3
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0294.html