[Home]

Summary:ASTERISK-19136: crash in odbc when using app_voicemail
Reporter:Andrew Pogrebennyk (apogrebennyk)Labels:
Date Opened:2011-12-29 04:09:55.000-0600Date Closed:2011-12-29 08:50:14.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:I am getting a crash every time trying to access the voicemail messages.
Dec 29 10:54:50 spce kernel: [83064.817358] asterisk[32183]: segfault at 407 ip 00007fb87b60e723 sp 00007fb875869260 error 6 in libmysqlclient_r.so.16.0.0[7fb87b5a3000+1cf000]

The OS is 64-bit Debian Squeeze, with mysql 5.1.60
The problematic SQL query "SELECT * FROM voicemail_users WHERE mailbox = ? AND context = ?" returns exactly 1 row without errors if executed manually.

What caught my eye is a large number of zero bytes in rowdata returned by the SQL query. Are there any known issues with app_voicemail and UTF8 in this version? If so I can try to dig this deeper, but I've already tried to recreate the voicemail_users and voicemail_spool tables as latin1 and utf8, with same effect.

SW versions and configuration are below..
Note: the asterisk version used is 1.4.24, but I was getting the same effect with latest version in the 1.4 branch.

# cat /etc/debian_version
6.0.3
# uname -a
Linux spce 2.6.32-5-amd64 #1 SMP Thu Nov 3 03:41:26 UTC 2011 x86_64 GNU/Linux
# dpkg -l | egrep "odbc|mysql"
ii  libmyodbc                                  5.1.6-1                      the MySQL ODBC driver
ii  libmysql++3                                3.0.9-1+b1                   MySQL C++ library bindings (runtime)
ii  libmysqlclient16                           5.1.60-rel13.1-413.squeeze   Percona Server database client library
ii  odbcinst                                   2.2.14p2-1                   Helper program for accessing odbc ini files
ii  odbcinst1debian2                           2.2.14p2-1                   Support library for accessing odbc ini files
ii  percona-server-common                      5.1.60-rel13.1-413.squeeze   Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii  rsyslog-mysql                              4.6.4-2                      MySQL output plugin for rsyslog
ii  unixodbc                                   2.2.14p2-1                   ODBC tools libraries

/etc/asterisk/extconfig.conf
[settings]
voicemail => odbc,asterisk,voicemail_users
voicemessages => odbc,asterisk,voicemail_spool

(gdb) bt full
#0  0x00007f1ab5455723 in list_delete (root=0x1c97f00, element=0x1c97f00) at list.c:48
No locals.
#1  0x00007f1ab582a139 in my_SQLFreeStmtExtended () from /usr/lib/odbc/libmyodbc.so
No symbol table info available.
#2  0x00007f1ab66ae350 in ?? () from /usr/lib/libodbc.so.1
No symbol table info available.
#3  0x00007f1ab3d7ce3e in realtime_odbc (database=<value optimized out>, table=<value optimized out>, ap=<value optimized out>) at res_config_odbc.c:218
       obj = 0x1c33be0
       stmt = 0x1c97820
       sql = "SELECT * FROM voicemail_users WHERE mailbox = ? AND context = ?", '\000' <repeats 960 times>
       coltitle = "stamp\000omdir\000gs", '\000' <repeats 58 times>, "0|n\257\032\177\000\000\000\000\000\000+\003\000\000\260\307n\257\032\177", '\000' <repeats 161 times>
       rowdata = "2011-12-28 11:53:34\000cd9-4df21aaef3be", '\000' <repeats 2011 times>
       op = 0x0
       newparam = 0x1a <Address 0x1a out of bounds>
       stringp = 0x0
       chunk = <value optimized out>
       collen = 5
       res = 29982464
       x = 29982464
       var = 0x1c97720
       prev = 0x1ca5fa0
       colsize = 19
       colcount = 1023
       datatype = 93
       decimaldigits = 0
       nullable = 1
       indicator = 19
       aq = {{gp_offset = 48, fp_offset = 48, overflow_arg_area = 0x7f1aaf6b13e0, reg_save_area = 0x7f1aaf6b1310}}
       cps = {sql = 0x7f1aaf6b0b40 "SELECT * FROM voicemail_users WHERE mailbox = ? AND context = ?", extra = 0x0, ap = {{gp_offset = 8, fp_offset = 48, overflow_arg_area = 0x7f1aaf6b13e0, reg_save_area = 0x7f1aaf6b1310}}}
       __PRETTY_FUNCTION__ = "realtime_odbc"
