<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head><body style="">
<div>
<div>
<div>
Hello,
</div>
<div>
</div>
<div>
I have big troubles using the db_berkeley module in Kamailio version 4.2.2 in combination with presence related modules like presence, presence_xml or rls.
</div>
<div>
</div>
<div>
Kamailio cannot startup and is "hanging" in the OS (RHEL 6.4 with kernel 2.6.32-358.el6.i686). In the debug modus I can see following log output:
</div>
<div>
</div>
<div>
[...] kamailio[18400]: INFO: cfgutils [cfgutils.c:784]: mod_init(): no hash_file given, disable hash functionality
<br/>[...] kamailio[18400]: INFO: db_berkeley [km_db_berkeley.c:212]: bdb_init(): using database at: /var/lib/berkeley_kamailio42.db
<br/>[...] kamailio: ERROR: <core> [daemonize.c:315]: daemonize(): Main process exited before writing to pipe
</div>
<div>
During startup the OS is creating a core dump. Backtrace analysation of these dumps brought following information (gdb output):
</div>
<div>
</div>
<div>
(variant 1):
</div>
<div>
Program terminated with signal 11, Segmentation fault.
<br/>#0 0x00ee965b in ?? () from /lib/libdb-4.7.so(gdb) bt
<br/>#0 0x00ee965b in ?? () from /lib/libdb-4.7.so
<br/>#1 0x00ee9bbc in ?? () from /lib/libdb-4.7.so
<br/>#2 0x00eea2a0 in __dbc_get_pp () from /lib/libdb-4.7.so
<br/>#3 0x00269a07 in bdb_delete (_h=0xb6f94484, _k=0x0, _op=0x0, _v=0x0, _n=0) at km_db_berkeley.c:827
<br/>#4 0x08a5cf7f in restore_db_subs () at subscribe.c:2475
<br/>#5 0x08a05193 in mod_init () at presence.c:344
<br/>#6 0x081bb23b in init_mod (m=0xb6f5c918) at sr_module.c:966
<br/>#7 0x081bafd0 in init_mod (m=0xb6f5cbe4) at sr_module.c:963
<br/>#8 0x081bb513 in init_modules () at sr_module.c:995
<br/>#9 0x080e4c77 in main (argc=3, argv=0xbf922c04) at main.c:2502
</div>
<div>
OR (variant 2):
</div>
<div>
(gdb) bt
<br/>#0 0x00000000 in ?? ()
<br/>#1 0x00eef343 in __db_prdbt () from /lib/libdb-4.8.so
<br/>#2 0x00d408d9 in km_bdblib_create_dbenv (_dbenv=0xb7050b7c, _home=0xbf9f2784 "/var/lib/berkeley_kamailio42.db") at km_bdb_lib.c:320
<br/>#3 0x00d41cd9 in km_bdblib_get_db (_s=0xbf9f2b7c) at km_bdb_lib.c:409
<br/>#4 0x00d56302 in bdb_init (_sqlurl=0x7aaeb10) at km_db_berkeley.c:213
<br/>#5 0x07a35528 in mod_init () at presence.c:312
<br/>#6 0x081bb23b in init_mod (m=0xb6ff4a8c) at sr_module.c:966
<br/>#7 0x081bafd0 in init_mod (m=0xb6ff4d58) at sr_module.c:963
<br/>#8 0x081bafd0 in init_mod (m=0xb6ff4f6c) at sr_module.c:963
<br/>#9 0x081bafd0 in init_mod (m=0xb6ff5118) at sr_module.c:963
<br/>#10 0x081bafd0 in init_mod (m=0xb6ff5314) at sr_module.c:963
<br/>#11 0x081bafd0 in init_mod (m=0xb6ff5550) at sr_module.c:963
<br/>#12 0x081bafd0 in init_mod (m=0xb6ff5848) at sr_module.c:963
<br/>#13 0x081bafd0 in init_mod (m=0xb6ff5b8c) at sr_module.c:963
<br/>#14 0x081bafd0 in init_mod (m=0xb6ff5dac) at sr_module.c:963
<br/>#15 0x081bafd0 in init_mod (m=0xb6ff5f9c) at sr_module.c:963
<br/>#16 0x081bafd0 in init_mod (m=0xb6ff62b0) at sr_module.c:963
<br/>#17 0x081bafd0 in init_mod (m=0xb6ff674c) at sr_module.c:963
<br/>#18 0x081bafd0 in init_mod (m=0xb6ff697c) at sr_module.c:963
<br/>#19 0x081bb513 in init_modules () at sr_module.c:995
<br/>#20 0x080e4c77 in main (argc=3, argv=0xbf9f37e4) at main.c:2502
</div>
<div>
</div>
<div>
However, it seems to be caused by the presence.c file of the presence module all time. When I comment out any presence related module and use the usrloc module (e.g.) only, it is working fine with berkeley DB, too. The configuration itself is working fine with DB_ENGINE MySQL instead of Berkeley. I´ve also tested different versions of Berkeley DB (4.7 (originally delivered with the OS), 4.8, 5.3 and 6.1). The result is always the same....
</div>
<div>
</div>
<div>
Could anybody take a look at this dump output? What is causing these dumps? Is there any bug within the presence modules? I cannot move to another DB so easy, as it should be used (in future) in embedded environment.....
</div>
<div>
</div>
<div>
Thanks in advance!
</div>
<div>
</div>
<div>
br
</div>
<div>
Klaus
</div>
</div>
</div>
</body></html>