[debian-mysql] MySQL ODBC in Stretch

Bernhard Schmidt berni at debian.org
Fri Nov 11 14:24:28 UTC 2016


On Fri, Nov 11, 2016 at 11:05:48AM +0100, Bernhard Schmidt wrote:

Hi,

> I have pushed an initial proof-of-concept package to my personal repo at
> git.debian.org (~berni/public_git/mariadb-connector-odbc.git). It should
> be visible at
> https://anonscm.debian.org/cgit/users/berni/mariadb-connector-odbc.git/
> shortly. This works for me, but is currently not fit for Release.

Just a minor additional information, I was about to give up when isql
worked fine, but Asterisk using ODBC against mariadb-connector-odbc
almost immediately segfaulted with

Thread 102 "asterisk" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff81ee6700 (LWP 45159)]
0x00007fff8a59904e in mysql_ping () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
(gdb) bt
#0  0x00007fff8a59904e in mysql_ping () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#1  0x00007ffface20e88 in MADB_DbcGetAttr (Dbc=0x5555563dce10, Attribute=1209, ValuePtr=0x7fff81ee1dc8, BufferLength=0, StringLengthPtr=0x0,
    isWChar=<optimized out>) at ./ma_connection.c:309
#2  0x00007ffface19da4 in MA_SQLGetConnectAttr (ConnectionHandle=0x5555563dce10, Attribute=1209, ValuePtr=0x7fff81ee1dc8, BufferLength=0, StringLengthPtr=0x0)
    at ./odbc_3_api.c:1674
#3  0x00007fffb1210a45 in SQLGetConnectAttr (connection_handle=0x5555563c6ea0, attribute=1209, value=0x7fff81ee1dc8, buffer_length=0, string_length=0x0)
    at SQLGetConnectAttr.c:742
#4  0x00007fffb1b478b5 in _ast_odbc_request_obj2 () from /usr/lib/asterisk/modules/res_odbc.so
#5  0x00007fffb1b48073 in _ast_odbc_request_obj () from /usr/lib/asterisk/modules/res_odbc.so

What got me thinking was the libmariadbclient.so.18 in #0, since the
odbc driver is linked against libmariadb.so. It turns out that
apparently loading the native MySQL config module (that uses
libmariadbclient) and the ODBC module (using mariadb-connector-odbc
using libmariadb) in the same process is broken. I guess the odbc
connector sees the symbol from libmariadbclient and uses it, instead of
loading the other library.

This is way over my head regarding C and dynamic linking, maybe
something can be done using symbol versioning or whatever. I guess the C
connector library and libmariadbclient use slightly different ABIs. For
now I could resolve this by fully switching Asterisk to ODBC.

Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20161111/372f0746/attachment.sig>


More information about the pkg-mysql-maint mailing list