#4  0x00000000004502ac in ast_load_realtime (family=<value optimized out>) at config.c:1426
       eng = <value optimized out>
       db = "asterisk", '\000' <repeats 247 times>
       table = "voicemail_users", '\000' <repeats 240 times>
       res = <value optimized out>
       ap = {{gp_offset = 8, fp_offset = 48, overflow_arg_area = 0x7f1aaf6b13e0, reg_save_area = 0x7f1aaf6b1310}}
#5  0x00007f1aaf6df9a6 in find_user_realtime (ivm=0x7f1aaf6c1500, context=0x7f1aaf6e7c8e "default", mailbox=0x7f1aaf6c1a00 "43991002") at app_voicemail.c:773
       var = <value optimized out>
#6  find_user (ivm=0x7f1aaf6c1500, context=0x7f1aaf6e7c8e "default", mailbox=0x7f1aaf6c1a00 "43991002") at app_voicemail.c:812
       vmu = <value optimized out>
       cur = <value optimized out>
       __PRETTY_FUNCTION__ = "find_user"
#7  0x00007f1aaf6e21c1 in leave_voicemail (chan=0x1c96390, ext=<value optimized out>, options=<value optimized out>) at app_voicemail.c:3968
       txtfile = "256\000\032\177\000\000\060\bl\257\032\177\000\000P\215¶\032\177\000\000`\006l\257\032\177\000\000\022\000\000\000\000\000\000\000\306|`\261\032\177\000\000@\al\257\032\177\000\000yx\266\266\032\177\000\000\001\200\255\373\000\000\000\000@\al\257\032\177\000\000@\al\257\032\177\000\000@\al\257\032\177\000\000@\al\257\032\177\000\000\260\005l\257\032\177\000\000*\025l\257\032\177\000\000\240\006l\257\032\177\000\000]e`\261\032\177\000\000\020\al\257\032\177\000\000\371\f\000\000\000\000\000\000\016\000\000\000\000\000\000\000*\025l\257\032\177\000\000\362\223\266\266\032\177\000\000\001\200\255\373\000\000\000\000*\025l\257\032\177\000\000*\025l\257\032\177\000\000*\025l\257\032\177\000\000*\025l\257\032\177\000\000U\025l\257\032\177\000\000#\"l\257\032\177\000\000*\025l\257\032\177"...
       tmptxtfile = "\300f`\261\032\177\000\000\220\366k\257\032\177\000\000\351\003\000\000\000\000\000\000\004\236\226\267\032\177\000\000\026\001l\257\032\177\000\000p\365k\257\032\177\000\000t\025l\257\032\177\000\000`\366k\257\032\177\000\000]e`\261\032\177\000\000\320\366k\257\032\177\000\000\257\f\000\000\000\000\000\000\240\365k\257\032\177\000\000\177\026l\257\032\177\000\000\220\366k\257\032\177\000\000\004\201`\261\032\177\000\000\000\367k\257\032\177\000\000\250\v", '\000' <repeats 14 times>, "\177\026l\257\032\177\000\000\362\223\266\266\032\177\000\000\001\200\255\373\032\177\000\000\177\026l\257\032\177\000\000\177\026l\257\032\177\000\000\004\236\226\267\032\177\000\000\177\026l\257\032\177\000\000P\366k\257\032\177\000\000'\"l\257\032\177\000\000P\366k\257\032\177\000\000\260\326\302\001\000\000\000\000\020\000\000\000\000\000\000\000 \"ě\000\000\000\000��\032\177\000\000\000\000\000\000\000\000\000\000"...
       callerid = "\001\000\000\000\000\000\000\000\200\336\310\001\000\000\000\000\005", '\000' <repeats 15 times>, "\001\000\000\000\000\000\000\000\200\336\310\001", '\000' <repeats 12 times>"\330, \341\310\001\000\000\000\000\260 l\257\032\177\000\000\310 l\257\032\177\000\000\000\000\000\000\001\000\000\000\024\362l\257\032\177\000\000\320 l\257\032\177\000\000\350 l\257\032\177\000\000O\"l\257\001\000\000\000\226\360l\257\032\177\000\000\000\360\062\262\032\177\000\000\000!l\257\032\177\000\000\340\326\302\001\000\000\000\000\020\000\000\000\000\000\000\000\210\235@\000\000\000\000\000(\001\270\267\032\177\000\000\030\241@\000\000\000\000\000(\001\270\267\032\177\000\000{Or\000\000\000\000\000\377\377\377\377\000\000\000\000\360q@\000\000\000\000\000\005\000\000\000\000\000\000\000\320\023\"", '\000' <repeats 13 times>"\300, Cl\257\032\177\000\000x\326\310\001\000\000\000"
