[Home]

Summary:ASTERISK-10956: Memory Leak when running asterisk -rx "xxxxxx"
Reporter:Alisher (licedey)Labels:
Date Opened:2007-12-03 10:03:13.000-0600Date Closed:2007-12-05 11:47:34.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:There is a memory leak, when we use asterisk -rx too often:

To reproduce the bug, you have to enable the threadstorage debugging:

make menuselect
     -->10.Compile Flags
    [X] 4. DEBUG_THREADLOCALS
    save
make clean && make && make install

restart asterisk

from console run:
asterisk -rx "threadstorage show allocations utils.c"

Everytime you run it, the number of allocated threads will grow.







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

I wrote a bash script, that runs asteirsk -rx 3000 times, and compared the memory info before and after launching the script. So there is memory leak. There is also another memory leaks in chan_sip.c that can be tracked by threadstorage debuging.

#!/bin/bash

var0=0
LIMIT=30000

while [ "$var0" -lt "$LIMIT" ]

do
 asterisk -rx 'help' | grep utils.c
 echo $var0
 var0=`expr $var0 + 1
done
echo

exit 0
Comments:By: Digium Subversion (svnbot) 2007-12-05 11:46:20.000-0600

Repository: asterisk
Revision: 91197

_U  trunk/
U   trunk/main/threadstorage.c

------------------------------------------------------------------------
r91197 | russell | 2007-12-05 11:46:19 -0600 (Wed, 05 Dec 2007) | 18 lines

Merged revisions 91192 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r91192 | russell | 2007-12-05 11:31:42 -0600 (Wed, 05 Dec 2007) | 10 lines

Make the lock in the threadstorage debugging code untracked to avoid a deadlock
on thread destruction.

(closes issue ASTERISK-10728)
Reported by: ys
Patches:
     threadstorage.c.diff uploaded by ys (license 281)

Also fixes an open bug report: (closes issue ASTERISK-10956)

........

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

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

By: Digium Subversion (svnbot) 2007-12-05 11:47:34.000-0600

Repository: asterisk
Revision: 91192

U   branches/1.4/main/threadstorage.c

------------------------------------------------------------------------
r91192 | russell | 2007-12-05 11:31:42 -0600 (Wed, 05 Dec 2007) | 10 lines

Make the lock in the threadstorage debugging code untracked to avoid a deadlock
on thread destruction.

(closes issue ASTERISK-10728)
Reported by: ys
Patches:
     threadstorage.c.diff uploaded by ys (license 281)

Also fixes an open bug report: (closes issue ASTERISK-10956)

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

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