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

Re: (ITS#3609) ch_malloc of 8388608 bytes failed



Thanks for your quick response.  All of the following data is for slapd compiled 
with db-4.2.52.NC and the original four patches:

"top" shows the following for memory:

Before running slapd:

Mem: 499M Active, 297M Inact, 120M Wired, 53M Cache, 112M Buf, 36M Free
Swap: 1024M Total, 122M Used, 902M Free, 11% Inuse

While running Slapd:

Mem: 496M Active, 297M Inact, 119M Wired, 53M Cache, 112M Buf, 39M Free
Swap: 1024M Total, 122M Used, 902M Free, 11% Inuse

After stopping slapd:

Mem: 497M Active, 298M Inact, 119M Wired, 53M Cache, 112M Buf, 37M Free
Swap: 1024M Total, 122M Used, 902M Free, 11% Inuse

As I'm sure you are aware, the values jump around quite a bit, so the above must 
be taken with a grain of salt.

The line I use to invoke slapd contains an explicit -f switch, so I'm sure to 
use the slapd.conf with "threads 4" in it.

I ran slapd under gdb until it crashed again (on an 8MB allocation):
----------------------------------------------
bdb_dn2entry("cn=agnes & alvin 
freund+mail=afreund@citlink.net,o=sudleyplace,ou=addressbooks,dc=qualitas,dc=com")
search_candidates: base="cn=agnes & alvin 
freund+mail=afreund@citlink.net,o=sudleyplace,ou=addressbooks,dc=qualitas,dc=com" 
(0x00000013) scope=1
ch_malloc of 8388608 bytes failed
assertion "0" failed: file "ch_malloc.c", line 62

Program received signal SIGABRT, Aborted.
0x282e9ce4 in kill () from /usr/lib/libc_r.so.4
----------------------------------------------
and then ran

(gdb) info threads
   5 process 68867, thread 5  0x28300034 in _thread_kern_sched () from 
/usr/lib/libc_r.so.4
   4 process 68867, thread 4  0x28300034 in _thread_kern_sched () from 
/usr/lib/libc_r.so.4
   3 process 68867, thread 3  0x28300034 in _thread_kern_sched () from 
/usr/lib/libc_r.so.4
   2 process 68867, thread 2  0x28300034 in _thread_kern_sched () from 
/usr/lib/libc_r.so.4
* 1 process 68867, thread 1  0x282e9ce4 in kill () from /usr/lib/libc_r.so.4

I'll get back to you on the db-4.3.27 version of slapd.  I deleted the 
slapd.core file, so I'll need to recreate it.

FWIW:  I ran the commands you asked for on the db-4.3.27 version on the above 
db-4.2.52.NC version:

(gdb)    thread 1
[Switching to thread 1 (process 68867, thread 1)]
#0  0x282e9ce4 in kill () from /usr/lib/libc_r.so.4
(gdb)    frame 4
    print *bdb
#4  0x809970f in search_stack (op=0x936b000) at search.c:1562
1562                    ret = ch_malloc( bdb->bi_search_stack_depth * 
BDB_IDL_UM_SIZE
(gdb)    print *bdb
$1 = {bi_dbenv = 0x810ec00, bi_dbenv_home = 0x8160a80 
"/usr/home/qualitas/usr/local/var/openldap-data",
   bi_dbenv_xflags = 0, bi_dbenv_mode = 384, bi_ndatabases = 3, bi_databases = 
0x8164600, bi_database_mutex = 0x8160ac0,
   bi_db_opflags = 0, bi_defaultmask = 0, bi_cache = {c_maxsize = 1000, 
c_cursize = 400, c_eiused = 400, c_dntree = {
       bei_parent = 0x0, bei_id = 0, bei_lockpad = 0 '\000', bei_state = 0, 
bei_nrdn = {bv_len = 0, bv_val = 0x0},
       bei_e = 0x0, bei_kids = 0x816b2e0, bei_kids_mutex = 0x8160c80, 
bei_lrunext = 0x0, bei_lruprev = 0x0},
     c_eifree = 0x0, c_idtree = 0x92fe3e0, c_lruhead = 0x857a500, c_lrutail = 
0x935d940, c_rwlock = 0x81650a0,
     lru_mutex = 0x8160c40, c_locker = 90}, bi_attrs = 0x8161b10, 
bi_search_stack = 0x0, bi_search_stack_depth = 16,
   bi_txn_cp = 0, bi_txn_cp_min = 0, bi_txn_cp_kbyte = 0, bi_lock_detect = 1, 
bi_shm_key = 0, bi_lastid = 400,
   bi_lastid_mutex = 0x8160b00, bi_psearch_list = {lh_first = 0x0}, 
bi_pslist_rwlock = 0x8165080, bi_session_list = {
     lh_first = 0x0}, bi_idl_cache_max_size = 0, bi_idl_cache_size = 0, 
bi_idl_tree = 0x0, bi_idl_lru_head = 0x0,
   bi_idl_lru_tail = 0x0, bi_idl_tree_rwlock = 0x0, bi_idl_tree_lrulock = 0x0}
----------------------------------------------------------------------
(gdb) thread 1
[Switching to thread 1 (process 68867, thread 1)]
#4  0x809970f in search_stack (op=0x936b000) at search.c:1562
1562                    ret = ch_malloc( bdb->bi_search_stack_depth * 
BDB_IDL_UM_SIZE
(gdb) frame 5
#5  0x80998c3 in search_candidates (stackop=0x936b000, op=0x936b000, 
rs=0x9773db8, e=0x96b3ab4, locker=97, ids=0x96f3adc,
     scopes=0x96b3adc) at search.c:1655
1655                    stack = search_stack( stackop );
(gdb) print *bdb
$2 = {bi_dbenv = 0x810ec00, bi_dbenv_home = 0x8160a80 
"/usr/home/qualitas/usr/local/var/openldap-data",
   bi_dbenv_xflags = 0, bi_dbenv_mode = 384, bi_ndatabases = 3, bi_databases = 
0x8164600, bi_database_mutex = 0x8160ac0,
   bi_db_opflags = 0, bi_defaultmask = 0, bi_cache = {c_maxsize = 1000, 
c_cursize = 400, c_eiused = 400, c_dntree = {
       bei_parent = 0x0, bei_id = 0, bei_lockpad = 0 '\000', bei_state = 0, 
bei_nrdn = {bv_len = 0, bv_val = 0x0},
       bei_e = 0x0, bei_kids = 0x816b2e0, bei_kids_mutex = 0x8160c80, 
bei_lrunext = 0x0, bei_lruprev = 0x0},
     c_eifree = 0x0, c_idtree = 0x92fe3e0, c_lruhead = 0x857a500, c_lrutail = 
0x935d940, c_rwlock = 0x81650a0,
     lru_mutex = 0x8160c40, c_locker = 90}, bi_attrs = 0x8161b10, 
bi_search_stack = 0x0, bi_search_stack_depth = 16,
   bi_txn_cp = 0, bi_txn_cp_min = 0, bi_txn_cp_kbyte = 0, bi_lock_detect = 1, 
bi_shm_key = 0, bi_lastid = 400,
   bi_lastid_mutex = 0x8160b00, bi_psearch_list = {lh_first = 0x0}, 
bi_pslist_rwlock = 0x8165080, bi_session_list = {
     lh_first = 0x0}, bi_idl_cache_max_size = 0, bi_idl_cache_size = 0, 
bi_idl_tree = 0x0, bi_idl_lru_head = 0x0,
   bi_idl_lru_tail = 0x0, bi_idl_tree_rwlock = 0x0, bi_idl_tree_lrulock = 0x0}
----------------------------------------------------------------------------
(gdb) thread 1
[Switching to thread 1 (process 68867, thread 1)]
#5  0x80998c3 in search_candidates (stackop=0x936b000, op=0x936b000, 
rs=0x9773db8, e=0x96b3ab4, locker=97, ids=0x96f3adc,
     scopes=0x96b3adc) at search.c:1655
1655                    stack = search_stack( stackop );
(gdb) frame 6
#6  0x8097e4f in bdb_do_search (op=0x936b000, rs=0x9773db8, sop=0x936b000, 
ps_e=0x0, ps_type=0) at search.c:746
746                     rs->sr_err = search_candidates( op, sop, rs, &base,
(gdb) print *bdb
$3 = {bi_dbenv = 0x810ec00, bi_dbenv_home = 0x8160a80 
"/usr/home/qualitas/usr/local/var/openldap-data",
   bi_dbenv_xflags = 0, bi_dbenv_mode = 384, bi_ndatabases = 3, bi_databases = 
0x8164600, bi_database_mutex = 0x8160ac0,
   bi_db_opflags = 0, bi_defaultmask = 0, bi_cache = {c_maxsize = 1000, 
c_cursize = 400, c_eiused = 400, c_dntree = {
       bei_parent = 0x0, bei_id = 0, bei_lockpad = 0 '\000', bei_state = 0, 
bei_nrdn = {bv_len = 0, bv_val = 0x0},
       bei_e = 0x0, bei_kids = 0x816b2e0, bei_kids_mutex = 0x8160c80, 
bei_lrunext = 0x0, bei_lruprev = 0x0},
     c_eifree = 0x0, c_idtree = 0x92fe3e0, c_lruhead = 0x857a500, c_lrutail = 
0x935d940, c_rwlock = 0x81650a0,
     lru_mutex = 0x8160c40, c_locker = 90}, bi_attrs = 0x8161b10, 
bi_search_stack = 0x0, bi_search_stack_depth = 16,
   bi_txn_cp = 0, bi_txn_cp_min = 0, bi_txn_cp_kbyte = 0, bi_lock_detect = 1, 
bi_shm_key = 0, bi_lastid = 400,
   bi_lastid_mutex = 0x8160b00, bi_psearch_list = {lh_first = 0x0}, 
bi_pslist_rwlock = 0x8165080, bi_session_list = {
     lh_first = 0x0}, bi_idl_cache_max_size = 0, bi_idl_cache_size = 0, 
bi_idl_tree = 0x0, bi_idl_lru_head = 0x0,
   bi_idl_lru_tail = 0x0, bi_idl_tree_rwlock = 0x0, bi_idl_tree_lrulock = 0x0}
-----------------------------------------------------------------------------

On 4/17/2005 1:22 PM, Howard Chu wrote:
> You can get the BerkeleyDB patch here
> http://www.openldap.org/devel/cvsweb.cgi/build/BerkeleyDB42.patch
> 
> You will also need a patch in back-bdb/cache.c, get the diff from 1.92 
> to 1.94 of that file.
> 
> But for the moment I wouldn't bother with either of those patches as 
> they have no bearing on the amount of memory being used.
> 
> By the way, try "info threads" in gdb as well, that would give us a 
> better idea of what other threads are active.
> Also, how much memory total is on the system? What does "top" show for 
> memory usage? It seems to me that there is no software issue here, 
> you're just trying to run in an environment with inadequate resources.

-- 
_______________________________________________________________
Bob Smith - bsmith@sudleyplace.com - http://www.sudleyplace.com
a.k.a.      bsmith@qualitas.com    - http://www.qualitas.com