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

Re: [POT] PHP 'hangs' slapd (?!)



Quoting Turbo Fredriksson <turbo@bayour.com>:

> Quoting Turbo Fredriksson <turbo@bayour.com>:
>
>>>>>>> "Pierangelo" == Pierangelo Masarati <ando@sys-net.it> writes:
>>
>>     Pierangelo> The report is a bit vague.  I suggest you run a
>>     Pierangelo> non-stripped binary, and run gdb on it when it hangs
>>     Pierangelo> to see where (and what stack strace with) it happens.
>>     Pierangelo> Some trace of the operation initiated by PHP would
>>     Pierangelo> also be of help.
>>
>> I'm no friend of gdb, but when it hangs, I break (Ctrl-C from within gdb)
>> and get a backtrace:
>
> Backtrace with non-stripped db4.2 libs:

I/we already figured it have something to do with locks (from the
back trace), but this probably proves it:

Stats directly after a slapadd, before starting slapd for the first
time:
----- s n i p -----
[papadoc.root]# db4.2_stat -h /var/lib/ldap -c
73      Last allocated locker ID.
2147M   Current maximum unused locker ID.
9       Number of lock modes.
1000    Maximum number of locks possible.
1000    Maximum number of lockers possible.
1000    Maximum number of lock objects possible.
0       Number of current locks.
46      Maximum number of locks at any one time.
0       Number of current lockers.
74      Maximum number of lockers at any one time.
0       Number of current lock objects.
45      Maximum number of lock objects at any one time.
31506   Total number of locks requested.
31506   Total number of locks released.
0       Total number of lock requests failing because DB_LOCK_NOWAIT was set.
0       Total number of locks not immediately available due to conflicts.
0       Number of deadlocks.
0       Lock timeout value.
0       Number of locks that have timed out.
0       Transaction timeout value.
0       Number of transactions that have timed out.
360KB   The size of the lock region..
0       The number of region locks granted after waiting.
40204   The number of region locks granted without waiting.
----- s n i p -----

Again, but after successfully hanging slapd, and had to abort
it by Ctrl-C:
----- s n i p -----
[papadoc.root]# db4.2_stat -h /var/lib/ldap -c
83      Last allocated locker ID.
2147M   Current maximum unused locker ID.
9       Number of lock modes.
1000    Maximum number of locks possible.
1000    Maximum number of lockers possible.
1000    Maximum number of lock objects possible.
13      Number of current locks.
46      Maximum number of locks at any one time.
12      Number of current lockers.
74      Maximum number of lockers at any one time.
11      Number of current lock objects.
45      Maximum number of lock objects at any one time.
31580   Total number of locks requested.
31564   Total number of locks released.
0       Total number of lock requests failing because DB_LOCK_NOWAIT was set.
1       Total number of locks not immediately available due to conflicts.
0       Number of deadlocks.
0       Lock timeout value.
0       Number of locks that have timed out.
0       Transaction timeout value.
0       Number of transactions that have timed out.
360KB   The size of the lock region..
0       The number of region locks granted after waiting.
40342   The number of region locks granted without waiting.
----- s n i p -----

So, 13 locks not released (same number every single time I'm
doing this)...

Problem with threads? These are the options I'm using for compiling
OpenLDAP:
----- s n i p -----
--disable-perl --enable-aci --enable-bdb --enable-cache --enable-crypt
--enable-debug --enable-dnssrv --enable-dynamic --enable-dyngroup
--enable-ipv6 --enable-ldap --enable-ldbm --enable-local --enable-meta
--enable-modules --enable-monitor --enable-multimaster --enable-null
--enable-passwd --enable-phonetic --enable-proctitle --enable-proxycache
--enable-referrals --enable-rewrite --enable-rlookups --enable-shared
--enable-shell --enable-slapd --enable-slapi --enable-slp --enable-slurpd
--enable-spasswd --enable-sql --enable-syslog --enable-wrappers
--libexecdir='${prefix}/lib' --localstatedir=/var/run
--mandir='${prefix}/share/man' --prefix=/usr --sysconfdir=/etc
--with-bdb-module=dynamic --with-cyrus-sasl --with-dnssrv-module=dynamic
--with-ldap-module=dynamic --with-ldbm-api=berkeley --with-ldbm-module=dynamic
--with-meta-module=dynamic --with-monitor-module=dynamic
--with-null-module=dynamic --with-passwd-module=dynamic --with-readline
--with-shell-module=dynamic --with-sql-module=dynamic --with-subdir=ldap
--with-threads --with-tls
----- s n i p -----

These are the configuration switches for compiling Berkeley DB:
----- s n i p -----
--prefix=/usr --mandir=${prefix}/share/man --localstatedir=/var
--sysconfdir=/etc --libexecdir=/usr/lib --enable-cxx 
--enable-compat185 --enable-rpc --with-uniquename 
--enable-tcl --with-tcl=/usr/lib/tcl8.4 --enable-test
----- s n i p -----

Is there any option(s) I've missed in my DB_CONFIG?
----- s n i p -----
[papadoc.root]# grep '^[a-z]' /var/lib/ldap/DB_CONFIG
set_cachesize           0 286720 1
set_lg_regionmax        286720
set_lg_bsize            500
set_lg_max              1000000
set_lg_dir              /var/lib/ldap
----- s n i p -----


I'm at a total loss here, hence the abundance of
information. I've been looking at this, code
and Berkeley DB 'documentation' for two straigt
days now (and if it where 8 hour days, I'd be
happy :) and can't see squat.

Hopfully someone will see this in the morning (Monday)
and say 'Ah, a UNIX system - I know this!' :).

But me, I'll get back to the source :(