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

[perl #58116] glob("~user") works every 2nd time

Thread Next
From:
Ulrich Windl
Date:
August 20, 2008 02:27
Subject:
[perl #58116] glob("~user") works every 2nd time
Message ID:
rt-3.6.HEAD-29759-1219157350-1850.58116-75-0@perl.org
# New Ticket Created by  "Ulrich Windl" 
# Please include the string:  [perl #58116]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58116 >



This is a bug report for perl from Ulrich.Windl@rz.uni-regensburg.de,
generated with the help of perlbug 1.34 running under perl v5.8.0.


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

I have written some code that works when called the first time, and from
then on it seems it only works every 2nd time.
That code (from a subroutine) is:

    $homedir = glob("~ora\L$ORA_SID\E");
    Log(0, 'E', 'logger', "~ora\L$ORA_SID\E: $!")
	unless ($homedir);

Explanation: $ORA_SID is set to "C11", effectively passing "~orac11" as
argument to glob. That user exists, just as the home directory.
Perl seems to query HP-UX 11.11's pwgrd (Password and Group Hashing and
Caching daemon) each time, but every second time an empty string is returned.
Errno, if relevant has ENOENT then.

I failed to reproduce the effect interactively in the Perl debugger.
The effect happens for two different user names. Reading perl delta docs,
I only found some other problem fixed in 5.8.5, so I wonder...

(Using (getpwnam("user"))[7] seems to work all the time...)

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

Configured by gsar at Fri May  2 21:41:51 PDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC1.1-thread-multi
    uname='hp-ux bertha b.11.00 u 9000800 136901587 unlimited-user license '
    config_args='-des -Dcc=gcc -Dcf_by=ActiveState -
Dcf_email=ActivePerl@ActiveState.com -Uinstallusrbinperl -Ud_sigsetjmp -
Dusethreads -Duseithreads -Ulocincpth= -Uloclibpth= -Accflags=-fPIC -
Dd_attribut=undef -Dcccdlflags=-fPIC -Darchname=PA-RISC1.1 -Duselargefiles -
Accflags=-mpa-risc-1-1 -Dprefix=/opt/perl -Duselargefiles'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -
fPIC -mpa-risc-1-1 -fno-strict-aliasing -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE 
-fPIC -mpa-risc-1-1 -fno-strict-aliasing'
    ccversion='', gccversion='3.2 20020708 (experimental)', 
gccosandvers='hpux11.00'
    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, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib /usr/local/lib
    libs=-lnsl -lnm -lndbm -lmalloc -ldld -lm -lndir -lcrypt -lsec -lpthread
    perllibs=-lnsl -lnm -lmalloc -ldld -lm -lndir -lcrypt -lsec -lpthread
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred 
'
    cccdlflags='-fPIC', lddlflags='-shared -static-libgcc -fPIC'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY

---
@INC for perl v5.8.0:
    /opt/perl/lib/5.8.0/PA-RISC1.1-thread-multi
    /opt/perl/lib/5.8.0
    /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi
    /opt/perl/lib/site_perl/5.8.0
    /opt/perl/lib/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/windl
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    
PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/n
ettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/b
in/X11:/opt/mx/bin:/opt/resmon/bin:/opt/scr/bin:/opt/ignite/bin:/opt/perl/bin:/opt
/graphics/common/bin:/usr/sbin/diag/contrib:/opt/hpnpl/bin:/opt/mozilla:/opt/netsc
ape:/opt/omni/bin:/opt/perl/bin:/opt/ssh/bin
    PERL_BADLANG (unset)
    SHELL=/usr/bin/csh



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