Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nss_ldap segment fault, need suggestion to resolve
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
czhang
n00b
n00b


Joined: 24 Aug 2002
Posts: 16

PostPosted: Sun Jul 27, 2003 4:54 am    Post subject: nss_ldap segment fault, need suggestion to resolve Reply with quote

package versions:
nss_ldap 207-r1
openldap 2.3.2-r1
glibc 2.3.2-r1

I tried to use LDAP to replace NIS. Now when I test with 'getent -s ldap passwd', I will get 'Segmentation fault'.

My ldap.conf is
Code:
host dragoon
base dc=wlb2,dc=n2pcorp,dc=com
scope one
pam_filter objectclass=posixaccount
pam_login_attribute uid
pam_member_attribute gid
pam_password md5
nss_base_passwd ou=People,dc=wlb2,dc=n2pcorp,dc=com?one
nss_base_shadow ou=People,dc=wlb2,dc=n2pcorp,dc=com?one
nss_base_group  ou=Group,dc=wlb2,dc=n2pcorp,dc=com?one
nss_base_hosts  ou=Hosts,dc=wlb2,dc=n2pcorp,dc=com?one


I used gdb to see what's going on. First 10 stack frames are ...
Code:
#0  0x4005e7b2 in _IO_vfprintf (s=0xbf800250, format=0x4014b99a "(&(objectclass=%s)(%s=%s))",
    ap=0xbf80037c "\215¹\024@h¸\024@'µ\024@¨\003\200¿\223H\024@ÀÉ\024@£¸\024@\234\003\200¿£¸\024@¬Ç\024@¨Ê\024@È\003\200¿\025\214\024@£¸\024@") at vfprintf.c:231
#1  0x40080476 in _IO_vsnprintf (string=0x40151560 "", maxlen=1024,
    format=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@",
    args=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@") at vsnprintf.c:130
#2  0x400687c4 in __snprintf (
    s=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@",
    maxlen=3212837456,
    format=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@") at snprintf.c:37
#3  0x40147d2d in _nss_ldap_init_filters () at ldap-schema.c:134
#4  0x40142b53 in do_open () at ldap-nss.c:1033
#5  0x40143dec in _nss_ldap_search_s (args=0xbf800d20, filterprot=0x40155160 "(&(objectclass=ipHost)(cn=%s))",
    sel=LM_HOSTS, sizelimit=1, res=0xbf800cd0) at ldap-nss.c:2285
#6  0x40144364 in _nss_ldap_getbyname (args=0xbf800d20, result=0xbf800250,
    buffer=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", buflen=3212837456, errnop=0xbf800250,
    filterprot=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", sel=3212837456, parser=0xbf800250) at ldap-nss.c:2635
#7  0x4014673d in _nss_ldap_gethostbyname2_r (
    name=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", af=2, result=0xbf800250,
    buffer=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", buflen=3212837456, errnop=0xbf800250, h_errnop=0xbf800e1c) at ldap-hosts.c:281
#8  0x401467ba in _nss_ldap_gethostbyname_r (
    name=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", result=0xbf800250,
    buffer=0xbf800250 "\001\200­û`\025\025@`\025\025@`\025\025@`\025\025@`\025\025@_\031\025@`\025\025@_\031\025@", buflen=3212837456, errnop=0xbf800250, h_errnop=0xbf800250) at ldap-hosts.c:304
#9  0x400ff468 in __gethostbyname_r (name=0xbf800e40 "archon", resbuf=0xbf800d20, buffer=0x8327c50 "",
    buflen=1024, result=0xbf800e18, h_errnop=0xbf800e1c) at getXXbyYY_r.c:219
#10 0x401728bd in ldap_pvt_gethostbyname_a () from /usr/lib/libldap.so.2
#11 0x40172a98 in ldap_pvt_get_fqdn () from /usr/lib/libldap.so.2
#12 0x40171418 in ldap_int_initialize () from /usr/lib/libldap.so.2
#13 0x4015e4e8 in ldap_create () from /usr/lib/libldap.so.2
#14 0x4015e60b in ldap_init () from /usr/lib/libldap.so.2
#15 0x40142de2 in do_open () at ldap-nss.c:1070

I should say I am not familiar with nss_ldap code at all. I checked func _nss_ldap_init_filters() and failed to see how snprintf will cause a segment fault.

There is more I don't understand. The total frames are 31859 as shown below. Even if assuming nss_ldap's code rely on recursive, I still don't think it requires so many stack frames to do what it should do. Or this cause stack overflow?
Code:
#31856 0x400bf610 in getpwent () at getXXent.c:84
#31857 0x08049ffc in passwd_keys (number=0, key=0xbffffc64) at getent.c:408
#31858 0x0804a930 in main (argc=1, argv=0xbffffc54) at getent.c:798
#31859 0x4002c856 in __libc_start_main (main=0x804a7f0 <main>, argc=4, ubp_av=0xbffffc54,
    init=0x804aee0 <__libc_csu_init>, fini=0x804af10 <__libc_csu_fini>, rtld_fini=0x40013220 <_rtld_local>,
    stack_end=0xbf800250) at ../sysdeps/generic/libc-start.c:152
Back to top
View user's profile Send private message
scape
n00b
n00b


Joined: 22 Oct 2002
Posts: 16
Location: Stuttgart, Germany

PostPosted: Mon Aug 18, 2003 8:12 pm    Post subject: Re: nss_ldap segment fault, need suggestion to resolve Reply with quote

same here, has this been resolved yet?
_________________
a slave begins by demanding justice and ends by wanting to wear a crown
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum