[asterisk-bugs] [Asterisk 0016058]: [patch] Crash in local_ast_moh_start / ast_indicate_data due to AST_CONTROL_HOLD with bad pointer

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Nov 12 11:02:11 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16058 
====================================================================== 
Reported By:                atis
Assigned To:                jpeeler
====================================================================== 
Project:                    Asterisk
Issue ID:                   16058
Category:                   Channels/General
Reproducibility:            have not tried
Severity:                   crash
Priority:                   normal
Status:                     assigned
Target Version:             1.6.0.19
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-10-12 08:24 CDT
Last Modified:              2009-11-12 11:02 CST
====================================================================== 
Summary:                    [patch] Crash in local_ast_moh_start /
ast_indicate_data due to AST_CONTROL_HOLD with bad pointer
Description: 
I got the following backtrace:

Program terminated with signal 11, Segmentation fault.
# 0  0x00002aaab13265d0 in local_ast_moh_start (chan=0x2aaac82fad98,
mclass=0xc8196c58 <Address 0xc8196c58 out of bounds>, interpclass=0xc4c1db
"default") at
/export/storage0/dist/1.6.1_p1/asterisk-svn-1.6.1.6-iqlabs/include/asterisk/strings.h:50
50              return (!s || (*s == '\0'));

# 0  0x00002aaab13265d0 in local_ast_moh_start (chan=0x2aaac82fad98,
mclass=0xc8196c58 <Address 0xc8196c58 out of bounds>, interpclass=0xc4c1db
"default") at
/export/storage0/dist/1.6.1_p1/asterisk-svn-1.6.1.6-iqlabs/include/asterisk/strings.h:50
# 1  0x000000000046b106 in ast_moh_start (chan=0x2aaac82fad98,
mclass=0xc8196c58 <Address 0xc8196c58 out of bounds>, interpclass=0xc4c1db
"default") at channel.c:5625
# 2  0x00002aaab8e1ad84 in sip_indicate (ast=0x2aaac82fad98, condition=16,
data=0xc8196c58, datalen=0) at chan_sip.c:5794
# 3  0x000000000045f40c in ast_indicate_data (chan=0x2aaac82fad98,
_condition=16, data=0xc8196c58, datalen=0) at channel.c:3113
# 4  0x0000000000467171 in ast_generic_bridge (c0=0xaa7638,
c1=0x2aaac82fad98, config=0x40c90c00, fo=0x40c8fd28, rc=0x40c8fd20,
bridge_end={tv_sec = 1255274833, tv_usec = 81777}) at channel.c:4902

After investigating closer in frame 4 i found that:

f->datalen = 0
f->data.ptr = (void *) 0xc8196c58 (which is out of bounds in
ast_strlen_zero)
f->frametype = AST_FRAME_CONTROL
f->subclass = 16 (AST_CONTROL_HOLD)

So, apparently something generates wrong HOLD frame with datalength 0 but
invalid pointer.

Full backtrace attached
====================================================================== 

---------------------------------------------------------------------- 
 (0113729) atis (reporter) - 2009-11-12 11:02
 https://issues.asterisk.org/view.php?id=16058#c113729 
---------------------------------------------------------------------- 
wuwu:

my patch is fixing the crash, as is jpeeler's patch (he did the same thing
one function higher).

However this is just a band-aid for the problem, which resides somewhere
deeper.

If You can reproduce the problem, it would be very helpful. Enabling
DO_CRASH (and dev-mode) shouldn't impact performance, however it will crash
your system again providing much more debug to identify underlying problem
(which is why i don't want to run it on production system). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-12 11:02 atis           Note Added: 0113729                          
======================================================================




More information about the asterisk-bugs mailing list