develooper Front page | perl.perl5.porters | Postings from November 2000

[ID 20001106.006] find2perl generated scripts issue new lstat()on filehandle _ warning

Thread Next
From:
David Dyck
Date:
November 6, 2000 22:45
Subject:
[ID 20001106.006] find2perl generated scripts issue new lstat()on filehandle _ warning
Message ID:
200011070645.WAA14455@dd.tc.fluke.com
This is a bug report for perl from dcd@tc.fluke.com,
generated with the help of perlbug 1.32 running under perl v5.7.0.


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

I selected category core (even though find2perl is
probably a utility), since the warning is issued from lstat

This is causing my backup scripts generated initially using
find2perl, and greatly modified since, to issue thousands
of lines of warnings.   (does the warning need to be issued
more than once?)  Also, I read that lstat(_) will become 
a fatal error in the future -  do you really want to break
many backup scripts like this?  

Reproduce by:
$ cd perl-current
$ find2perl -name 'INS*' -tar /tmp/ins.tar > /tmp/doins
$ perl /tmp/doins
lstat() on filehandle _ at /tmp/doins line 67.

Here's some of the code that find2perl generated, and
it appears that it's trying to avoid doing a second 
lstat on the file, once inside wanted, and the second
time in sub tar.

     1	#! /usr/local/bin/perl -w
  ...
    36	sub wanted {
    37	    my ($dev,$ino,$mode,$nlink,$uid,$gid);
    38	
    39	    /^INS.*\z/s &&
    40	    (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
    41	    &tar(*FH_tmp_ins_tar, $name);
    42	}
    43	
  ...
    62	sub tar {
    63	    my ($fh, $fname) = @_;
  ...
    67	    my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
    68	        $atime,$mtime,$ctime,$blksize,$blocks) = lstat(_);
  ...



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

Configured by dcd at Mon Nov  6 15:10:14 PST 2000.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.0-test10, archname=i686-linux
    uname='linux dd 2.4.0-test10 #1 tue oct 31 13:48:39 pst 2000 i686 '
    config_args='-Dusedevel -Doptimize=-O3 -g -de -Dcf_email=dcd@tc.fluke.com'
    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='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66.1 19990314/Linux (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=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/lib/libc.so.5.4.44, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    DEVEL7572

---
@INC for perl v5.7.0:
    /usr/local/lib/perl5/5.7.0/i686-linux
    /usr/local/lib/perl5/5.7.0
    /usr/local/lib/perl5/site_perl/5.7.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.7.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.7.0:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    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