[asterisk-bugs] [Asterisk 0010948]: [patch] Division by zero error when a music on hold class is empty

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 11 11:44:55 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10948 
====================================================================== 
Reported By:                jcomellas
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   10948
Category:                   Resources/res_musiconhold
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.12.1  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-11-2007 11:06 CDT
Last Modified:              10-11-2007 11:44 CDT
====================================================================== 
Summary:                    [patch] Division by zero error when a music on hold
class is empty
Description: 
When a music on hold class is empty (chan->music_state->class->total_files
== 0) and Asterisk looks for the next file in the music class by calling
ast_moh_files_next() (on res/res_musiconhold.c) we get a division by zero
signal.

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

---------------------------------------------------------------------- 
 jcomellas - 10-11-07 11:44  
---------------------------------------------------------------------- 
Sorry, I've just realized that this had happened on Asterisk 1.2.18 instead
of 1.4.13, but the code seems to be pretty similar in Asterisk 1.4.

I don't know what may have caused this problem, but it did happen. The
only strange thing we do regarding MOH is that we run 'moh reload' very
frequently (every 5 min) and there are lots of music classes (hundreds)
with files that are loaded from an NFS filesystem.

The Asterisk 1.2.18 backtrace I have is the following (for a bridge that
was created from a module written by us):

Program terminated with signal 8, Arithmetic exception.
<...List of Asterisk modules being loaded...>
http://bugs.digium.com/view.php?id=0  0xb7b7fed8 in moh_files_generator
(chan=0xb6cdabe8, data=0xc2da3c8,
len=160, samples=160) at res_musiconhold.c:227
227                     state->pos %= state->class->total_files;

(gdb) bt
http://bugs.digium.com/view.php?id=0  0xb7b7fed8 in moh_files_generator
(chan=0xb6cdabe8, data=0xc2da3c8,
len=160, samples=160) at res_musiconhold.c:227
http://bugs.digium.com/view.php?id=1  0x08066bfa in ast_read (chan=0xb6cdabe8)
at channel.c:2032
http://bugs.digium.com/view.php?id=2  0x0806a02d in ast_channel_bridge
(c0=0xb6cdabe8, c1=0xd7afcc0,
config=0xb6662da8, fo=0xb6662d08, rc=0xb6662d04) at channel.c:3408
http://bugs.digium.com/view.php?id=3  0xb7b58671 in ast_bridge_call
(chan=0xb6cdabe8, peer=0xd7afcc0,
config=0xb6662da8) at res_features.c:1325
http://bugs.digium.com/view.php?id=4  0xb7560dcb in telmod_bridge
(session=0xd424828, msg=0xd9cfc00) at
src/method.c:1543
http://bugs.digium.com/view.php?id=5  0xb755b014 in telmod_event_loop
(session=0xd424828) at
src/event.c:214
http://bugs.digium.com/view.php?id=6  0xb7566e0e in telmod_exec
(chan=0xb6cdabe8, data=0xb6666fd8) at
src/app_telmod.c:198
http://bugs.digium.com/view.php?id=7  0x0808e443 in pbx_extension_helper
(c=0xb6cdabe8, con=<value optimized
out>, context=<value optimized out>,
    exten=0xb6cdae2c "DID13214451888!C542860810!S0!DIR0", priority=4,
label=0x0, callerid=0xb4d05e20 "3308684196", action=1) at pbx.c:574
http://bugs.digium.com/view.php?id=8  0x0808f8e4 in __ast_pbx_run (c=0xb6cdabe8)
at pbx.c:2250
http://bugs.digium.com/view.php?id=9  0x080904fc in pbx_thread (data=0x1) at
pbx.c:2537
http://bugs.digium.com/view.php?id=10 0xb7f35341 in start_thread () from
/lib/tls/i686/cmov/libpthread.so.0
http://bugs.digium.com/view.php?id=11 0xb7e164ee in clone () from
/lib/tls/i686/cmov/libc.so.6 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-11-07 11:44  jcomellas      Note Added: 0071822                          
======================================================================




More information about the asterisk-bugs mailing list