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

[ID 20010629.004] getpwent() problems on HPUX 11

From:
Richard J. Rauenzahn
Date:
June 29, 2001 15:57
Subject:
[ID 20010629.004] getpwent() problems on HPUX 11
Message ID:
200106292254.PAA06554@hairball.cup.hp.com

This is a bug report for perl from rrauenza@hairball.cup.hp.com,
generated with the help of perlbug 1.33 running under perl v5.6.1.


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

perl 5.6.1 doesn't pass t/op/grent.t (2nd test) on my machine -- it
dumps core.  grent.t doesn't dump core on all machines -- depending on
the number of entries in /etc/passwd.

A short script that reproduces the problem with any number of entries is
...

$,=":";
$\="\n";
setgrent();
do {
   @entries=getgrent();
   print @entries;
} until (@entries==0);
endgrent();

There is also a problem with ...

$,=":";
$\="\n";
setpwent();
do {
   @entries=getpwent();
   print @entries;
} until (@entries==0);
endpwent();

The .c "equivalent" doesn't fail -- but the perl script does a lot of
other passwd function calls that the .c doesn't do -- this was my first
step at trying to reproduce it in C:

#include <pwd.h>

int main() {
   struct passwd *pw;
   setpwent();
   do {
      pw = getpwent();
      if(pw) {
         printf("%s\n", pw->pw_name);
      }
   } while (pw);
   pw = getpwent();
   endpwent();
}

The perl scripts above also fail (core dump) with 5.6.0 and do so on
some other machines, too.

The stack trace for the core dump (of the getpwent script above) in
5.6.1 looks like:

#0  0x77e93a00 in  () from /usr/lib/libc.2
#1  0x77f38e20 in __nss_src_state_destr () from /usr/lib/libc.2
#2  0x77f39038 in __nss_src_state_destr () from /usr/lib/libc.2
#3  0x77f39178 in nss_delete () from /usr/lib/libc.2
#4  0x77f3a6a0 in nss_endent () from /usr/lib/libc.2
#5  0x77f3994c in nss_getent () from /usr/lib/libc.2
#6  0x77f7b710 in __getpwent_r () from /usr/lib/libc.2
#7  0x77f7b868 in getpwent () from /usr/lib/libc.2
#8  0x10c198 in Perl_pp_gpwent () at /usr/local/src/perl/perl5.6.1/perl-5.6.1/pp_sys.c:4888
#9  0xb9e9c in Perl_runops_standard () at /usr/local/src/perl/perl5.6.1/perl-5.6.1/run.c:24
#10 0x27334 in S_run_body (oldscope=1) at /usr/local/src/perl/perl5.6.1/perl-5.6.1/perl.c:1471
#11 0x26e40 in perl_run (my_perl=0x40010004) at /usr/local/src/perl/perl5.6.1/perl-5.6.1/perl.c:1393
#12 0x224a8 in main (argc=2, argv=0x77fe0a3c, env=0x77fe0a48) at /usr/local/src/perl/perl5.6.1/perl-5.6.1/perlmain.c:52

So, the core dump is down in libc somewhere, somehow caused by an
interaction with perl.  I haven't been able to figure out what causes
it, and Purify 5.2 is unhappy with one of the opcodes emitted by the
compiler I have installed.

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

Configured by rrauenza at Wed Jun 27 14:32:49 PDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux hairball b.11.00 u 9000785 2010760784 unlimited-user license '
    config_args=''
    hint=previous, 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 ='-D_HPUX_SOURCE -I/usr/local/include -I/opt/GNU/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae',
    optimize='-g -v',
    cppflags='-D_HPUX_SOURCE -I/usr/local/include -I/opt/GNU/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Ae'
    ccversion='A.11.01.20', gccversion='', gccosandvers=''
    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='ld', ldflags =' -L/usr/local/lib -L/opt/GNU/lib'
    libpth=/usr/local/lib /opt/GNU/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt -lsec
    perllibs=-lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b +vnocompatwarnings -L/usr/local/lib -L/opt/GNU/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /opt/perlman/lib
    /opt/perl5.6.1/lib/5.6.1/PA-RISC2.0
    /opt/perl5.6.1/lib/5.6.1
    /opt/perl5.6.1/lib/site_perl/5.6.1/PA-RISC2.0
    /opt/perl5.6.1/lib/site_perl/5.6.1
    /opt/perl5.6.1/lib/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/rrauenza
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/usr/sbin:/opt/socks/bin:/home/rrauenza/bin:/bin:/usr/dt/bin:/usr/bin/X11:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/usr/contrib/bin/X11:/usr/local/bin/X11:/opt/graphics/common/bin:/opt/upgrade/bin:/opt/langtools/bin:/opt/perf/bin:/opt/imake/bin:/opt/omni/bin:/opt/hppd/bin/find/:/opt/GNU/bin:/opt/wscoe/bin:/opt/aCC/bin:/opt/pd/bin:/opt/trn4/bin:/opt/ignite/bin:/opt/graphics/OpenGL/debugger/bin:/opt/resmon/bin:/opt/gnuplot/bin:/opt/screen/bin:/opt/hparray/bin:/opt/ispell/bin:/usr/local/bin:/opt/lsof/bin:/opt/perl5/bin:/opt/mutt/bin:/opt/bash/bin:/opt/lynx/bin:/opt/OV/bin/OpC:/opt/prm/bin:/opt/graphics/phigs/bin:/opt/w3m/bin:/opt/tusc:/opt/ssh2/bin:/opt/gnome/bin:/opt/netpbm/bin/X11:/sbin:/opt/perlman/bin
    PERL5LIB=/opt/perlman/lib
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/bash
    SHLIB_PATH (unset)




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