[asterisk-bugs] [Asterisk 0018243]: [patch] Random segfault when querying MySQL via func_odbc

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Nov 4 10:36:48 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18243 
====================================================================== 
Reported By:                ks3
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18243
Category:                   Functions/func_odbc
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.13 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-11-02 13:30 CDT
Last Modified:              2010-11-04 10:36 CDT
====================================================================== 
Summary:                    [patch] Random segfault when querying MySQL via
func_odbc
Description: 
For the past couple months, our two Asterisk servers crash (at different
times) about once a week, and the last entries in the console log are calls
to some of our func_odbc functions. Within the last couple weeks, these
crashes have increased to about every day, sometimes 2-3 times per day.
====================================================================== 

---------------------------------------------------------------------- 
 (0128613) ks3 (reporter) - 2010-11-04 10:36
 https://issues.asterisk.org/view.php?id=18243#c128613 
---------------------------------------------------------------------- 
I've attached a patch against the current svn version of res_odbc.c. There
was an update at some point to use ast_odbc_sanity_check in the
ast_odbc_prepare_and_execute function, but ast_odbc_direct_execute
continued to blindly disconnect and reconnect.

Also, each of those functions set obj->up to 0, which appears to have the
effect of forcing ast_odbc_sanity_check to disconnect and reconnect. It
seems to me that it should only disconnect / reconnect if the testsql
statement fails, so I have removed the obj->up = 0 statements as well.

We are running 1.6.2.13, and the patch also cleanly applies against it's
source. I'll be putting this in testing later today. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-11-04 10:36 ks3            Note Added: 0128613                          
======================================================================




More information about the asterisk-bugs mailing list