develooper Front page | perl.perl5.porters | Postings from March 2003

[perl #21780] odd bug with handle dup

From:
perlbug-followup
Date:
March 31, 2003 19:44
Subject:
[perl #21780] odd bug with handle dup
Message ID:
rt-21780-54423.5.62748864739618@bugs6.perl.org
# New Ticket Created by  belg4mit@mit.edu 
# Please include the string:  [perl #21780]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21780 >


This is a bug report for perl from belg4mit@mit.edu,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
While playing with code to dup DATA to STDIN I inadvertently came
up with the following

  $a = tell(DATA);
  seek(DATA,$a,0);
  open(STDIN, "<&DATA");
  while(<STDIN>){
    print "STDIN: $_";
  }
  __DATA__
  Foo
  Bar
  Quux

The first two lines would seem to be no-ops. And yet in several 
instances nothing is read without them. Known configs where this
has failed are this box with the version of perl below as well
as the following perl -V I have also received reports of failure
without the first two lines on builds of 5.8 for SCO and RH

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos downy.mit.edu 5.8 generic_108528-12 sun4u sparc sunw,ultraax-i2 '
    config_args='-d -s -e -Dprefix=/usr/athena -Dcc=gcc -Dlocincpth=/usr/athena/include -Dloclibpth=/usr/athena/lib -Dperladmin=bugs@mit.edu'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/athena/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -I/usr/athena/include'
    ccversion='', gccversion='3.0.3', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/athena/lib '
    libpth=/usr/athena/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lbsd -liconv
    perllibs=-lsocket -lnsl -ldl -lm -lc -lbsd -liconv
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-E'
    cccdlflags='-fPIC', lddlflags=' -W,l-E -G -L/usr/athena/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Sep 12 2002 16:20:01
  @INC:
    /usr/athena/lib/perl5/5.6.1/sun4-solaris
    /usr/athena/lib/perl5/5.6.1
    /usr/athena/lib/perl5/site_perl/5.6.1/sun4-solaris
    /usr/athena/lib/perl5/site_perl/5.6.1
    /usr/athena/lib/perl5/site_perl
    .
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos technomage 5.5.1 generic_103640-12 sun4m sparc sunw,sparcclassic '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='/usr/gcc/bin/gcc', optimize='-O2', gccversion=2.7.2.1
    cppflags=''
    ccflags =''
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/usr/gcc/bin/gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under solaris
  Compiled at Feb  9 1998 20:13:09
  @INC:
    /afs/athena/contrib/perl5/arch/sun4x_55/lib/perl5.004
    /afs/athena/contrib/perl5/arch/share/perl5.004
    /afs/athena/contrib/perl5/arch/sun4x_55/lib/perl5.004/site_perl
    /afs/athena/contrib/perl5/arch/share/perl5.004/site_perl
    .


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

Configured by belg4mit at Fri Aug  9 06:33:44 EDT 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris-64int
    uname='sunos biohazard-cafe.mit.edu 5.8 generic_108528-12 sun4u sparc sunw,sun-fire-280r '
    config_args='-Dprefix=/mit/belg4mit'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='',
    optimize='-O',
    cppflags=''
    ccversion='Sun WorkShop 6 update 1 C 5.2 2000/09/11', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/mit/sunsoft_v6.1a/SUNWspro/WS6U1/lib'
    libpth=/usr/local/lib /mit/sunsoft_v6.1a/SUNWspro/WS6U1/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/mit/sunsoft_v6.1a/SUNWspro/WS6U1/lib'

Locally applied patches:
    

---
@INC for perl v5.8.0:
    /mit/belg4mit/lib/perl5/5.8.0/sun4-solaris-64int
    /mit/belg4mit/lib/perl5/5.8.0
    /mit/belg4mit/lib/perl5/site_perl/5.8.0/sun4-solaris-64int
    /mit/belg4mit/lib/perl5/site_perl/5.8.0
    /mit/belg4mit/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/mit/belg4mit
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/openwin/lib
    LOGDIR (unset)
    PATH=/mit/belg4mit/Private:/mit/belg4mit/arch/sun4x_58/bin:/srvd/patch:/usr/athena/bin:/usr/athena/etc:/bin/athena:/usr/openwin/bin:/usr/openwin/demo:/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin:/usr/ucb:/mit/sipb/arch/sun4x_58/bin:/mit/gnu/arch/sun4x_58/bin:/mit/games/arch/sun4x_58/bin:/mit/consult/arch/sun4x_58/bin:/mit/outland/arch/sun4x_58/bin:/mit/perl5/arch/sun4x_58/bin:/mit/perl/arch/sun4x_58/bin
    PERL_BADLANG (unset)
    SHELL=/bin/athena/tcsh




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About