[Home]

Summary:ASTERISK-18997: Segfault in res_config_odbc/res_odbc when using realtime peers (sipregs)
Reporter:S├ębastien Couture (sysreq)Labels:
Date Opened:2011-12-08 13:14:47.000-0600Date Closed:2011-12-14 14:07:10.000-0600
Priority:CriticalRegression?
Status:Closed/CompleteComponents:Resources/res_config_odbc Resources/res_odbc
Versions:Frequency of
Occurrence
Occasional
Related
Issues:
Environment:Attachments:( 0) asterisk1_backtrace-08122011_122332.txt
( 1) asterisk2_backtrace-08122011_135331.txt
Description:I've had two Asterisk 1.8.4.2 servers segfault today, with was seems to be the same issue. It looks like it's related to realtime sip peers stored via ODBC (MySQL).

I've included both backtraces.
Comments:By: Walter Doekes (wdoekes) 2011-12-09 04:38:23.082-0600

You need to upgrade.

{noformat}
walter@walter-desktop:0:~/src/asterisk-1.8.x$ svn log -r 316215
------------------------------------------------------------------------
r316215 | dvossel | 2011-05-03 20:49:48 +0200 (Tue, 03 May 2011) | 9 lines

Fixes a random crash (NULL reference) in res_odbc.c.

(closes issue #19180)
Reported by: pruiz
Patches:
     tmp.diff uploaded by pruiz (license 1152)
Tested by: pruiz, seanbright


------------------------------------------------------------------------
walter@walter-desktop:0:~/src/asterisk-1.8.x$ svn diff -c 316215
Index: res/res_odbc.c
===================================================================
--- res/res_odbc.c (revision 316214)
+++ res/res_odbc.c (revision 316215)
@@ -1360,7 +1360,7 @@

if (obj && ast_test_flag(&flags, RES_ODBC_CONNECTED) && !obj->up) {
/* Check if this connection qualifies for reconnection, with negative connection cache time */
- if (time(NULL) > class->last_negative_connect.tv_sec + class->negative_connection_cache.tv_sec) {
+ if (time(NULL) > obj->parent->last_negative_connect.tv_sec + obj->parent->negative_connection_cache.tv_sec) {
odbc_obj_connect(obj);
}
} else if (obj && ast_test_flag(&flags, RES_ODBC_SANITY_CHECK)) {
{noformat}