Project

General

Profile

Actions

Bug #2948

closed

'log gsmtap' leaks memory

Added by neels about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
02/15/2018
Due date:
% Done:

100%

Spec Reference:

Description

This is most visible in osmo-mgw, with 'log gsmtap' at 'logging level all debug', with an ongoing call.

With a voice call ongoing, osmo-mgw's memory footprint grows continuously.
After the call is concluded, the memory usage is not released.
A few minutes into the call, each osmo-mgw hogs gigabytes of memory.

Since this only starts with gsmtap logging enabled, I assume it is a gsmtap leak, not limited to osmo-mgw.
I added the 'show talloc-context' vty commands to osmo-mgw:

OsmoMGW(config-log)# do show talloc-context application brief 
talloc report on 'mgcp-callagent' (total 5826551 bytes in 1350 blocks)
  telnet_connection              contains     89 bytes in   2 blocks (ref 0) 0x55ac08b63770
  osmo-mgw-for-msc.cfg           contains     21 bytes in   1 blocks (ref 0) 0x55ac08b63d40
  msgb                           contains 5826440 bytes in 1346 blocks (ref 0) 0x55ac08ada180
OsmoMGW(config-log)# do show talloc-context application full  
full talloc report on 'mgcp-callagent' (total 31025795 bytes in 7167 blocks)
  telnet_connection              contains     89 bytes in   2 blocks (ref 0) 0x55ac08b63770
    struct telnet_connection       contains     88 bytes in   1 blocks (ref 0) 0x55ac08b655a0
  osmo-mgw-for-msc.cfg           contains     21 bytes in   1 blocks (ref 0) 0x55ac08b63d40
  msgb                           contains 31025684 bytes in 7163 blocks (ref 0) 0x55ac08ada180
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9cc530
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9cb3d0
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9ca270
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c9110
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c7fb0
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c6e50
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c5cf0
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c4b90
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c3a30
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c28d0
    GSMTAP logging                 contains   4332 bytes in   1 blocks (ref 0) 0x55ac0a9c1770

Furthermore, this only seems to occur when setting an explicit IP address other than 127.0.0.1, i.e. with 'log gsmtap 127.0.0.8' instead of just 'log gsmtap' or 'log gsmtap 127.0.0.1'

Actions #1

Updated by neels about 6 years ago

  • Assignee set to neels
  • % Done changed from 0 to 90
remote: New Changes:
remote:   https://gerrit.osmocom.org/6512 gsmtap_sendmsg(): clarify API doc concerning msgb ownership
remote:   https://gerrit.osmocom.org/6513 memleak: gsmtap_sendmsg(): don't return 0 when no data was written
remote:   https://gerrit.osmocom.org/6514 memleak: fix all libosmocore callers of gsmtap_sendmsg() to free on failure
remote:   https://gerrit.osmocom.org/6515 memleak: _gsmtap_raw_output(): free msg in case of vsnprintf failure
remote: 
To ssh://go/libosmocore
 * [new branch]        HEAD -> refs/for/master/gsmtap_leaks
Actions #2

Updated by neels about 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 90 to 100

all merged

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)