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

[ID 20010629.004] getpwent() problems on HPUX 11

Richard J. Rauenzahn
June 29, 2001 15:57
[ID 20010629.004] getpwent() problems on HPUX 11
Message ID:

This is a bug report for perl from,
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

do {
   print @entries;
} until (@entries==0);

There is also a problem with ...

do {
   print @entries;
} until (@entries==0);

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;
   do {
      pw = getpwent();
      if(pw) {
         printf("%s\n", pw->pw_name);
   } while (pw);
   pw = getpwent();

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]
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:
    osname=hpux, osvers=11.00, archname=PA-RISC2.0
    uname='hp-ux hairball b.11.00 u 9000785 2010760784 unlimited-user license '
    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
    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/, 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:

Environment for perl v5.6.1:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHLIB_PATH (unset) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About