[Home]

Summary:ASTERISK-06372: If I use the 'reload' command in asterisk, asterisk crashes with a segmentation fault.
Reporter:Sven Fischer (sven)Labels:
Date Opened:2006-02-20 02:55:54.000-0600Date Closed:2008-01-15 16:56:45.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Channels/chan_misdn
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:If I use the 'reload' command in asterisk, asterisk crashes with a segmentation fault.

The last messages in asterisk's full log are:

Feb 20 10:53:50 VERBOSE[11134] logger.c:     -- Reloading module 'chan_misdn.so'
(Channel driver for mISDN Support (Bri/Pri))
Feb 20 10:53:50 WARNING[11134] chan_misdn.c: Dynamic Crypting Activation is not
support during reload at the moment
Feb 20 10:53:50 VERBOSE[11134] logger.c:   == Parsing '/etc/asterisk/misdn.conf'
: Feb 20 10:53:50 VERBOSE[11134] logger.c:   == Parsing '/etc/asterisk/misdn.con
f': Found


****** STEPS TO REPRODUCE ******

Start asterisk -vvvvvgc, enter 'reload'

****** ADDITIONAL INFORMATION ******

Asterisk 1.2.4-BRIstuffed-0.3.0-PRE-1k

*CLI> misdn show config
Misdn General-Config:
-> Version: chan_misdn-0.3.0-rc20
-> misdn_init: /etc/misdn-init.conf -> debug: 4
-> tracefile: /var/log/misdn.trace  -> bridging: no
-> stop_tone_after_first_digit: yes -> append_digits2exten: yes
-> dynamic_crypt: no                -> crypt_prefix:
-> crypt_keys:

[PORT 1]
-> name: intern                     -> rxgain: 0
-> txgain: 0                        -> te_choose_channel: no
-> pmp_l1_check: yes                -> context: from-internal
-> language: de                     -> musicclass: default
-> callerid:                        -> method: standard
-> dialplan: 0                      -> localdialplan: 0
-> nationalprefix: 0                -> internationalprefix: 00
-> presentation: -1                 -> screen: -1
-> always_immediate: no             -> immediate: no
-> senddtmf: yes                    -> hold_allowed: no
-> early_bconnect: yes              -> incoming_early_audio: no
-> echocancel: 0                    -> echocancelwhenbridged: no
-> echotraining: 0                  -> need_more_infos: no
-> jitterbuffer: 1000               -> jitterbuffer_upper_threshold: 0
-> callgroup:                       -> pickupgroup:
-> msns: none                       -> ptp: no


[PORT 2]
-> name: extern                     -> rxgain: 0
-> txgain: 0                        -> te_choose_channel: no
-> pmp_l1_check: yes                -> context: from-pstn
-> language: de                     -> musicclass: default
-> callerid:                        -> method: standard
-> dialplan: 0                      -> localdialplan: 0
-> nationalprefix: 0                -> internationalprefix: 00
-> presentation: -1                 -> screen: -1
-> always_immediate: no             -> immediate: no
-> senddtmf: yes                    -> hold_allowed: no
-> early_bconnect: yes              -> incoming_early_audio: no
-> echocancel: 0                    -> echocancelwhenbridged: no
-> echotraining: 0                  -> need_more_infos: no
-> jitterbuffer: 1000               -> jitterbuffer_upper_threshold: 0
-> callgroup:                       -> pickupgroup:
-> msns: *                          -> ptp: no

(gdb) bt
#0  0x4b059e79 in free () from /lib/tls/libc.so.6
#1  0xb7c4c019 in _free_port_cfg () at misdn_config.c:240
#2  0xb7c4e5c6 in misdn_cfg_init (this_max_ports=0) at misdn_config.c:748
#3  0xb7c4e3ce in misdn_cfg_reload () at misdn_config.c:696
#4  0xb7c35ecc in reload_config () at chan_misdn.c:610
ASTERISK-1  0xb7c3dc26 in reload () at chan_misdn.c:3772
ASTERISK-2  0x0805bf4d in ast_module_reload (name=0x0) at loader.c:257
ASTERISK-3  0x08094aec in handle_reload (fd=1, argc=1, argv=0xbff86810) at cli.c:158
ASTERISK-4  0x08097dbb in ast_cli_command (fd=1, s=0x4b11f804 "") at cli.c:1364
ASTERISK-5  0x080c0e7b in main (argc=2, argv=0xbff86d34) at asterisk.c:1004
(gdb)    
Comments:By: Sven Fischer (sven) 2006-02-20 03:20:08.000-0600

In line 217 of msidn_config.c the buffer is too small. It should read

union misdn_cfg_pt* free_list[max_ports + 2];

since max_ports + 1 are all allocated. When freeing, line 234 checks for 0 pointer as end of free list. If all elements are allocated, the check fails, if there is no 0 behind the list.

By: crich (crich) 2006-02-20 15:07:49.000-0600

thanks sven for the detailed bug report, will fix that tommorrow.

By: crich (crich) 2006-02-22 09:49:09.000-0600

Have just commited your suggestion to trunk, i tried and it seems fine. Please try it out yourself too.

Thanks!

By: crich (crich) 2006-02-22 15:50:56.000-0600

fixed in trunk rev=10763. Thanks Sven!

By: Digium Subversion (svnbot) 2008-01-15 16:55:57.000-0600

Repository: asterisk
Revision: 10713

U   trunk/channels/chan_misdn.c
U   trunk/channels/misdn/isdn_lib.c
U   trunk/channels/misdn/isdn_msg_parser.c
U   trunk/channels/misdn_config.c

------------------------------------------------------------------------
r10713 | crichter | 2008-01-15 16:55:57 -0600 (Tue, 15 Jan 2008) | 1 line

fixed a ETSI violation (after RELEASE we need to RELEASE_COMPLETE (network side) one needs to upgread mISDNuser for that fix as well. also fixed the reload issue ASTERISK-6372
------------------------------------------------------------------------

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

By: Digium Subversion (svnbot) 2008-01-15 16:56:45.000-0600

Repository: asterisk
Revision: 10764

_U  team/group/autoconf_and_menuselect/
U   team/group/autoconf_and_menuselect/apps/app_skel.c
U   team/group/autoconf_and_menuselect/channels/chan_misdn.c
U   team/group/autoconf_and_menuselect/channels/misdn/isdn_lib.c
U   team/group/autoconf_and_menuselect/channels/misdn/isdn_msg_parser.c
U   team/group/autoconf_and_menuselect/configs/iax.conf.sample

------------------------------------------------------------------------
r10764 | russell | 2008-01-15 16:56:44 -0600 (Tue, 15 Jan 2008) | 27 lines

Merged revisions 10691,10713,10737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r10691 | tilghman | 2006-02-21 22:04:42 -0500 (Tue, 21 Feb 2006) | 2 lines

Updating skel application to use current parsing constructs

................
r10713 | crichter | 2006-02-22 11:48:25 -0500 (Wed, 22 Feb 2006) | 1 line

fixed a ETSI violation (after RELEASE we need to RELEASE_COMPLETE (network side) one needs to upgread mISDNuser for that fix as well. also fixed the reload issue ASTERISK-6372
................
r10737 | kpfleming | 2006-02-22 12:33:38 -0500 (Wed, 22 Feb 2006) | 10 lines

Merged revisions 10511,10535,10736 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r10736 | kpfleming | 2006-02-22 11:32:15 -0600 (Wed, 22 Feb 2006) | 2 lines

add comment warning people about trying to use hostnames/IPs in the sample config

........

................

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

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