[Home]

Summary:ASTERISK-23475: res_odbc crash
Reporter:Tobias Gunkel (tgunkel)Labels:
Date Opened:2014-03-13 04:39:02Date Closed:2014-03-31 10:58:34
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_odbc
Versions:1.8.26.0 11.8.0 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:Linux Kernel 3.12.9 x86_64, 2 x Intel Xeon CPU E5530 (16 cores overall)Attachments:( 0) backtrace_20140310.txt
( 1) backtrace_20140311.txt
Description:Hi,

we're running a rather heavy load setup with approximately 200-500 calls per minute on one server (average).
Since we switched from MYSQL() to res_odbc we ran into sporadic Asterisk crashes (about 3 times a day). Those crashes are not necessarily bound to cpu load. It happens at 40% cpu-idle as well as 95% cpu-idle.

The last output from "asterisk-rcgvv" after the crash is always:
NOTICE[433]: res_odbc.c:1563 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk]

I've uploaded two backtraces:
http://pastebin.com/4M9jrc3g
http://pastebin.com/Te5z6kkb

All phone numbers were substituted with 0123456789.

Our /etc/asterisk/res_odbc.conf looks like this:

[asterisk]
enabled => yes
dsn => asterisk
username => asterisk
password => ***
pooling => yes
limit => 100
pre-connect => yes
sanitysql => set wait_timeout = 86400
idlecheck => 1800
share_connections => yes
negative_connection_cache => 120

[asteriskIB]
enabled => yes
username => asterisk
dsn => asteriskIB
password => ***
pooling => yes
limit => 50
pre-connect => yes
sanitysql => select 1
idlecheck => 1800
share_connections => yes
negative_connection_cache => 120

Switching back to MYSQL() immediately fixes the problem.

Any help in debugging this issue would be greatly appreciated!

Best regards,
Tobias
Comments:By: Tobias Gunkel (tgunkel) 2014-03-13 04:46:44.990-0500

Uploaded backtraces directly.

By: Matt Jordan (mjordan) 2014-03-13 06:26:28.375-0500

Which distribution of Linux are you using? What version of {{libodbc}} is installed?

As this is a crash in {{libodbc}}, the bug is likely to be in that library.

By: Tobias Gunkel (tgunkel) 2014-03-13 06:48:46.221-0500

Debian 7.4 and libmyodbc (5.1.10-2+deb7u1), libodbc1 (2.2.14p2-5), unixodbc (2.2.14p2-5)

By: Tobias Gunkel (tgunkel) 2014-03-13 08:48:17.469-0500

Ok, we will be testing a newer libodbc with unixODBC-2.3.2 tomorrow.
Thanks for the hint!

-Tobi

By: Walter Doekes (wdoekes) 2014-03-17 04:49:09.133-0500

This could be a threading issue where you have a non-thread safe myodbc, or one that is in non-thread-safe mode.

Try using pooled connections in res_odbc.conf. (Or look at the myodbc options for Threading = N.)

By: Tobias Gunkel (tgunkel) 2014-03-18 05:30:44.185-0500

Looks promising so far. No crashes with unixODBC-2.3.2 since 3 days.
I'm going to respond again in a few days, when I have more convincing results.

By: Tobias Gunkel (tgunkel) 2014-03-31 02:01:48.653-0500

I think this issue can be closed. No more crashes since upgrade to unixODBC-2.3.2. Thank you for your help!

By: Walter Doekes (wdoekes) 2014-03-31 02:28:14.286-0500

Tobias: cool.

Can you hit "Send back" so the moderators can close it? Thanks.

By: Tobias Gunkel (tgunkel) 2014-03-31 02:30:25.423-0500

I think this issue can be closed. No more crashes since upgrade to unixODBC-2.3.2. Thank you for your help!