Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.93k stars 553 forks source link

Core dump on HP-UX using getpwent. #5308

Closed p5pRT closed 16 years ago

p5pRT commented 22 years ago

Migrated from rt.perl.org#8907 (status was 'resolved')

Searchable as RT8907$

p5pRT commented 22 years ago

From @abigail

Created by @abigail

While teaching a Perl course at HP\, one of the students pointed out running a solution of one of the exercises gives a core dump.

I narrowed it down to the following program​:

  #!/usr/bin/perl -w   setpwent;   1 while getpwent;   endpwent;   __END__

Running this results in​:   Bus error(coredump)

Thinking it might be the library that dumps core\, I also wrote an equivalent C program​:

  #include \<pwd.h>

  int main (int argc\, char * argv []) {   struct passwd * dummy;   setpwent ();   while ((dummy = getpwent ()) != (struct passwd *) NULL) {1;}   endpwent ();   }

This runs without any problems.

ldd showed that the C program and /usr/bin/perl used the same versions of the C library.

This version of Perl was compiled on an older OS than the machine is running.

  $ uname -a   HP-UX wst08-00 B.11.00 C 9000/785 2002424543 32-user license   $

I tried compiling bleadperl on the machine\, but that fails on make depend (complaining about a C preprocessor). Tomorrow\, I might have a better compiler/preprocessor available\, but the sysadmin couldn't make any garantees.

Abigail

Perl Info ``` Flags: category=core severity=high Site configuration information for perl v5.6.1: Configured by rkl at Thu May 31 12:04:24 BST 2001. Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=hpux, osvers=10.20, archname=PA-RISC1.1 uname='hp-ux rydal b.10.20 a 9000777 2011764956 two-user license ' config_args='' 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 =' -Ae -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ', optimize='-O +Onolimit', cppflags='-Ae' ccversion='A.10.32.18', 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 ='' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt -lsec perllibs=-lnsl_s -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 -s -a shared' Locally applied patches: @INC for perl v5.6.1: /opt/perl5/lib/5.6.1/PA-RISC1.1 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1 /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl . Environment for perl v5.6.1: HOME=/home/user1 LANG=C LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/usr/bin:/usr/dt/bin:/usr/bin/X11:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hpnpl//bin:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/opt/ignite/bin:/usr/contrib/bin/X11:/opt/Acrobat4/bin:/opt/aCC/bin:/opt/langtools/bin:/opt/perf/bin:/opt/imake/bin:/opt/starburst/bin:/opt/unzip/bin:/opt/hparray/bin:/opt/graphics/common/bin:/opt/SharedX/bin:/opt/netscape/bin:. PERL_BADLANG (unset) SHELL=/usr/bin/sh SHLIB_PATH (unset) ```
p5pRT commented 19 years ago

From @smpeters

[abigail - Thu Apr 04 01​:07​:36 2002]​:

This is a bug report for perl from abigail@​foad.org\, generated with the help of perlbug 1.33 running under perl v5.6.1.

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

While teaching a Perl course at HP\, one of the students pointed out running a solution of one of the exercises gives a core dump.

I narrowed it down to the following program​:

\#\!/usr/bin/perl \-w
setpwent;
1 while getpwent;
endpwent;
\_\_END\_\_

Running this results in​: Bus error(coredump)

Thinking it might be the library that dumps core\, I also wrote an equivalent C program​:

\#include \<pwd\.h>

int main \(int argc\, char \* argv \[\]\) \{
    struct passwd \* dummy;
    setpwent \(\);
    while \(\(dummy = getpwent \(\)\) \!= \(struct passwd \*\) NULL\) \{1;\}
    endpwent \(\);
\}

This runs without any problems.

ldd showed that the C program and /usr/bin/perl used the same versions of the C library.

This version of Perl was compiled on an older OS than the machine is running.

$ uname \-a
HP\-UX wst08\-00 B\.11\.00 C 9000/785 2002424543 32\-user license
$

I tried compiling bleadperl on the machine\, but that fails on make depend (complaining about a C preprocessor). Tomorrow\, I might have a better compiler/preprocessor available\, but the sysadmin couldn't make any garantees.

Abigail

I'm not seeing this problem on HP-UX for a more recent Perl.

spe191​:Exit 3/house/smpeters 30 > cat core.pl #!/usr/bin/perl -w setpwent; 1 while getpwent; endpwent; __END__ spe191​:Exit 3/house/smpeters 31 > perl core.pl spe191​:Exit 3/house/smpeters 32 > uname -a HP-UX spe191 B.11.23 U 9000/800 1187371536 unlimited-user license spe191​:Exit 3/house/smpeters 33 > perl -v

This is perl\, v5.8.0 built for PA-RISC1.1-thread-multi (with 1 registered patch\, see perl -V for more detail)

Copyright 1987-2002\, Larry Wall

Binary build 806 provided by ActiveState Corp. http​://www.ActiveState.com Built 21​:44​:05 May 2 2003

p5pRT commented 19 years ago

@smpeters - Status changed from 'open' to 'resolved'

p5pRT commented 19 years ago

@smpeters - Status changed from 'resolved' to 'open'

p5pRT commented 19 years ago

From @smpeters

[stmpeters - Tue Dec 07 16​:53​:42 2004]​:

[abigail - Thu Apr 04 01​:07​:36 2002]​:

This is a bug report for perl from abigail@​foad.org\, generated with the help of perlbug 1.33 running under perl v5.6.1.

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

While teaching a Perl course at HP\, one of the students pointed out running a solution of one of the exercises gives a core dump.

I narrowed it down to the following program​:

\#\!/usr/bin/perl \-w
setpwent;
1 while getpwent;
endpwent;
\_\_END\_\_

Running this results in​: Bus error(coredump)

Thinking it might be the library that dumps core\, I also wrote an equivalent C program​:

\#include \<pwd\.h>

int main \(int argc\, char \* argv \[\]\) \{
    struct passwd \* dummy;
    setpwent \(\);
    while \(\(dummy = getpwent \(\)\) \!= \(struct passwd \*\) NULL\) \{1;\}
    endpwent \(\);
\}

This runs without any problems.

ldd showed that the C program and /usr/bin/perl used the same versions of the C library.

This version of Perl was compiled on an older OS than the machine is running.

$ uname \-a
HP\-UX wst08\-00 B\.11\.00 C 9000/785 2002424543 32\-user license
$

I tried compiling bleadperl on the machine\, but that fails on make depend (complaining about a C preprocessor). Tomorrow\, I might have a better compiler/preprocessor available\, but the sysadmin couldn't make any garantees.

Abigail

I'm not seeing this problem on HP-UX for a more recent Perl.

spe191​:Exit 3/house/smpeters 30 > cat core.pl #!/usr/bin/perl -w setpwent; 1 while getpwent; endpwent; __END__ spe191​:Exit 3/house/smpeters 31 > perl core.pl spe191​:Exit 3/house/smpeters 32 > uname -a HP-UX spe191 B.11.23 U 9000/800 1187371536 unlimited-user license spe191​:Exit 3/house/smpeters 33 > perl -v

This is perl\, v5.8.0 built for PA-RISC1.1-thread-multi (with 1 registered patch\, see perl -V for more detail)

Copyright 1987-2002\, Larry Wall

Binary build 806 provided by ActiveState Corp. http​://www.ActiveState.com Built 21​:44​:05 May 2 2003

Change #25084 may have implemented a possible fix to this problem. Are you still able to replicate this with a current bleadperl?

p5pRT commented 16 years ago

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'