[Home]

Summary:ASTERISK-14979: [patch] Asterisk crashes after "core stop gracefully"
Reporter:Alexander Heinz (alexanderheinz)Labels:
Date Opened:2009-10-13 10:20:55Date Closed:2010-02-19 13:07:14.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20091109__issue16062.diff.txt
( 1) bt-corestopgracefully.txt
( 2) gdb.txt
Description:I have tried to compile and install Asterisk SVN on a fresh copy of Debian stable. This system has 254728k of RAM and 746980k of swap (is this enough to compile Asterisk? Are there any error messages, if the system runs into memory problems?). Compilation process seems to run smoothly.

If I start asterisk and then try to quit it using "core stop gracefully", there is a segmentation fault.

gdb info is attached.


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

my system has 254728k of RAM, 746980k of swap, 50GB of free disk space, CPU is Intel Pentium 4 CPU 2.00GHz
Comments:By: Alexander Heinz (alexanderheinz) 2009-10-14 05:28:29

Update:
Because of the information provided by the output of gdb (chan_iax2.c was mentioned) I have tried the following:
If I do a "module unload chan_iax2.so" before "core stop gracefully", then the segmentation fault is gone.

By: Elazar Broad (ebroad) 2009-10-14 11:39:04

It's intermittent, but it does happen on my system as well, though my backtrace is different, it looks like a double-free in cdr_mysql::my_unload_module().

Edit: Backtrace attached.



By: Tilghman Lesher (tilghman) 2009-11-09 00:32:25.000-0600

Patch uploaded which should fix this crash issue.

By: Digium Subversion (svnbot) 2009-11-09 01:43:41.000-0600

Repository: asterisk
Revision: 228798

U   trunk/addons/cdr_mysql.c
U   trunk/channels/chan_console.c
U   trunk/main/event.c
U   trunk/main/loader.c
U   trunk/res/res_pktccops.c

------------------------------------------------------------------------
r228798 | tilghman | 2009-11-09 01:43:40 -0600 (Mon, 09 Nov 2009) | 14 lines

Fix various problems detected with Valgrind.
* chan_console accessed pvts after deallocation.
* cdr_mysql stored a pointer that was freed by realloc()
* The module loader did not check usecount on shutdown, which led to chan_iax2
reading a timer that was already unloaded.
* The event subsystem sometimes creates an event with no IEs.  Due to a corner
condition, the code would read beyond the memory boundary.
* res_pktccops did not correctly check whether its monitor thread was started.
(closes issue ASTERISK-14979)
Reported by: alexanderheinz
Patches:
      20091109__issue16062.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman

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

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

By: Digium Subversion (svnbot) 2010-02-19 13:05:01.000-0600

Repository: asterisk
Revision: 248008

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_console.c
U   branches/1.6.0/main/loader.c

------------------------------------------------------------------------
r248008 | tilghman | 2010-02-19 13:04:57 -0600 (Fri, 19 Feb 2010) | 20 lines

Merged revisions 228798 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

(closes issue ASTERISK-14176)
Reported by: kjotte

........
 r228798 | tilghman | 2009-11-09 01:37:52 -0600 (Mon, 09 Nov 2009) | 14 lines
 
 Fix various problems detected with Valgrind.
  * chan_console accessed pvts after deallocation.
  * The module loader did not check usecount on shutdown, which led to chan_iax2
  reading a timer that was already unloaded.
 (closes issue ASTERISK-14979)
  Reported by: alexanderheinz
  Patches:
        20091109__issue16062.diff.txt uploaded by tilghman (license 14)
  Tested by: tilghman
........

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

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

By: Digium Subversion (svnbot) 2010-02-19 13:05:37.000-0600

Repository: asterisk
Revision: 248009

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_console.c
U   branches/1.6.1/main/loader.c

------------------------------------------------------------------------
r248009 | tilghman | 2010-02-19 13:05:35 -0600 (Fri, 19 Feb 2010) | 20 lines

Merged revisions 228798 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

(closes issue ASTERISK-14176)
Reported by: kjotte

........
 r228798 | tilghman | 2009-11-09 01:37:52 -0600 (Mon, 09 Nov 2009) | 14 lines
 
 Fix various problems detected with Valgrind.
  * chan_console accessed pvts after deallocation.
  * The module loader did not check usecount on shutdown, which led to chan_iax2
  reading a timer that was already unloaded.
 (closes issue ASTERISK-14979)
  Reported by: alexanderheinz
  Patches:
        20091109__issue16062.diff.txt uploaded by tilghman (license 14)
  Tested by: tilghman
........

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

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

By: Digium Subversion (svnbot) 2010-02-19 13:07:13.000-0600

Repository: asterisk
Revision: 248011

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_console.c
U   branches/1.6.2/main/loader.c

------------------------------------------------------------------------
r248011 | tilghman | 2010-02-19 13:07:12 -0600 (Fri, 19 Feb 2010) | 17 lines

Merged revisions 228798 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r228798 | tilghman | 2009-11-09 01:37:52 -0600 (Mon, 09 Nov 2009) | 14 lines
 
 Fix various problems detected with Valgrind.
  * chan_console accessed pvts after deallocation.
  * The module loader did not check usecount on shutdown, which led to chan_iax2
  reading a timer that was already unloaded.
 (closes issue ASTERISK-14979)
  Reported by: alexanderheinz
  Patches:
        20091109__issue16062.diff.txt uploaded by tilghman (license 14)
  Tested by: tilghman
........

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

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