---Type <return> to continue, or q <return> to quit---
       txt = 0x0
       date = "\000\000\000\000\000\000\000\000\022\000\000\000\000\000\000\000\005s\346\000\000\000\000\000\024G@\000\000\000\000\000\260 l\257\032\177\000\000\000P@\000\000\000\000\000\030\241@\000\000\000\000\000\070?@\000\000\000\000\000\320 l\257\032\177\000\000\000P@\000\000\000\000\000\200\336\310\001", '\000' <repeats 20 times>, "(\001\270\267\032\177\000\000\024\362l\257\032\177\000\000\240\326@\000\000\000\000\000\320\330l\257\032\177\000\000\000\000\000\000\005\000\000\000a\003\000\000\001\000\000\000\240\326@\000\000\000\000\000 \327l\257\032\177\000\000\330\341\310\001\000\000\000\000\000!l\257\032\177\000\000\000\000\000\000\000\000\000\000(!l\257\032\177\000\000\200\336\310\001\000\000\000\000R\301\234\071\000\000\000\000b\250\226\267\032\177", '\000' <repeats 18 times>, "\005", '\000' <repeats 14 times>
       txtdes = 0
       res = <value optimized out>
       msgnum = <value optimized out>
       duration = 0
       ausemacro = 0
       ousemacro = 0
       dir = '\000' <repeats 2353 times>"\365, k\257\032\177\000\000\360\364k\257\032\177\000\000\t\000\000\000\000\000\000\000 \366k\257\032\177\000\000[\215¶\032\177\000\000HB\264\266\032\177\000\000\060\365k\257\032\177\000\000 \365k\257\032\177\000\000\024\000\000\000\000\000\000\000\220\366k\257\032\177\000\000\321f`\261\032\177\000\000HB\264\266\032\177\000\000\002\000\000\000\000\000\000\000\323f`\261\032\177\000\000p\365k\257\032\177\000\000`\365k\257\032\177\000\000\023\000\000\000\000\000\000\000\320\366k\257\032\177\000\000ce`\261\032\177\000\000&\"\267\266\032\177\000\000\240\365k\257\032\177\000\000\220\365k\257\032\177\000\000\f\000\000\000\000\000\000\000\000\367k\257\032\177\000\000\006\201`\261\032\177\000\000HB\264\266\032\177\000\000\000\000\000\000\000\000\000\000\006\201`\261\032\177\000\000\006\201`\261\032\177\000\000\330\364k\257\032\177\000\000]e`\261\032"...
       tmpdir = '\000' <repeats 4095 times>
       dest = '\000' <repeats 4095 times>
       fn = '\000' <repeats 4095 times>
       prefile = '\000' <repeats 4095 times>
       tempfile = '\000' <repeats 4095 times>
       ext_context = '\000' <repeats 255 times>
       fmt = "\000\320l\257\032\177\000\000\362㖷\032\177\000\000\005", '\000' <repeats 16 times>"\320, l\257\032\177\000\000\030\241@\000\000\000\000\000\360\027\001\000\000\000\000\000\220c\311\001\000\000\000\000`#l\257\032\177\000\000\360r\311\001\000\000\000"
       context = <value optimized out>
       ecodes = "#", '\000' <repeats 14 times>
       tmp = "43991002", '\000' <repeats 1015 times>
       tmpptr = 0x0
       vmu = <value optimized out>
       svm = {context = '\000' <repeats 79 times>, mailbox = "43991002", '\000' <repeats 71 times>, dialed_num = '\000' <repeats 79 times>, password = '\000' <repeats 79 times>, fullname = '\000' <repeats 79 times>,
         email = '\000' <repeats 79 times>, pager = '\000' <repeats 79 times>, serveremail = '\000' <repeats 79 times>, mailcmd = '\000' <repeats 159 times>, language = '\000' <repeats 19 times>, zonetag = '\000' <repeats 79 times>,
         callback = '\000' <repeats 79 times>, dialout = '\000' <repeats 79 times>, uniqueid = '\000' <repeats 79 times>, exit = '\000' <repeats 79 times>, attachfmt = '\000' <repeats 19 times>, flags = 3640, saydurationm = 2,
         maxmsg = 30, volgain = 0, list = {next = 0x0}}
       category = 0x0
       __PRETTY_FUNCTION__ = "leave_voicemail"
