[OpenSIPS-Users] db_mysql segfault
Mark Carbonaro
mark at iovox.com
Tue Mar 29 01:44:50 CEST 2011
Hi,
I have an issue when when starting opensips where it immediately
segfaults in db_mysql.so. This happens with in Centos 5.5 (plus all
patches) when running VirtualBox and on a Rackspace cloud server, but
works fine on an Amazon EC2 server setup in the same way (same config
file, patches, package versions etc), which I find a little odd.
I was originally running off the opensips-1.6.4-2-tls_src.tar.gz tar
ball, but due to this issue I thought I would change to the latest
revision of the 1.6 branch in subversion, but the problem remained.
I build using the following command "make include_modules="db_mysql" all".
This config is setup just as a load balancer and does work on one
server, just segfaults on others.
Please let me know if you need any more information.
Any help would be greatly appreciated
Regards,
Mark
Here is the output from syslog when opensips starts with debug=3:
Mar 28 23:33:18 server opensips: INFO:core:init_tcp: using epoll_lt as
the TCP io watch method (auto detected)
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
NOTICE:core:main: version: opensips 1.6.4-2-notls (x86_64/linux)
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]: INFO:core:main:
using 32 Mb shared memory
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]: INFO:core:main:
using 1 Mb private memory per process
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
NOTICE:signaling:mod_init: initializing module ...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:sl:mod_init: Initializing StateLess engine
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:tm:mod_init: TM - initializing...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:rr:mod_init: rr - initializing
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:maxfwd:mod_init: initializing...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:usrloc:ul_init_locks: locks array size 512
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:registrar:mod_init: initializing...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:textops:mod_init: initializing...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:acc:mod_init: initializing...
Mar 28 23:33:18 server /usr/local/sbin/opensips[27923]:
INFO:dialog:mod_init: Dialog module - initializing
Mar 28 23:33:18 server kernel: [38083.726989] opensips[27923]: segfault
at 0 ip 00007f0c1167ee57 sp 00007fffd03f7050 error 4 in
db_mysql.so[7f0c11676000+e000]
And just in case it helps with debug=6 (just the last part):
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_connect: opening
connection: mysql://xxxx:xxxx@localhost/opensips
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_connect: connection type
is Localhost via UNIX socket
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_connect: protocol version
is 10
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_connect: server version is
5.1.56
Mar 28 23:35:39 [27944] DBG:core:db_do_init: connection 0x796340
inserted in pool as 0x796430
Mar 28 23:35:39 [27944] DBG:core:db_new_result: allocate 48 bytes for
result set at 0x796490
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns: 1 columns
returned from the query
Mar 28 23:35:39 [27944] DBG:core:db_allocate_columns: allocate 28 bytes
for result columns at 0x7964d8
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns:
RES_NAMES(0x7964e0)[0]=[table_version]
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns: use DB_INT
result type
Mar 28 23:35:39 [27944] DBG:core:db_allocate_rows: allocate 48 bytes for
result rows and values at 0x796510
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_str2val: converting INT [4]
Mar 28 23:35:39 [27944] DBG:core:db_free_columns: freeing result columns
at 0x7964d8
Mar 28 23:35:39 [27944] DBG:core:db_free_rows: freeing 1 rows
Mar 28 23:35:39 [27944] DBG:core:db_free_row: freeing row values at 0x796520
Mar 28 23:35:39 [27944] DBG:core:db_free_rows: freeing rows at 0x796510
Mar 28 23:35:39 [27944] DBG:core:db_free_result: freeing result set at
0x796490
Mar 28 23:35:39 [27944] DBG:core:db_new_result: allocate 48 bytes for
result set at 0x796490
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns: 21 columns
returned from the query
Mar 28 23:35:39 [27944] DBG:core:db_allocate_columns: allocate 588 bytes
for result columns at 0x79e448
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns:
RES_NAMES(0x79e4f0)[0]=[hash_entry]
Mar 28 23:35:39 [27944] DBG:db_mysql:db_mysql_get_columns: use DB_INT
result type
Segmentation fault (core dumped)
Finally here is my config down to the route section, this is the same
config that works on the EC2 server.
debug=3
log_stderror=no
log_facility=LOG_LOCAL0
fork=yes
children=4
port=5060
mpath="/usr/local/lib64/opensips/modules/"
loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "acc.so"
loadmodule "dialog.so"
loadmodule "load_balancer.so"
loadmodule "avpops.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 0)
modparam("usrloc", "db_mode", 0)
modparam("uri", "use_uri_table", 0)
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://opensips:xxx@localhost/opensips")
modparam("load_balancer",
"db_url","mysql://opensips:xxx@127.0.0.1/opensips")
modparam("avpops","db_url","mysql://opensips:xxx@127.0.0.1/opensips")
More information about the Users
mailing list