On Mon, May 06, 2013 at 10:45:08AM +0200, Holger Hans Peter Freyther wrote:
Hi,
with the BFIlevel set high enough (or another fix) on
the BTS side,
the stress test branch of OpenBSC and this shell script the issue
should be re-producable.
it is a "genuine" leak and there are several issues.
1.) lapd_core be like the logging/msgb code and have a setter for
the talloc context. See the attached diff. (I used gdb to break
in malloc and typed bt and saw a ctx=0x8 passed to talloc).
2.) Consider attaching the log_info to the lapdm_channel. I say
consider as currently we are embedding the lapdm_channel in the
lchan struct. So this is something we can not do right now.
3.) common/rsl.c calls lapdm_channel_reset which will not
talloc_free the tx_hist. lapdm_channel_exit will do that. The
call to lapdm_channel_reset was introduced in 2011.
4.) lchan_activate will call lapdm_channel_init which will
end up call into lapd_dl_init which re-allocates the tx_hist.
5.) We should find a way to group all VTY allocations into
a single block (e.g. see if we can have a vector/cmd_desc
without a named context).
I will clean this up in the coming days
holger