#8  0x00007f1aaf6e453f in vm_exec (chan=0x1c96390, data=<value optimized out>) at app_voicemail.c:7944
       res = <value optimized out>
       u = 0x1c972f0
       leave_options = {flags = 5, record_gain = 0 '\000'}
       flags = {flags = 5}
       deprecate_warning = 0
       opts = {0x7f1aaf6c12b0 "ARG2", 0x1ff400449b33 <Address 0x1ff400449b33 out of bounds>}
       args = {argc = 2, argv = 0x7f1aaf6c22f8, argv0 = 0x7f1aaf6c21c0 "43991002", argv1 = 0x7f1aaf6c21c9 "us"}
       __PRETTY_FUNCTION__ = "vm_exec"
#9  0x0000000000489168 in pbx_exec (c=0x1c96390, con=<value optimized out>, context=<value optimized out>, exten=<value optimized out>, priority=<value optimized out>, label=<value optimized out>, callerid=0x1c8eea0 "user1",
   action=E_SPAWN) at pbx.c:537
       saved_c_appl = 0x1c8d678 "Macro"
       saved_c_data = 0x7f1aaf6c97b0 "voicemailcaller|43991002|us"
#10 pbx_extension_helper (c=0x1c96390, con=<value optimized out>, context=<value optimized out>, exten=<value optimized out>, priority=<value optimized out>, label=<value optimized out>, callerid=0x1c8eea0 "user1", action=E_SPAWN)
   at pbx.c:1863
       e = 0x1c70cd0
       app = 0x1c8e430
       res = <value optimized out>
       q = {incstack = {0x0 <repeats 128 times>}, stacklen = 0, status = 5, swo = 0x0, data = 0x0, foundcontext = 0x1c965e0 "macro-voicemailcaller"}
       passdata = "43991002|us", '\000' <repeats 8180 times>
       matching_action = <value optimized out>
---Type <return> to continue, or q <return> to quit---
       __PRETTY_FUNCTION__ = "pbx_extension_helper"
#11 0x0000000000489533 in ast_spawn_extension (c=0x1c97f00, context=<value optimized out>, exten=<value optimized out>, priority=<value optimized out>, callerid=<value optimized out>) at pbx.c:2370
No locals.
#12 0x00007f1aafaf7770 in _macro_exec (chan=0x1c96390, data=<value optimized out>, exclusive=<value optimized out>) at app_macro.c:346
       c = 0x1c709d0
       e = <value optimized out>
       s = <value optimized out>
       rest = <value optimized out>
       fullmacro = "macro-voicemailcaller\000\000\000\000\335\306\001", '\000' <repeats 11 times>, "\001\000\000\000\000\000\000\000\000\220c\311\001\000\000\000\000\310g\311\001", '\000' <repeats 12 times>, "˗l\257\032\177\000"
       varname = "ARG2\000\177", '\000' <repeats 34 times>"\320, kH\000\000\000\000\000\060f\311\001\000\000\000\000\021\362\310\001\000\000\000\000\340e\311\001\000\000\000\000\060f\311\001\000\000\000"
       runningapp = "VoiceMail\000H\000\000\000\000\000Pwl\257\032\177\000\000\240\365\306\001\000\000\000\000\000\366\306\001\000\000\000\000\022\000\000\000\000\000\000\000\260\267l\257\032\177\000\000\240\356\310\001\000\000\000\000\002\000\000\000\000\000\000\000q\177H\000\000\000\000"
       runningdata = "${ARG1}|${ARG2}\000)=10", '\000' <repeats 1003 times>
       oldargs = {0x0 <repeats 81 times>}
       argc = <value optimized out>
       x = <value optimized out>
       res = 29821392
       oldexten = "vmu43991002", '\000' <repeats 244 times>
       oldpriority = 2
       gosub_level = 0
       pc = "2\000l\257\032\177\000\000\310g\311\001\000\000\000\000\220c\311\001\000\000\000\000\064\063H\000\000\000\000\000`vl\257\032\177\000\000\060vl\257\032\177\000\000\000\000\000\000\000\000\000\000`vl\257\032\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000"
       depthc = "1\000l\257\032\177\000\000\000\000\000"
       oldcontext = "sip_in", '\000' <repeats 73 times>
       inhangupc = <value optimized out>
       offset = <value optimized out>
       depth = 0
       maxdepth = 7
       setmacrocontext = 1
       inhangup = 0
       save_macro_exten = 0x0
       save_macro_context = 0x0
       save_macro_priority = 0x0
       save_macro_offset = 0x0
       u = 0x1c97140
       macro_store = <value optimized out>
       __PRETTY_FUNCTION__ = "_macro_exec"
