[debian-mysql] Bug#880197: mariadb-connector-c: Disable internal Dbug support as a source of crashes

Guillem Jover gjover at sipwise.com
Mon Oct 30 14:27:42 UTC 2017


Source: mariadb-connector-c
Source-Version: 2.3.2-2
Severity: serious
Tags: patch

Hi!

While packaging the mariadb-connector-odbc for internal use, we
started to notice crashes in asterisk due to the ODBC asterisk plugin.

The problem ended up being an abort initiated by the internal Dbug code
within mariadb-connector-c's libmariadb.a that the mariadb-connector-odbc
statically links against.

Skimming over the code revealed that there's at least one function with
an unbalanced DBUG_RETURN(), but even after patching that the plugin
was still crashing. Checking the latest mariadb-connector-c upstream
shows that the Dbug support has been completely removed there, so
instead of trying to track it down, followed the same path. Our asterisk
instance using its odbc plugin that uses mariadb-connector-odbc is
working fine now.

I think this is serious enough that it should be fixed in a stable
update. Here's an example backtrace of such crashes:

,---
Core was generated by `/usr/sbin/asterisk -p -g -U asterisk'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f454b05b700 (LWP 19858))]
(gdb) bt full
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = {__val = {0, 94034738822584, 139935588123936, 5655481737,
            94034738821728, 139935588123920, 139935689551805, 252833149,
            4294967295, 0, 139937266863576, 139937324438456, 0, 0,
            8227920807149371393, 7814153793824583285}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007f45af17e3fa in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x424420676e697373,
            sa_sigaction = 0x424420676e697373}, sa_mask = {__val = {
              5932740740841949013, 266287972354, 139937080938440,
              139935588124576, 139935689985411, 0, 2, 139935588124976,
              139935689791148, 0, 2880, 0, 139937270617936, 139937270613280,
              139937270617936, 139935588136704}}, sa_flags = -1357180916,
          sa_restorer = 0x55862994d2c0 <stderr>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f455112ba21 in DbugExit ()
   from /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
No symbol table info available.
#3  0x00007f45511508b5 in _db_return_ ()
   from /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
No symbol table info available.
#4  0x00007f4551157dbe in mysql_reconnect ()
   from /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
No symbol table info available.
#5  0x00007f455115800d in mthd_my_send_cmd ()
   from /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
No symbol table info available.
#6  0x00007f4551154570 in mysql_ping ()
   from /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
No symbol table info available.
#7  0x00007f4551138638 in MADB_DbcGetAttr (Dbc=0x55862b3464b0,
    Attribute=1209, ValuePtr=0x7f454b0591d8, BufferLength=0,
    StringLengthPtr=0x0, isWChar=<optimized out>) at ./ma_connection.c:309
No locals.
#8  0x00007f45511313b4 in MA_SQLGetConnectAttr (
    ConnectionHandle=0x55862b3464b0, Attribute=1209, ValuePtr=0x7f454b0591d8,
    BufferLength=0, StringLengthPtr=0x0) at ./odbc_3_api.c:1660
        Dbc = 0x55862b3464b0
        ret = <optimized out>
`---

And attached the patch we ended up using. Although just forcing
-DDBUG_OFF would be enough.

Thanks,
Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mysql_ping_unbalanced_dbug_return.patch
Type: text/x-diff
Size: 1556 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20171030/d9e5d136/attachment.patch>


More information about the pkg-mysql-maint mailing list