develooper Front page | perl.perl5.porters | Postings from December 2004

[perl #8907] Core dump on HP-UX using getpwent.

From:
Steve Peters via RT
Date:
December 7, 2004 16:53
Subject:
[perl #8907] Core dump on HP-UX using getpwent.
Message ID:
rt-3.0.11-8907-102350.4.23453699739554@perl.org
> [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





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