[Home]

Summary:ASTERISK-25957: Segfault in odbc after commit 9b0a96b947437f58fcc88f154ed5080fde529009
Reporter:Niklas Larsson (pnlarsson)Labels:
Date Opened:2016-04-25 07:56:23Date Closed:
Priority:MajorRegression?Yes
Status:Open/NewComponents:Core/General
Versions:13.8.0 13.8.1 13.8.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 7 64 bit, voicemail and cdr via ODBCAttachments:( 0) backtrace_odbc_2.3.4.txt
( 1) backtrace_odbc.txt
( 2) backtrace.txt
( 3) cdr_adaptive_odbc.conf
( 4) modules.conf
( 5) odbc.ini
( 6) odbcinst.ini
Description:Commit 9b0a96b947437f58fcc88f154ed5080fde529009 (https://gerrit.asterisk.org/#/c/2073/) segfaults asterisk when it's trying to access ODBC. No segfaults if I move back one commit (to d2be16472efa0608c389b467ad69044fbe8e9f5f).

I use odbc for voicemail and cdr_adaptive_odbc

And after adding:
preload => cdr_adaptive_odbc.so

after:

preload => res_odbc.so
preload => res_config_odbc.so
preload => chan_local.so

there is no more segfaults.
Comments:By: Asterisk Team (asteriskteam) 2016-04-25 07:56:23.971-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Rusty Newton (rnewton) 2016-04-25 09:36:55.756-0500

Niklas what exact versions of the ODBC and MySQL drivers are you using?

By: Niklas Larsson (pnlarsson) 2016-04-25 10:05:21.457-0500

{code}
root@uc01:~# dpkg --list | grep odbc
ii  libmyodbc:amd64                       5.1.10-2+deb7u1                   amd64        the MySQL ODBC driver
ii  libodbc1:amd64                        2.2.14p2-5                        amd64        ODBC library for Unix
ii  odbcinst                              2.2.14p2-5                        amd64        Helper program for accessing odbc ini files
ii  odbcinst1debian2:amd64                2.2.14p2-5                        amd64        Support library for accessing odbc ini files
ii  unixodbc                              2.2.14p2-5                        amd64        Basic ODBC tools
ii  unixodbc-dev                          2.2.14p2-5                        amd64        ODBC libraries for UNIX (development files)
{code}

But the driver for mysql is from somewhere else. I could not make it work with the defualt driver and found somewher a driver that worked. I will have to dig around a bit to find it, but the version is mysql-connector-odbc-5.1.13



By: Joshua C. Colp (jcolp) 2016-06-07 13:22:46.683-0500

Now that the current UnixODBC is out of the way - is this still a problem, what happens if you upgrade UnixODBC to something more recent?

By: Niklas Larsson (pnlarsson) 2016-06-08 05:49:18.437-0500

Still get segfault with the latest 13 branch with the odbc fix.

Attached backtrace.

By: Niklas Larsson (pnlarsson) 2016-06-08 07:43:47.790-0500

Backtrace with unixodbc 2.3.4

By: Niklas Larsson (pnlarsson) 2016-06-08 07:44:24.225-0500

Same result with UnixODBC 2.3.2 and 2.3.4

By: Ross Beer (rossbeer) 2016-06-10 06:39:27.104-0500

Have you tried running the latest mysql-connector-odbc 5.3.6 from the MySQL website or rpms?

I had multiple segfaults until using the latest driver.

By: Jacek Kuzemczak (jacekkuzemczak) 2016-06-16 08:47:45.507-0500

One of our servers is also affected by this issue - seems to fail every few hours. We're using the 5.3.6 driver from the MySQL website and the packaged version of unixodbc which I believe is 2.3.1.

Wondering if anyone is aware of a workaround for this or even the steps to reproduce it so we can try and avoid them :P

By: Ross Beer (rossbeer) 2016-06-16 09:10:48.916-0500

Upgrade to unixODBC 2.3.2 or download SVN to get the odbc fix.

By: Jacek Kuzemczak (jacekkuzemczak) 2016-06-16 11:25:28.471-0500

It does seem to work okay using unixodbc 2.3.4. I hadn't tried that because of the comment a few above. Thanks :)

By: Ross Beer (rossbeer) 2016-06-16 11:30:31.647-0500

,It's ok to use 2.3.4 however make sure you use SVN release and not 13.9.1 as you will run out of memory due to a memory leak in unixODBC 2.3.4.

The workaround for this in general release will be in 13.10

By: Niklas Larsson (pnlarsson) 2016-06-16 12:12:51.062-0500

Be aware that this issue has nothing todo with the odbc changes that where done. This issue has to do with changes in loading modules.

By: Marek Cervenka (cervajs) 2016-06-17 03:48:03.719-0500

i urged Nick Gorham and he applied fix from Joshua to unixodbc trunk

------------------------------------------------------------------------
r129 | lurcher | 2016-06-17 10:29:50 +0200 (Fri, 17 Jun 2016) | 1 line

Fix buffer comparison problem in caching
------------------------------------------------------------------------