Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have perl 5.6 (I've also tried 5.8) that I compiled ona Solaris 8 box. The solaris 8 box is configured to use ldap via nsswitch. I was having a crash when calling getpwent from my program and created a quick little test that also crashes in perl on getpwent call. The perl 5.005 that shipped with the sol8 box doesn't crash, but the one I built crashes. Did I forget a --dont_crash_on_getpwent when I built the perl?
Here's the test programPerl is crashing whenever the local passwd file entries are exhausted and the first user from ldap should be displayedprintf("start\n"); _init_UIDs(); printf("end\n"); sub _init_UIDs() { while (my @ent = getpwent()) { printf("%s\n", $ent[0]); $UIDs{$ent[2]} = $ent[0]; $Unames{$ent[0]} = $ent[2]; } }
here's the core file
core '/core' of 416: /opt/moonlight/perl-5.6.0- 0007/bin/perl ./moonwalk.pl -j Job15 ff0cf158 strcat (1, fee1cd40, fee1c000, ffbee540, c, 0) fee07634 netgr_set (0, ffbef6b0, fee1cd30, 95a07c, fee1c000, ffbef6b0) + + 288 ff0c9504 nss_search (fee44408, ff13ef3c, ff143594, fee073ac, 8af360, 8 +3fcc8) + 1cc fee31b2c netgr_set (895778, 897b7a, fee44000, 895778, 3a, 3a) + c8 fee3273c _nss_compat_getent (c, 4, 8957a0, ffffffff, 897b7d, c) + 26c ff0c9ba8 nss_getent_u (ff1406c8, ff118af4, 896280, 87acb8, 896278, 895 +778) + b0 ff0c971c nss_getent (ff1406c8, ff1406f0, ff1406e8, ffbef848, ff118af4, + ff1406c8) + 34 ff118c64 getspent_r (89774c, ff1406e8, ff118af4, 27434, ff118e6c, 8977 +4c) + 54 ff344928 Perl_pp_gpwent (ff344828, 4000, 746888, 1b3ce0, 0, 1b3d04) + +100 ff2f9740 Perl_runops_standard (22a2c, 22a2c, ff383fa8, ff3e66c0, 0, 5) + + 24 ff2a18d8 S_run_body (1, ffbefa38, ff383af4, 0, 0, 0) + 1c0 ff2a13f0 perl_run (0, 1153c, 4, ffbefb74, 0, ff09bbe0) + bc 0001150c main (0, ffbefb74, ffbefb88, 22a0c, 0, 0) + b0 000112e8 _start (0, 0, 0, 0, 0, 0) + 5c
Here's the beginning of my nsswitch.conf...
# # /etc/nsswitch.ldap: # # An example file that could be copied over to /etc/nsswitch.conf; it # uses LDAP in conjunction with files. # # "hosts:" and "services:" in this file are used only if the # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transpor +ts. # the following two lines obviate the "+" entry in /etc/passwd and /et +c/group. passwd: compat passwd_compat: ldap group: files ldap
edited: Sun Mar 30 13:52:49 2003 by jeffa - code tags, removed a gazillion <br> tags
|
|---|