[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Segmentaion fault with ldap backend (ITS#3021)



Hi,

No,  I didn't enable rewrite.  After rebuild with --enable-rewrite, the ldap 
backend works fine.  (Although I'm stuck by some other problems then. :p)

I tried to compile 2.1.27 without --enable-rewrite, this problem won't happen.  
Then I double checked with 2.1.25, it does segmentation fault.

I found 2 scenerios here: (both with suffixmassage)

1. Remove server returns an attribute that the local server does not 
recognise.

(gdb) run -d 4
Starting program: /home/johnlee/src/openldap-2.1.25/servers/slapd/slapd -d 4
[New Thread 1024 (LWP 18107)]
daemon_init: <null>
daemon: socket() failed errno=97 (Address family not supported by protocol)
bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December  3, 2003)
slapd starting
[New Thread 2049 (LWP 18115)]
[New Thread 1026 (LWP 18116)]
connection_get(11)
[New Thread 2051 (LWP 18119)]
send_ldap_result: err=0 matched="" text=""
connection_get(11)
SRCH "" 2 0    0 0 0
    filter: (objectClass=*)
    attrs:
request 1 done
ldap_back_dn_massage: converted "dc=my-domain,dc=com" to "dc=JohnLee-Fedora"
ldap_back_dn_massage: converted "dc=JohnLee-Fedora" to "dc=my-domain,dc=com"
ldap_back_dn_massage: converted "ou=Group,dc=JohnLee-Fedora" to 
"ou=Group,dc=my-domain,dc=com"

(... strip..)

ldap_back_dn_massage: converted "ou=Networks,dc=JohnLee-Fedora" to 
"ou=Networks,dc=my-domain,dc=com"
ldap_back_dn_massage: converted "cn=root,ou=Group,dc=JohnLee-Fedora" to 
"cn=root,ou=Group,dc=my-domain,dc=com"

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2051 (LWP 18119)]
0x4015d0c7 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
(gdb) bt
#0  0x4015d0c7 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#1  0x4207ac18 in free () from /lib/i686/libc.so.6
#2  0x080bc141 in ber_bvarray_free (a=0x81c89b0) at memory.c:658
#3  0x08089c22 in ldap_send_entry (be=0x8193c78, op=0x81c7f38, lc=0x81c83c0,
    e=0x81c86f8, attrs=0x0, attrsonly=0) at search.c:636
#4  0x080895b1 in ldap_back_search (be=0x8193c78, conn=0x401a7c68,
    op=0x81c7f38, base=0x409f087c, nbase=0x409f0884, scope=2, deref=0,
    slimit=0, tlimit=0, filter=0x81c8048, filterstr=0x409f086c, attrs=0x0,
    attrsonly=0) at search.c:292
#5  0x0805339e in do_search (conn=0x401a7c68, op=0x81c7f38) at search.c:401
#6  0x08051936 in connection_operation (ctx=0x81c7fc0, arg_v=0x81c7f38)
    at connection.c:943
#7  0x0809f03d in ldap_int_thread_pool_wrapper (xpool=0x81867d0) at 
tpool.c:432
#8  0x4015bfef in pthread_start_thread () from /lib/i686/libpthread.so.0
#9  0x4015c0df in pthread_start_thread_event () from /lib/i686/libpthread.so.0

2. At the end of search operation.

(gdb) run -d 4
Starting program: /home/johnlee/src/openldap-2.1.25/servers/slapd/slapd -d 4
[New Thread 1024 (LWP 18124)]
daemon_init: <null>
daemon: socket() failed errno=97 (Address family not supported by protocol)
bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December  3, 2003)
slapd starting
[New Thread 2049 (LWP 18132)]
[New Thread 1026 (LWP 18133)]
connection_get(11)
[New Thread 2051 (LWP 18135)]
send_ldap_result: err=0 matched="" text=""
connection_get(11)
SRCH "" 2 0    0 0 0
    filter: (objectClass=*)
    attrs:
request 1 done
ldap_back_dn_massage: converted "dc=my-domain,dc=com" to "dc=JohnLee-Fedora"
ldap_back_dn_massage: converted "dc=JohnLee-Fedora" to "dc=my-domain,dc=com"
ldap_back_dn_massage: converted "ou=Group,dc=JohnLee-Fedora" to 
"ou=Group,dc=my-domain,dc=com"

(... strip... )

ldap_back_dn_massage: converted "uid=ldap,ou=People,dc=JohnLee-Fedora" to 
"uid=ldap,ou=People,dc=my-domain,dc=com"
ldap_back_dn_massage: converted "uid=privoxy,ou=People,dc=JohnLee-Fedora" to 
"uid=privoxy,ou=People,dc=my-domain,dc=com"
ldap_back_dn_massage: converted "uid=tester,ou=People,dc=JohnLee-Fedora" to 
"uid=tester,ou=People,dc=my-domain,dc=com"
request 2 done

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2051 (LWP 18135)]
0x4015d0c7 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
(gdb) bt
#0  0x4015d0c7 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#1  0x4207ac18 in free () from /lib/i686/libc.so.6
#2  0x080897b4 in ldap_back_search (be=0x8193c50, conn=0x401a7c68,
    op=0x81d4090, base=0x409f087c, nbase=0x409f0884, scope=2, deref=0,
    slimit=0, tlimit=0, filter=0x81d41a0, filterstr=0x409f086c, attrs=0x0,
    attrsonly=0) at search.c:408
#3  0x0805339e in do_search (conn=0x401a7c68, op=0x81d4090) at search.c:401
#4  0x08051936 in connection_operation (ctx=0x81d4118, arg_v=0x81d4090)
    at connection.c:943
#5  0x0809f03d in ldap_int_thread_pool_wrapper (xpool=0x81867d0) at 
tpool.c:432
#6  0x4015bfef in pthread_start_thread () from /lib/i686/libpthread.so.0
#7  0x4015c0df in pthread_start_thread_event () from /lib/i686/libpthread.so.0

Hope it helps.

Regards,
John Lee



On Tuesday 16 March 2004 00:28, Pierangelo Masarati wrote:
> > Full_Name: John C.Y. Lee
> > Version: 2.1.25
> > OS: RedHat 7.3
> > URL: ftp://ftp.openldap.org/incoming/
> > Submission from: (NULL) (61.218.72.138)
>
> can you confirm the problem with later versions
> (e.g. REL_ENG_2_1 from cvs or 2.1.27)?
>
> p.