[asterisk-bugs] [Asterisk 0017101]: [patch] Asterisk Crashes With Core Dump When FUNC_ODBC Processes SQL Statements With Errors

Asterisk Bug Tracker noreply at bugs.digium.com
Thu May 27 04:44:00 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17101 
====================================================================== 
Reported By:                David Elliott
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17101
Category:                   Functions/func_odbc
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     confirmed
Asterisk Version:           1.6.2.6 
JIRA:                       SWP-1176 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-26 09:23 CDT
Last Modified:              2010-05-27 04:43 CDT
====================================================================== 
Summary:                    [patch] Asterisk Crashes With Core Dump When
FUNC_ODBC Processes SQL Statements With Errors
Description: 
When func_odbc /res_odbc processes SQL with table name, column name or
variables missing it generates a segmentation violation and subsequent core
dump.  

This latest set of issues were generated by Asterisk 1.6.2.6 running on a
fully upgraded Centos 5.4 (2.6.18-164.15.1.el5
https://issues.asterisk.org/view.php?id=1 SMP).  The same issue
occurs across a range of Asterisk versions and Linux distributions.  I am
pretty sure the issue is caused by the way ODBC driver errors are handled
by func_odbc / res_odbc.  

The res_odbc / func_odbc reports a syntax error to the console which is
ignored.  Instead of re-acting to the valid ODBC error,   func_odbc /
res_odbc does a DISCONNECT / CONNECT followed by a re-execution of the same
faulty SQL statement.  The software has assumed that the original error was
caused by a connection time out and seeks to fix the problem by
disconnecting and re-connecting to the database.  Needless to say quite
simple, SQL syntax error will stop Asterisk in its tracks. 

 


======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
duplicate of        0017245 [patch] segfault caused by error in SQL
====================================================================== 

---------------------------------------------------------------------- 
 (0122547) David Elliott (reporter) - 2010-05-27 04:43
 https://issues.asterisk.org/view.php?id=17101#c122547 
---------------------------------------------------------------------- 
I have applied the patch to all of my Asterisk machines.   I am still
running Asterisk 1.6.2.6 + Patch from the linked issue 0017245.  This patch
seem to have resolved the issue.

I will move up to the next subversion from the main branch sometime soon. 
I will confirm this is OK when I upgrade to something higher than 1.6.2.6.

Many thanks 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-05-27 04:43 David Elliott  Note Added: 0122547                          
======================================================================




More information about the asterisk-bugs mailing list