[Home]

Summary:ASTERISK-13738: [patch] unfreed memory in Local channel
Reporter:caspy (caspy)Labels:
Date Opened:2009-03-12 17:23:28Date Closed:2009-03-16 12:38:51
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_local
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090313__bug14656__2.diff.txt
Description:*CLI> core show uptime
System uptime: 2 days, 1 hour, 55 minutes, 14 seconds
Last reload: 2 days, 1 hour, 55 minutes, 14 seconds

*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
105093 calls processed

*CLI> local show channels
No local channels in use

*CLI> core show locks
[no locks showed]

*CLI> memory show summary chan_local.c
       63 bytes in 4 allocations in function 'local_call' of 'chan_local.c'
  2676284 bytes in 6253 allocations in function 'local_alloc' of 'chan_local.c'
2676347 bytes allocated in 6257 allocations

*CLI> memory show allocations chan_local.c
      428 bytes allocated in          local_alloc at line   615 of chan_local.c
...
...
      428 bytes allocated in          local_alloc at line   615 of chan_local.c
      428 bytes allocated in          local_alloc at line   615 of chan_local.c
2677568 bytes allocated in 6256 allocations


what are these 6256 allocations? why mem not being freed after channel has gone? Local channel used actively.

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

also, i have many allocations like this:

*CLI> memory show summary astobj2.c
      444 bytes in 37 allocations in function 'ao2_link' of 'astobj2.c'
  9063084 bytes in 37674 allocations in function 'ao2_alloc' of 'astobj2.c'
9063528 bytes allocated in 37711 allocations

(i can't yet understand are they correlate)
Comments:By: Tilghman Lesher (tilghman) 2009-03-13 12:17:02

Patch uploaded.  Please test and report back if this fixes your issue.

By: caspy (caspy) 2009-03-13 14:44:42

i have installed patch just now.
i'll report in a couple of days or sooner.

By: caspy (caspy) 2009-03-13 15:22:15

seems not to be enought:

*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
43 calls processed

*CLI> local show channels
No local channels in use

*CLI> memory show summary chan_local.c
      856 bytes in 2 allocations in function 'local_alloc' of 'chan_local.c'
856 bytes allocated in 2 allocations

*CLI> memory show allocations chan_local.c
      428 bytes allocated in          local_alloc at line   617 of chan_local.c
      428 bytes allocated in          local_alloc at line   617 of chan_local.c
856 bytes allocated in 2 allocations

By: Tilghman Lesher (tilghman) 2009-03-13 19:04:38

Okay, patch updated.

By: caspy (caspy) 2009-03-16 06:19:57

Yes, things are going to be all right now:

*CLI> core show uptime
System uptime: 2 days, 2 hours, 10 minutes, 56 seconds
Last reload: 2 days, 2 hours, 10 minutes, 56 seconds

*CLI> local show channels
No local channels in use

*CLI> memory show summary chan_local.c
0 bytes allocated in 0 allocations


Thank you!

By: Digium Subversion (svnbot) 2009-03-16 10:39:17

Repository: asterisk
Revision: 182208

U   branches/1.4/channels/chan_local.c

------------------------------------------------------------------------
r182208 | tilghman | 2009-03-16 10:39:16 -0500 (Mon, 16 Mar 2009) | 7 lines

Fixup glare detection, to fix a memory leak of a local pvt structure.
(closes issue ASTERISK-13738)
Reported by: caspy
Patches:
      20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
Tested by: caspy

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

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

By: Digium Subversion (svnbot) 2009-03-16 10:50:56

Repository: asterisk
Revision: 182211

_U  trunk/
U   trunk/channels/chan_local.c

------------------------------------------------------------------------
r182211 | tilghman | 2009-03-16 10:50:55 -0500 (Mon, 16 Mar 2009) | 14 lines

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

........
 r182208 | tilghman | 2009-03-16 10:39:15 -0500 (Mon, 16 Mar 2009) | 7 lines
 
 Fixup glare detection, to fix a memory leak of a local pvt structure.
 (closes issue ASTERISK-13738)
  Reported by: caspy
  Patches:
        20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
  Tested by: caspy
........

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

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

By: Digium Subversion (svnbot) 2009-03-16 11:09:11

Repository: asterisk
Revision: 182212

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_local.c

------------------------------------------------------------------------
r182212 | tilghman | 2009-03-16 11:09:11 -0500 (Mon, 16 Mar 2009) | 21 lines

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

................
 r182211 | tilghman | 2009-03-16 10:50:55 -0500 (Mon, 16 Mar 2009) | 14 lines
 
 Merged revisions 182208 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r182208 | tilghman | 2009-03-16 10:39:15 -0500 (Mon, 16 Mar 2009) | 7 lines
   
   Fixup glare detection, to fix a memory leak of a local pvt structure.
   (closes issue ASTERISK-13738)
    Reported by: caspy
    Patches:
          20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
    Tested by: caspy
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-03-16 12:38:51

Repository: asterisk
Revision: 182280

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_local.c
U   branches/1.6.1/funcs/func_env.c

------------------------------------------------------------------------
r182280 | tilghman | 2009-03-16 12:38:51 -0500 (Mon, 16 Mar 2009) | 30 lines

Merged revisions 182211,182278 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r182211 | tilghman | 2009-03-16 10:50:55 -0500 (Mon, 16 Mar 2009) | 14 lines
 
 Merged revisions 182208 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r182208 | tilghman | 2009-03-16 10:39:15 -0500 (Mon, 16 Mar 2009) | 7 lines
   
   Fixup glare detection, to fix a memory leak of a local pvt structure.
   (closes issue ASTERISK-13738)
    Reported by: caspy
    Patches:
          20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
    Tested by: caspy
 ........
................
 r182278 | tilghman | 2009-03-16 12:33:38 -0500 (Mon, 16 Mar 2009) | 7 lines
 
 Fix an off-by-one error in the FILE() function, and extend FILE()'s length parameter to work like variable substitution.
 Previously, FILE() returned one less character than specified, due to the
 terminating NULL.  Both the offset and length parameters now behave
 identically to the way variable substitution offsets and lengths also work.
 (closes issue ASTERISK-13752)
  Reported by: BMC
................

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

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