develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010811.013] perlio bug ?

Thread Next
From:
me-01
Date:
August 11, 2001 19:29
Subject:
[ID 20010811.013] perlio bug ?
Message ID:
20010812022927.30292.qmail@quasar.home.lunix
This is a bug report for perl from perl@ton.iguana.be,
generated with the help of perlbug 1.33 running under perl v5.7.1.


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

Run this from the commandline:

perl -wle 'print $]; sub foo { local (*A, *B); pipe(A,B); return fileno(A)}; sub bar { local *BOE; print open(BOE, "<&=" . foo) ? "bad" : "good"}; bar; close STDIN; bar'

Tested on two systems this gives:
5.007001
good
bad

5.006
good
good


Written formatted, the code is:

print $];

sub foo {
    local (*A, *B);
    pipe(A,B);
    return fileno(A)
};

sub bar { 
    local *BOE;
    print open(BOE, "<&=" . foo) ? "bad" : "good"
}; 

bar;
close STDIN;
bar

the filehandles created in foo should be closed when foo is left,
so bar's attempt to fdopen on the filedescriptor should fail.

It however succeeds from perl 5.7 on for filedescriptors 0, 1 and 2
because the closes are in fact not done.

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

Configured by ton at Sat May 12 18:42:24 CEST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.3, archname=i686-linux
    uname='linux quasar 2.4.3 #19 sun apr 1 10:46:29 cest 2001 i686 unknown '
    config_args='-e'
    hint=previous, 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
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUGGING',
    optimize='-g',
    cppflags='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUGGING'
    ccversion='', gccversion='egcs-2.91.66 19990314 (egcs-1.1.2 release)', 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=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/opt/gnu/lib'
    libpth=/usr/local/lib /opt/gnu/lib /lib /usr/lib
    libs=-lnsl -lndbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil
    libc=/lib/libc-2.1.1.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.7.1/i686-linux/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib -L/opt/gnu/lib'

Locally applied patches:
    

---
@INC for perl v5.7.1:
    /usr/lib/perl5/5.7.1/i686-linux
    /usr/lib/perl5/5.7.1
    /usr/lib/perl5/site_perl/5.7.1/i686-linux
    /usr/lib/perl5/site_perl/5.7.1
    /usr/lib/perl5/site_perl
    .

---
Environment for perl v5.7.1:
    HOME=/home/ton
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/ton/bin.Linux:/home/ton/bin:/home/ton/bin.SampleSetup:/usr/local/bin:/usr/local/sbin:/usr/local/jre/bin:/usr/local/jdk116_v5/bin:/home/oracle/product/8.1.5/bin:/usr/games/bin:/usr/X11R6/bin:/usr/share/bin:/usr/bin:/usr/sbin:/bin:/sbin:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Next


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