[OmniOS-discuss] ILB memory leak?
Al Slater
al.slater at scluk.com
Tue Nov 10 07:40:17 UTC 2015
On 06/11/2015 18:33, Bob Friesenhahn wrote:
> Tracing mmap() calls on the program while is is running might reveal
> something.
Tracing mmap calls with dtrace gives me the following stack, called
roughly the same number of times as there are doubled-in-size anon
mappings in the mmap output.
libc.so.1`mmap
libc.so.1`lmalloc+0x168
libc.so.1`posix_spawn_file_actions_addclose+0x2f
ilbd`ilbd_run_probe+0x19b
ilbd`ilbd_hc_probe_timer+0x10
Looking at the source for lmalloc (1), it implements the allocation
attributes we are seeing.
Now, looking at posix_spawn_file_actions_addclose (2), this allocates a
file_attr_t which is added to the file_actions list (which was stack
allocated as fd_actions in ilbd_run_probe (3) and inititialized with
posix_spawn_file_actions_init.
After fd_actions is passed to posix_spawn, I can't see anywhere calling
posix_spawn_file_actions_destroy to clean up the list.
It seems to me that ilbd_run_probe just needs to call
posix_spawn_file_actions_destroy appropriately.
(1) /usr/src/lib/libc/port/threads/alloc.c
(2) /usr/src/lib/libc/port/threads/spawn.c
(3) /usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c
--
Al Slater
More information about the OmniOS-discuss
mailing list