Summary:ASTERISK-12990: [patch] Integer divide by zero
Reporter:pj (pj)Labels:
Date Opened:2008-10-30 05:55:12Date Closed:2008-11-03 15:37:25.000-0600
Versions:Frequency of
Environment:Attachments:( 0) gdb.txt
( 1) rtp.c.patch
( 2) valgrind.txt
Description:asterisk crash immediatelly, when trying to call (simple sip2sip call)
older svn trunk revisions (eg. r138513) are not affected
gdb/valgrind debugs are attached
Comments:By: Eliel Sardanons (eliel) 2008-10-30 06:09:05

what are you rtpstart and rtpend values? (in rtp.conf)

By: pj (pj) 2008-10-30 06:16:45

I didn't have rtp.conf at all :o)
if I put something here, it resolved this crash,
imho, asterisk should have something default, or even fail to start completely if this required file is missing. thanks!

By: pj (pj) 2008-10-30 06:20:13

it seems, that is sufficient to have rtp.conf empty and it doesn't crash,
only if this file is missing it causes crash

By: Eliel Sardanons (eliel) 2008-10-30 06:33:48

Can you test this patch without a rtp.conf file?

By: pj (pj) 2008-10-30 06:51:45

with your patch it doesn't crash even without rtp.conf :o)
maybe it can be improved with some startup warning msg, that rtp.conf was not found, and print message allocating RTP port range 5000 -> 31000

By: pj (pj) 2008-10-30 06:59:46

it seems, that this issue was introduced with commit:
142992 - Create a new config file status, CONFIG_STATUS_FILEINVALID
can't be it also potentially source of problems when other non critical config files will missing like this?

By: Eliel Sardanons (eliel) 2008-10-30 07:04:38

Ok, test this patch, I will take a look at other modules.

By: pj (pj) 2008-10-30 07:15:30

to be consistent how asterisk handles other missing config files, severity should be 'warning' instead of 'error'
anyway it's working fine, no crash anymore

[Oct 30 13:22:21] ERROR[390]: rtp.c:4702 __ast_rtp_reload: Missing or invalid 'rtp.conf' file, defaulting port range to 5000-31000

[Oct 30 13:22:21] WARNING[390]: features.c:3238 load_config: Could not load features.conf

By: Eliel Sardanons (eliel) 2008-10-30 07:31:10

ok, uploaded with WARNING instead of ERROR.

By: pj (pj) 2008-10-30 07:52:16

OK, imho ready for commit, thanks!

By: Digium Subversion (svnbot) 2008-11-03 15:37:24.000-0600

Repository: asterisk
Revision: 154060

U   branches/1.4/main/rtp.c

r154060 | tilghman | 2008-11-03 15:37:23 -0600 (Mon, 03 Nov 2008) | 3 lines

Remove the potential for a division by zero error.
(Closes issue ASTERISK-12990)