[asterisk-bugs] [Asterisk 0019180]: [patch] Random crashes (NULL reference) at res_odbc.c:1358

Asterisk Bug Tracker noreply at bugs.digium.com
Tue May 3 13:51:43 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19180 
====================================================================== 
Reported By:                pruiz
Assigned To:                dvossel
====================================================================== 
Project:                    Asterisk
Issue ID:                   19180
Category:                   Resources/res_odbc
Reproducibility:            random
Severity:                   crash
Priority:                   normal
Status:                     closed
Asterisk Version:           1.8.3.3 
JIRA:                       SWP-3385 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2011-04-25 17:06 CDT
Last Modified:              2011-05-03 13:51 CDT
====================================================================== 
Summary:                    [patch] Random crashes (NULL reference) at
res_odbc.c:1358
Description: 
Randomly, a our asterisk servers (4 nodes running 1.8.3.2), crash due to an
invalid/null reference at res_odbc.c

After inspecting the coredump files it is crearly a null reference, as can
be seen on the following output from GDB:

https://issues.asterisk.org/view.php?id=0  0x00002aaaabb526ac in
_ast_odbc_request_obj2 (name=0x42037920
"sipper-con", flags=<value optimized out>, file=<value optimized out>,
function=<value optimized out>,
    lineno=<value optimized out>) at res_odbc.c:1358
1358                    if (time(NULL) >
class->last_negative_connect.tv_sec +
class->negative_connection_cache.tv_sec) {
(gdb) bt
https://issues.asterisk.org/view.php?id=0  0x00002aaaabb526ac in
_ast_odbc_request_obj2 (name=0x42037920
"sipper-con", flags=<value optimized out>, file=<value optimized out>,
function=<value optimized out>,
    lineno=<value optimized out>) at res_odbc.c:1358
https://issues.asterisk.org/view.php?id=1  0x00002aaacda516b0 in update_odbc
(database=0x42037920 "sipper-con",
table=0x42037820 "sipregs1", keyfield=0x2aaaad715408 "name", lookup=<value
optimized out>,
    ap=<value optimized out>) at res_config_odbc.c:497
https://issues.asterisk.org/view.php?id=2  0x000000000047e441 in
ast_update_realtime ()
https://issues.asterisk.org/view.php?id=3  0x00002aaaad6fa101 in update_peer
(p=0x2aaadc7f3ee8, addr=0x42039f10,
req=0x420394b0, uri=<value optimized out>) at chan_sip.c:4231
https://issues.asterisk.org/view.php?id=4  register_verify (p=0x2aaadc7f3ee8,
addr=0x42039f10, req=0x420394b0,
uri=<value optimized out>) at chan_sip.c:13856
https://issues.asterisk.org/view.php?id=5  0x00002aaaad6fa63d in
handle_request_register (p=0x2aaadc7f3ee8,
req=0x420394b0, addr=0x42039f10, e=0x208fb001 "sip:77.240.122.36:5060") at
chan_sip.c:23482
https://issues.asterisk.org/view.php?id=6  0x00002aaaad70b8ce in handle_incoming
(p=0x2aaadc7f3ee8,
req=0x420394b0, addr=0x42039f10, recount=0x42039464, nounlock=0x42039460)
at chan_sip.c:23752
https://issues.asterisk.org/view.php?id=7  0x00002aaaad70c670 in
handle_request_do (req=0x420394b0,
addr=0x42039f10) at chan_sip.c:24036
https://issues.asterisk.org/view.php?id=8  0x00002aaaad70cfb9 in sipsock_read
(id=<value optimized out>,
fd=<value optimized out>, events=<value optimized out>, ignore=<value
optimized out>) at chan_sip.c:23934
https://issues.asterisk.org/view.php?id=9  0x00000000004c0f13 in ast_io_wait ()
https://issues.asterisk.org/view.php?id=10 0x00002aaaad6e015b in do_monitor
(data=<value optimized out>) at
chan_sip.c:24451
https://issues.asterisk.org/view.php?id=11 0x000000000053104c in dummy_start ()
https://issues.asterisk.org/view.php?id=12 0x00000030e420673d in start_thread ()
from /lib64/libpthread.so.0
https://issues.asterisk.org/view.php?id=13 0x00000030e3ad3d1d in clone () from
/lib64/libc.so.6
(gdb) p class
$1 = (struct odbc_class *) 0x0



====================================================================== 

---------------------------------------------------------------------- 
 (0134359) svnbot (reporter) - 2011-05-03 13:51
 https://issues.asterisk.org/view.php?id=19180#c134359 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 316216

_U  trunk/
U   trunk/res/res_odbc.c

------------------------------------------------------------------------
r316216 | dvossel | 2011-05-03 13:51:42 -0500 (Tue, 03 May 2011) | 15
lines

Merged revisions 316215 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316215 | dvossel | 2011-05-03 13:49:48 -0500 (Tue, 03 May 2011) | 9
lines
  
  Fixes a random crash (NULL reference) in res_odbc.c.
  
  (closes issue https://issues.asterisk.org/view.php?id=19180)
  Reported by: pruiz
  Patches: 
        tmp.diff uploaded by pruiz (license 1152)
  Tested by: pruiz, seanbright
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=316216 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-03 13:51 svnbot         Checkin                                      
2011-05-03 13:51 svnbot         Note Added: 0134359                          
======================================================================




More information about the asterisk-bugs mailing list