Skip Menu | You are currently an anonymous guest. | Login | Return to Main | Preferences
Id: 23645
Status: resolved
Left: 0 min
Priority: 0/0
Queue: perl5

Owner: Nobody
Requestors: martyn [at] inpharmatica.co.uk
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.8.0
Fixed In: (no value)



X History Display mode: Brief headersFull headers
#   Fri Aug 29 06:24:51 2003 martyn@inpharmatica.co.uk - Ticket created  
From: martyn@inpharmatica.co.uk
Date: Fri, 29 Aug 2003 13:24:00 +0000
To: perlbug@perl.org
Subject: tell with perlio on appended files
Download (untitled) [text/plain 4k]

This is a bug report for perl from martyn@monument.inpharmatica.co.uk,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

'tell', operating on a file opened with '>>', returns 0 (after opening), and
continues to think in terms of offsets from the original start of the file.

This is is in contrast to say, 5.6.1, which thinks in terms of the "real" file
position. Witness:

[martyn:0]$ ls -l /tmp/mime-magic
-rw-r--r-- 1 martyn martyn 145088 Aug 29 11:30 /tmp/mime-magic

[martyn:0]$ /export/home/martyn/opt/perl-5.6.1/bin/perl -le 'open $fh, ">>", $ARGV[0]; print tell $fh' /tmp/mime-magic
145088

[martyn:0]$ perl -le 'open $fh, ">>", $ARGV[0]; print tell $fh' /tmp/mime-magic 0

This is with 5.8.0, and remains true with 5.8.1-RC4 .

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
Site configuration information for perl v5.8.0:

Configured by martyn at Fri Aug 1 10:31:01 GMT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.20-gentoo-r5, archname=i686-linux
uname='linux monument 2.4.20-gentoo-r5 #2 tue jul 1 08:02:25 gmt 2003 i686 amd athlon(tm) processor authenticamd gnulinux '
config_args='-des -Darchname=i686-linux -Dcc=gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-mcpu=athlon -O3 -pipe -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman3ext=3pm -Dcf_by=Gentoo -Ud_csh -Di_gdbm -Di_db -Di_ndbm'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DPERL5 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-mcpu=athlon -O3 -pipe',
cppflags='-DPERL5 -DPERL5 -fno-strict-aliasing'
ccversion='', gccversion='3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lpthread -lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
perllibs=-lpthread -lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:


---
@INC for perl v5.8.0:
/etc/perl
/usr/lib/perl5/site_perl/5.8.0/i686-linux
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i686-linux
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i686-linux
/usr/lib/perl5/5.8.0
/usr/local/lib/site_perl
.

---
Environment for perl v5.8.0:
HOME=/home/martyn
LANG=en_GB
LANGUAGE (unset)
LD_LIBRARY_PATH=/opt/blackdown-jdk-1.4.1/lib:/home/martyn/lib:/export/home/martyn/exec/lib:/usr/local/lib:/opt/blackdown-jdk-1.4.1/lib:/home/martyn/lib:/export/home/martyn/exec/lib:/usr/local/lib:/opt/blackdown-jdk-1.4.1/lib:/home/martyn/lib:/export/home/martyn/exec/lib:/usr/local/lib
LOGDIR (unset)
PATH=/opt/blackdown-jdk-1.4.1/bin:/home/martyn/bin:/export/home/martyn/exec/bin:/usr/local/bin:/bin:/usr/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/opt/Acrobat5:/usr/X11R6/bin:/opt/blackdown-jre-1.4.1/bin:/usr/qt/3/bin:/usr/kde/3.1/bin
PERL_BADLANG (unset)
SHELL=/bin/bash
#   Fri Aug 29 06:24:53 2003 RT_System - Default: Keyword/9 changed from (no value) to 'Linux'  
#   Fri Aug 29 06:24:54 2003 RT_System - Default: Keyword/11 changed from (no value) to 'medium'  
#   Fri Aug 29 06:24:54 2003 RT_System - Default: Keyword/12 changed from (no value) to 'core'  
#   Fri Aug 29 06:24:55 2003 RT_System - Default: Keyword/13 changed from (no value) to '5.8.0'  
#   Sat Aug 30 07:01:58 2003 andk - Correspondence added  
To: perl5-porters@perl.org
Subject: Re: [perl #23645] tell with perlio on appended files
From: Andreas J Koenig <andreas.koenig@anima.de>
Date: Sat, 30 Aug 2003 16:00:57 +0200
Download (untitled) [text/plain 1k]
>>>>> On 29 Aug 2003 13:24:53 -0000, Martyn Pearce (via RT) <perlbug-followup@perl.org> said:

Blame analysis:

----Program----
open $fh, ">>", "/tmp/hosts" or die;

print tell $fh;

----Output of .../pwWLCBh/perl-5.7.3@16886/bin/perl----
1729
----EOF ($?='0')----
----Output of .../pjLLd1n/perl-5.7.3@16887/bin/perl----
0
----EOF ($?='0')----

Change 16887 by jhi@alpha on 2002/05/30 13:51:29

Subject: [PATCH] Re: Linux glibc 2.2.90 issue; likely from readonly stdio mmap
From: Andy Dougherty <doughera@lafayette.edu>
Date: Thu, 30 May 2002 10:50:18 -0400 (EDT)
Message-ID: <Pine.SOL.4.10.10205301008040.22885-100000@maxwell.phys.lafayette.edu>




In this patch only the hints file is changed for linux. So in
principle one could override that hintsfile. I added

-Dd_stdstdio=define

to the Configure args and the bug disappears and all tests pass. I
tried this only for perl@16887 because I have no idea what else needs
to be done.

I tested it on a nearly identical Gentoo as in Martyn's report.


--
andreas
#   Thu Sep 04 12:00:26 2003 jhi - Correspondence added  
Download (untitled) [text/plain 241b]
I think regardless of the stdio config settings this was a genuine bug (perlio behaving
differently from stdio). But I now have submitted a fix for Perl 5.8.1-to-be, which will
hopefully help. I'm marking this problem ticket as resolved.
#   Thu Sep 04 12:00:27 2003 jhi - Status changed from 'new' to 'resolved'  


For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org