mariadbodbc

mariadb odbc throws invalid pointer error


I have MariaDB installed (as part of Fedora installation) on Fedora 21. ODBC is also installed. BUT, when I go to test the ODBC configuration (or when Asterisk attempts to use ODBC) I get an error in free():invalid pointer.

odbcinst.ini

 [MySQL]
 Description=ODBC for MySQL
 Driver=/usr/lib64/libmyodbc5.so
 Setup=/usr/lib64/libodbcmyS.so
 FileUsage=1
 UsageCount=2

odbc.ini

 [asterisk]
 Description=MySQL connection to 'asterisk' database
 Driver=MySQL
 Database=asteriskdb
 Server=localhost
 UserName=<theusername>
 Password=<thepassword>
 Port=3306
 Socket=/var/lib/mysql/mysql.sock

Connecting to the database using mysql works perfectly fine using these credentials. But doing:

 echo "select 1"|isql -v asterisk theusername thepassword

results in this:

*** Error in `isql': free(): invalid pointer: 0x00000000011c4e58 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7850e)[0x7fdd0ef7850e]
/lib64/libc.so.6(cfree+0x5b5)[0x7fdd0ef84165]
/usr/lib64/libmyodbc5.so(MySQLGetPrivateProfileStringW+0x132)[0x7fdd083381c2]
/usr/lib64/libmyodbc5.so(ds_lookup+0x5d)[0x7fdd08336c3d]
/usr/lib64/libmyodbc5.so(MySQLConnect+0xbe)[0x7fdd08316a1e]
/lib64/libodbc.so.2(SQLConnect+0x9e5)[0x7fdd0fb41745]
isql[0x402908]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7fdd0ef1ffe0]
isql[0x402c31]
======= Memory map: ========

I can provide the rest of the core dump if it will help anyone.

Any suggestions for what is causing this and how to prevent it? I need ODBC working.


Solution

  • I had the same problem on my F21 86_64.

    The resolution for me was to install a newer version (logged in as root):

    1 remove actual odbc-version (5.2.2 if I remember well)

    yum remove mysql-connector-odbc
    

    2 Searching the newest version of mysql-connector-odbc-5.3.4-1.x86_64.rpm) at: http://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.4-1.x86_64.rpm (you need to subscribe)

    yum localinstall --nogpgcheck mysql-connector-odbc-5.3.4-1.x86_64.rpm
    

    3 symbolic link creation because unixODBC points still to /usr/lib64/libmyodbc5.so instead of /usr/lib64/libmyodbc5w.so

    ln -s /usr/lib64/libmyodbc5w.so  /usr/lib64/libmyodbc5.so 
    

    4 if needed don't forget to modify (in ~/.odbc.ini)

    .....
    Driver64=/usr/lib64/libmyodbc5w.so 
    ....