#13 0x0000000000489168 in pbx_exec (c=0x1c96390, con=<value optimized out>, context=<value optimized out>, exten=<value optimized out>, priority=<value optimized out>, label=<value optimized out>, callerid=0x1c8eea0 "user1",
   action=E_SPAWN) at pbx.c:537
       saved_c_appl = 0x0
       saved_c_data = 0x0
#14 pbx_extension_helper (c=0x1c96390, con=<value optimized out>, context=<value optimized out>, exten=<value optimized out>, priority=<value optimized out>, label=<value optimized out>, callerid=0x1c8eea0 "user1", action=E_SPAWN)
   at pbx.c:1863
       e = 0x1c6f620
       app = 0x1c8d650
       res = <value optimized out>
       q = {incstack = {0x0 <repeats 128 times>}, stacklen = 0, status = 5, swo = 0x0, data = 0x0, foundcontext = 0x1c965e0 "macro-voicemailcaller"}
       passdata = "voicemailcaller|43991002|us", '\000' <repeats 8164 times>
       matching_action = <value optimized out>
       __PRETTY_FUNCTION__ = "pbx_extension_helper"
#15 0x000000000048a02d in ast_spawn_extension (c=0x1c96390) at pbx.c:2370
No locals.
#16 __ast_pbx_run (c=0x1c96390) at pbx.c:2460
       dst_exten = '\000' <repeats 88 times>, " ", '\000' <repeats 31 times>, "\030", '\000' <repeats 15 times>, "H\356\345\266\032\177", '\000' <repeats 34 times>"\320, \036\001\000\000\000\000\000\060q\311\001\000\000\000\000\030\000\000\000\000\000\000\000@\356\345\266\032\177\000\000@\356\345\266\032\177\000\000\022\177\267\266\032\177\000\000\000\000\000\000\000\000\000\000\260o\311\001", '\000' <repeats 12 times>, " A[\261\032\177\000"
---Type <return> to continue, or q <return> to quit---
       pos = <value optimized out>
       digit = <value optimized out>
       found = 1
       res = 0
       emc = 0x1c965e0 "macro-voicemailcaller"
       __PRETTY_FUNCTION__ = "__ast_pbx_run"
#17 0x000000000048b7c9 in pbx_thread (data=0x1c97f00) at pbx.c:2686
No locals.
#18 0x00000000004b797a in dummy_start (data=<value optimized out>) at utils.c:856
       __cancel_buf = {__cancel_jmp_buf = {{__cancel_jmp_buf = {29978544, -4921392283880115721, 139752621424928, 139752589018880, 139752728162368, 3, 5009952304080237047, -4921392759325445641}, __mask_was_saved = 0}}, __pad = {
           0x7f1aaf6cbf80, 0x0, 0x0, 0x0}}
       not_first_call = <value optimized out>
       ret = 0x1c97f00
#19 0x00007f1ab75478ba in start_thread () from /lib/libpthread.so.0
No symbol table info available.
#20 0x00007f1ab6bd102d in clone () from /lib/libc.so.6
No symbol table info available.
#21 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb)
(gdb) fr 3
#3  0x00007f1ab3d7ce3e in realtime_odbc (database=<value optimized out>, table=<value optimized out>, ap=<value optimized out>) at res_config_odbc.c:218
218 res_config_odbc.c: No such file or directory.
in res_config_odbc.c
(gdb) p rowdata
$1 = "2011-12-28 11:53:34\000cd9-4df21aaef3be", '\000' <repeats 2011 times>
(gdb) set print repeats 0
(gdb)  p rowdata
$2 = "2011-12-28 11:53:34\000cd9-4df21aaef3be\000\000\000\000\000\000...
Comments:By: Matt Jordan (mjordan) 2011-12-29 08:50:02.974-0600

Per the Asterisk maintenance timeline page at http://www.asterisk.org/asterisk-versions maintenance (bug) support for the 1.4 and 1.6.x branches has ended. For continued maintenance support please move to the 1.8 branch which is a long term support (LTS) branch. For more information about branch support, please see https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions.  After testing with Asterisk 1.8, if you find this problem has not been resolved, please open a new issue against Asterisk 1.8.