[Asterisk-Users] Segfault when using res_config_odbc on x86_64

Manuel Wenger manuel.wenger at ticinocom.com
Tue Feb 22 01:55:54 MST 2005


I'm trying to move our asterisk setup from an i686 server to an x86_64
(Dual AMD Opteron) server. 

Everything has been manually compiled: MySQL 4.1.10, MyODBC 3.51.11,
unixODBC 2.2.10 (because I couldn't find any usable RPMs). And obviously
Asterisk, where I'm using the STABLE release CVS-Nv1-0-5-02/21/05. The
OS is Redhat Enterprise ES 4.0, kernel 2.6.9-5.0.3.ELsmp.

Asterisk is configured to read sip.conf and extensions.conf from MySQL
via ODBC. The ast_config table contains about 3500 rows.

When I start "asterisk -gcvvvvv" the first time, everything works fine.
Then I issue a "reload", and something strange happens:


 Reloading SIP
Feb 22 09:50:23 NOTICE[26316]: config.c:764 __ast_load: Loading Config
sip.conf via odbc engine
  == Parsing '/etc/asterisk/res_config_odbc.conf': Found
Use EXIT or QUIT to exit the asterisk console
*CLI> 


After that, basically nothing else happens, and asterisk still works.
Now, if I issue another "reload", asterisk segfaults. That's what "bt"
says inside gdb:


(gdb) bt
#0  0x0000002a9607df81 in my_strcasecmp_8bit () from
/usr/local/lib/mysql/libmysqlclient_r.so.14
#1  0x0000002a96075e71 in get_charset_number () from
/usr/local/lib/mysql/libmysqlclient_r.so.14
#2  0x0000002a960761a6 in get_charset_by_csname () from
/usr/local/lib/mysql/libmysqlclient_r.so.14
#3  0x0000002a960909a2 in mysql_real_connect () from
/usr/local/lib/mysql/libmysqlclient_r.so.14
#4  0x0000002a95f28ba3 in SQLConnect () from
/usr/local/lib/libmyodbc3_r.so
#5  0x0000002a95baf4e9 in SQLConnect (connection_handle=0x655380,
server_name=0x6007f0 "asterisk", name_length1=-4992, 
    user_name=0x770300 "asterisk", name_length2=-6000,
authentication=0x60cfb0 "*******", name_length3=-3)
    at SQLConnect.c:3796
#6  0x0000002a9bd3e50b in odbc_init () at cdr_odbc.c:383
#7  0x0000002a9bd3e877 in odbc_load_module () at cdr_odbc.c:305
#8  0x0000000000411204 in ast_module_reload (name=0x0) at loader.c:184
#9  0x000000000042f811 in handle_reload (fd=-1776674848,
argc=1702130529, argv=0x6146a0) at cli.c:127
#10 0x0000000000431b48 in ast_cli_command (fd=1, s=0x2a961a17e0 "\b") at
cli.c:1155
#11 0x0000000000447334 in main (argc=5986672, argv=0x5ae0d0) at
asterisk.c:706


I'm not sure what the problem could be. What's interesting is that I can
issue "sip reload" or "extensions reload" as much as I want and it won't
segfault. But two plain "reload"s in a row will crash it.

Anyone?

Thank you
-Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050222/5c8a5cc3/attachment.htm


More information about the asterisk-users mailing list