Open p5pRT opened 23 years ago
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.
@Tux is this worth pursuing or should we close it?
Migrated from rt.perl.org#7207 (status was 'open')
Searchable as RT7207$