[SR-Users] segfault problem with unixodbc module

Lucas Wals Ochoa walslucas at gmail.com
Thu Mar 5 15:17:10 CET 2015


Thanks for the reply. Here is the new output with the debugging symbols.

First, the simple backtrace:

Core was generated by `/usr/sbin/kamailio -P /var/run/kamailio.pid -m 64 -M
8 -u kamailio -g kamailio'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fc3d554df7e in get_ctype (parser=parser at entry=0x7fff89556470)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:307
307        parser->bytes_at_pos=
parser->query->cs->cset->ctype(parser->query->cs,
(gdb) backtrace
#0  0x00007fc3d554df7e in get_ctype (parser=parser at entry=0x7fff89556470)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:307
#1  0x00007fc3d554dfac in init_parser (parser=parser at entry=0x7fff89556470,
pq=pq at entry=0xececf0)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:236
#2  0x00007fc3d554ec41 in parse (pq=pq at entry=0xececf0) at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:824
#3  0x00007fc3d5553484 in prepare (stmt=stmt at entry=0xecd200,
    query=0xeae0b0 "select table_version from version where
table_name='dispatcher'", query_length=63)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/my_stmt.c:369
#4  0x00007fc3d554ece8 in my_SQLPrepare (hstmt=hstmt at entry=0xecd200,
szSqlStr=<optimized out>, cbSqlStr=<optimized out>,
    dupe=<optimized out>) at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:103
#5  0x00007fc3d554ed7e in MySQLPrepare (hstmt=hstmt at entry=0xecd200,
query=<optimized out>, len=<optimized out>,
    dupe=dupe at entry=1 '\001') at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:74
#6  0x00007fc3d5559e9c in SQLPrepareWImpl (hstmt=hstmt at entry=0xecd200,
str=<optimized out>, str_len=63)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:804
#7  0x00007fc3d5559eb9 in SQLExecDirectW (hstmt=0xecd200, str=<optimized
out>, str_len=<optimized out>)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:332
#8  0x00007fc3de43b05f in SQLExecDirect (statement_handle=0xec33f0,
    statement_text=0xe32810 "select table_version from version where
table_name='dispatcher'", text_length=63)
    at SQLExecDirect.c:378
#9  0x00007fc3de695302 in db_unixodbc_submit_query (_h=0x7fc3de934680,
_s=0x7fc3de4242a0 <sql_str>) at dbase.c:129
#10 0x00007fc3de21522e in db_do_submit_query (_h=0x7fc3de934680,
_query=0x7fc3de4242a0 <sql_str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>) at db_query.c:55
#11 0x00007fc3de215cf7 in db_do_query_internal (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990,
    _c=0x7fff895569b0, _n=1, _nc=1, _o=0x0, _r=0x7fff89556988,
val2str=0x7fc3de69afca <db_unixodbc_val2str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>,
store_result=0x7fc3de695b21 <db_unixodbc_store_result>, _l=0)
    at db_query.c:131
#12 0x00007fc3de21661a in db_do_query (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990, _c=0x7fff895569b0,
    _n=1, _nc=1, _o=0x0, _r=0x7fff89556988, val2str=0x7fc3de69afca
<db_unixodbc_val2str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>,
store_result=0x7fc3de695b21 <db_unixodbc_store_result>)
    at db_query.c:156
#13 0x00007fc3de696d90 in db_unixodbc_query (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990,
---Type <return> to continue, or q <return> to quit---
    _c=0x7fff895569b0, _n=1, _nc=1, _o=0x0, _r=0x7fff89556988) at
dbase.c:253
#14 0x00007fc3de20ce90 in db_table_version (dbf=0x7fc3da42eea0 <ds_dbf>,
connection=0x7fc3de934680,
    table=0x7fc3da42e570 <ds_table_name>) at db.c:400
#15 0x00007fc3da209693 in init_ds_db () at dispatch.c:686
#16 0x00007fc3da1f4f1a in mod_init () at dispatcher.c:317
#17 0x0000000000520e8d in init_mod (m=0x7fc3de8d9fe0) at sr_module.c:966
#18 0x0000000000520be8 in init_mod (m=0x7fc3de8da5c0) at sr_module.c:963
#19 0x000000000052119a in init_modules () at sr_module.c:995
#20 0x0000000000517951 in main (argc=11, argv=0x7fff89556f08) at main.c:2519


And next, the full backtrace:

(gdb) bt full
#0  0x00007fc3d554df7e in get_ctype (parser=parser at entry=0x7fff89556470)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:307
No locals.
#1  0x00007fc3d554dfac in init_parser (parser=parser at entry=0x7fff89556470,
pq=pq at entry=0xececf0)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:236
No locals.
#2  0x00007fc3d554ec41 in parse (pq=pq at entry=0xececf0) at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/parse.c:824
        parser = {pos = 0xeae0b0 "select table_version from version where
table_name='dispatcher'",
          bytes_at_pos = -716353152, ctype = 32707, quote = 0x0, query =
0xececf0, syntax = 0xececf0}
#3  0x00007fc3d5553484 in prepare (stmt=stmt at entry=0xecd200,
    query=0xeae0b0 "select table_version from version where
table_name='dispatcher'", query_length=63)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/my_stmt.c:369
No locals.
#4  0x00007fc3d554ece8 in my_SQLPrepare (hstmt=hstmt at entry=0xecd200,
szSqlStr=<optimized out>, cbSqlStr=<optimized out>,
    dupe=<optimized out>) at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:103
        stmt = 0xecd200
#5  0x00007fc3d554ed7e in MySQLPrepare (hstmt=hstmt at entry=0xecd200,
query=<optimized out>, len=<optimized out>,
    dupe=dupe at entry=1 '\001') at
/usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/prepare.c:74
        stmt = 0xecd200
#6  0x00007fc3d5559e9c in SQLPrepareWImpl (hstmt=hstmt at entry=0xecd200,
str=<optimized out>, str_len=63)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:804
        stmt = 0xecd200
        errors = 0
        conv = <optimized out>
#7  0x00007fc3d5559eb9 in SQLExecDirectW (hstmt=0xecd200, str=<optimized
out>, str_len=<optimized out>)
    at /usr/src/debug/mysql-connector-odbc-5.2.5-src/driver/unicode.c:332
        error = <optimized out>
#8  0x00007fc3de43b05f in SQLExecDirect (statement_handle=0xec33f0,
    statement_text=0xe32810 "select table_version from version where
table_name='dispatcher'", text_length=63)
    at SQLExecDirect.c:378
        s1 = 0xec3ef0
---Type <return> to continue, or q <return> to quit---
        statement = 0xec33f0
        ret = <optimized out>
        s1 = <optimized out>
        s2 =
"\210eU\211\377\177\000\000:\274\022\337\303\177\000\000\320\033\351\000\000\000\000\000\320\033\351\000\000\000\000\000\230I\223\336\303\177\000\000g\270F\336\303\177\000\000\320\033\351\000\000\000\000\000\230I\223\336\303\177\000\000\340\304h\336\303\177\000\000\022\303B\336\303\177\000\000\000\000\000\000\000\000\000\000\060U\355\000\000\000\000\000\016(\344",
'\000' <repeats 61 times>,
"\202-/7\000\000\000\000\200gU\211\377\177\000\000
TA\000\000\000\000\000\000oU\211\377\177\000\000PgU\211\377\177\000\000"...
#9  0x00007fc3de695302 in db_unixodbc_submit_query (_h=0x7fc3de934680,
_s=0x7fc3de4242a0 <sql_str>) at dbase.c:129
        ret = 0
        sqlstate = "\020\027\351\000\000\000"
        __FUNCTION__ = "db_unixodbc_submit_query"
#10 0x00007fc3de21522e in db_do_submit_query (_h=0x7fc3de934680,
_query=0x7fc3de4242a0 <sql_str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>) at db_query.c:55
        ret = -1990891600
        ms = 0
        __FUNCTION__ = "db_do_submit_query"
#11 0x00007fc3de215cf7 in db_do_query_internal (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990,
    _c=0x7fff895569b0, _n=1, _nc=1, _o=0x0, _r=0x7fff89556988,
val2str=0x7fc3de69afca <db_unixodbc_val2str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>,
store_result=0x7fc3de695b21 <db_unixodbc_store_result>, _l=0)
    at db_query.c:131
        off = 63
        ret = 23
        __FUNCTION__ = "db_do_query_internal"
#12 0x00007fc3de21661a in db_do_query (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990, _c=0x7fff895569b0,
    _n=1, _nc=1, _o=0x0, _r=0x7fff89556988, val2str=0x7fc3de69afca
<db_unixodbc_val2str>,
    submit_query=0x7fc3de694bcc <db_unixodbc_submit_query>,
store_result=0x7fc3de695b21 <db_unixodbc_store_result>)
    at db_query.c:156
No locals.
#13 0x00007fc3de696d90 in db_unixodbc_query (_h=0x7fc3de934680,
_k=0x7fff895569c0, _op=0x0, _v=0x7fff89556990,
    _c=0x7fff895569b0, _n=1, _nc=1, _o=0x0, _r=0x7fff89556988) at
dbase.c:253
---Type <return> to continue, or q <return> to quit---
No locals.
#14 0x00007fc3de20ce90 in db_table_version (dbf=0x7fc3da42eea0 <ds_dbf>,
connection=0x7fc3de934680,
    table=0x7fc3da42e570 <ds_table_name>) at db.c:400
        key = {0x7fff89556970}
        col = {0x7fff89556960}
        val = {{type = DB1_STR, nul = 0, free = -1990889728, val = {int_val
= -561128392, ll_val = 140479229189176,
              double_val = 6.9405961096630734e-310,
time_val = 140479229189176, string_val = 0x7fc3de8ddc38 "dispatcher",
              str_val = {s = 0x7fc3de8ddc38 "dispatcher", len = 10},
blob_val = {s = 0x7fc3de8ddc38 "dispatcher",
                len = 10}, bitmap_val = 3733838904}}}
        res = 0x0
        ver = 0x0
        version = 0x9c9500 <version_table>
        tmp1 = {s = 0x7fc3de21f085 "table_name", len = 10}
        tmp2 = {s = 0x7fc3de21f090 "table_version", len = 13}
        ret = 32707
        __FUNCTION__ = "db_table_version"
#15 0x00007fc3da209693 in init_ds_db () at dispatch.c:686
        ret = 0
        __FUNCTION__ = "init_ds_db"
#16 0x00007fc3da1f4f1a in mod_init () at dispatcher.c:317
        avp_spec = {type = 2304076624, getf = 0x7fc3da432989
<mod_init+2289>, setf = 0x0, pvp = {pvn = {type = -542456480,
              nfree = 0x7fff89556b40, u = {isname = {type = -561146352,
name = {n = 1865003490, s = {
                      s = 0x6f29b1e2 <Address 0x6f29b1e2 out of bounds>,
len = 4247429}, re = 0x6f29b1e2}},
                dname = 0x7fc3de8d9610}}, pvi = {type = -630909564, u =
{ival = 7466096, dval = 0x71ec70}}},
          trans = 0x415420 <_start>}
        __FUNCTION__ = "mod_init"
#17 0x0000000000520e8d in init_mod (m=0x7fc3de8d9fe0) at sr_module.c:966
        __FUNCTION__ = "init_mod"
#18 0x0000000000520be8 in init_mod (m=0x7fc3de8da5c0) at sr_module.c:963
        __FUNCTION__ = "init_mod"
#19 0x000000000052119a in init_modules () at sr_module.c:995
---Type <return> to continue, or q <return> to quit---
        t = 0x372f2d82
        i = 200
        __FUNCTION__ = "init_modules"
#20 0x0000000000517951 in main (argc=11, argv=0x7fff89556f08) at main.c:2519
        cfg_stream = 0xe2c010
        c = -1
        r = 11538501
        tmp = 0x7fff89557f70 ""
        tmp_len = 0
        port = 0
        proto = 32767
        options = 0x71cbe8
":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
        ret = -1
        seed = 2941590855
        rfd = 4
        debug_save = 0
        debug_flag = 0
        dont_fork_cnt = 0
        n_lst = 0xf63d4e2e
        p = 0x7fc3dfaa2000 ""
        __FUNCTION__ = "main"

2015-03-05 5:27 GMT-03:00 Daniel-Constantin Mierla <miconda at gmail.com>:

>  Hello,
>
> can you install the debugging symbols to get the lines that trigger the
> crash? Resend the gdb backtrace to investigate it. Also, the output for 'bt
> full' will be useful to see the values of variables.
>
> Cheers,
> Daniel
>
>
> On 04/03/15 17:54, Lucas Wals Ochoa wrote:
>
>    Hello, this is the first time I send a question here, hope my english
> is good enough to explain my problem.
>
>  I have a Kamailio 4.1.8+RTPProxy setup working, but recently I saw RTP
> Engine proxy, so I decided to give a try. I installed the latest kamailio
> stable version (4.2.3) and adapt the configuration I have(that uses a
> MariaDB database), to try the rtpengine module, but I couldn't even start
> kamailio process, cause I received a segfault problem at unixodbc module.
> The version of unixodbc that I installed is 2.3.1-10
>
>  That was the first time I encounter this error. I thought that maybe the
> database I have created with the version 4.1.8 wasn't compatible, so I
> decided to create a new database, but the problem persisted.
>
>  So I'm here to know if someone know something about this, or have had a
> similar problem.
>  I attached the system log for Kamailio, and a backtrace I made using
> "gdb" with the corefile that Kamailio creates when it crash.
>
>  Log:
> Mar  4 12:46:35 localhost systemd: Starting SYSV: Kamailio is a fast,
> reliable and flexible SIP Server....
> Mar  4 12:46:35 localhost kamailio: WARNING: <core> [socket_info.c:1392]:
> fix_hostname(): could not rev. resolve 10.0.0.70
> Mar  4 12:46:35 localhost /usr/sbin/kamailio[2369]: WARNING: tm
> [tm.c:845]: mod_init(): WARNING: mod_init: reparse_on_dns_failover is
> enabled on a multihomed host -- check the readme of tm module!
> Mar  4 12:46:35 localhost /usr/sbin/kamailio[2369]: INFO: rr
> [../outbound/api.h:54]: ob_load_api(): Failed to import bind_ob
> Mar  4 12:46:35 localhost /usr/sbin/kamailio[2369]: INFO: rr
> [rr_mod.c:160]: mod_init(): outbound module not available
> Mar  4 12:46:35 localhost /usr/sbin/kamailio[2369]: INFO: usrloc
> [hslot.c:53]: ul_init_locks(): locks array size 1024
> Mar  4 12:46:35 localhost /usr/sbin/kamailio[2369]: INFO: auth
> [auth_mod.c:350]: mod_init(): auth: qop set, but nonce-count (nc_enabled)
> support disabled
> Mar  4 12:46:35 localhost kernel: kamailio[2369]: segfault at 10070 ip
> 00007fc3d554df7e sp 00007fff89556450 error 4 in
> libmyodbc5w.so[7fc3d5527000+47000]
> Mar  4 12:46:35 localhost kamailio: ERROR: <core> [daemonize.c:315]:
> daemonize(): Main process exited before writing to pipe
> Mar  4 12:46:35 localhost kamailio: Starting kamailio:
> Mar  4 12:46:35 localhost systemd: kamailio.service: control process
> exited, code=exited status=1
> Mar  4 12:46:35 localhost systemd: Failed to start SYSV: Kamailio is a
> fast, reliable and flexible SIP Server..
> Mar  4 12:46:35 localhost systemd: Unit kamailio.service entered failed
> state.
>
>  Backtrace of gdb:
>  Using host libthread_db library "/lib64/libthread_db.so.1".
> Core was generated by `/usr/sbin/kamailio -P /var/run/kamailio.pid -m 64
> -M 8 -u kamailio -g kamailio'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x00007fc3d554df7e in get_ctype () from /usr/lib64/libmyodbc5.so
> Missing separate debuginfos, use: debuginfo-install
> kamailio-4.2.3-3.1.x86_64
> (gdb) backtrace
> #0  0x00007fc3d554df7e in get_ctype () from /usr/lib64/libmyodbc5.so
> #1  0x00007fc3d554dfac in init_parser () from /usr/lib64/libmyodbc5.so
> #2  0x00007fc3d554ec41 in parse () from /usr/lib64/libmyodbc5.so
> #3  0x00007fc3d5553484 in prepare () from /usr/lib64/libmyodbc5.so
> #4  0x00007fc3d5559e9c in SQLPrepareWImpl () from /usr/lib64/libmyodbc5.so
> #5  0x00007fc3d5559eb9 in SQLExecDirectW () from /usr/lib64/libmyodbc5.so
> #6  0x00007fc3de43b05f in SQLExecDirect () from /lib64/libodbc.so.2
> #7  0x00007fc3de695302 in db_unixodbc_submit_query () from
> /usr/lib64/kamailio/modules/db_unixodbc.so
> #8  0x00007fc3de21522e in db_do_submit_query () from
> /usr/lib64/kamailio/libsrdb1.so.1
> #9  0x00007fc3de215cf7 in db_do_query_internal () from
> /usr/lib64/kamailio/libsrdb1.so.1
> #10 0x00007fc3de21661a in db_do_query () from
> /usr/lib64/kamailio/libsrdb1.so.1
> #11 0x00007fc3de696d90 in db_unixodbc_query () from
> /usr/lib64/kamailio/modules/db_unixodbc.so
> #12 0x00007fc3de20ce90 in db_table_version () from
> /usr/lib64/kamailio/libsrdb1.so.1
> #13 0x00007fc3da209693 in init_ds_db () from
> /usr/lib64/kamailio/modules/dispatcher.so
> #14 0x00007fc3da1f4f1a in mod_init () from
> /usr/lib64/kamailio/modules/dispatcher.so
> #15 0x0000000000520e8d in init_mod ()
> #16 0x0000000000520be8 in init_mod ()
> #17 0x000000000052119a in init_modules ()
> #18 0x0000000000517951 in main ()
>
>  Hope someone can help me. Thanks in advance.
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio World Conference, May 27-29, 2015
> Berlin, Germany - http://www.kamailioworld.com
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150305/98bf743c/attachment.html>


More information about the sr-users mailing list