Project

General

Profile

Bug #2801

svc.startd leaks significant amount of memory

Added by Milan Jurik over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
cmd - userland programs
Start date:
2012-05-29
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

From OI prestable2 SMF does not work well with pkg/server. It starts pkg.depotd but then thinks it ended and tries to restart it.

As the side effect it leaks memory like mad with this stack:

CACHE LEAKED BUFCTL CALLER
080ed390 76476 081131a8 libc_hwcap1.so.1`strdup+0x26
080ed390 1 086d38a0 libc_hwcap1.so.1`strdup+0x26
080f8a90 8 081d0590 librestart.so.1`lookup_pwd+0x79
080f8a90 76367 08233518 librestart.so.1`lookup_pwd+0x79
080fc710 76068 081470c0 librestart.so.1`restarter_get_method_context+0xdc
080fc710 1 08610c38 libuutil.so.1`uu_zalloc+0x21
------------------------------------------------------------------------
Total 228921 buffers, 434865168 bytes


Files

leak.patch (898 Bytes) leak.patch suggested fix Milan Jurik, 2012-06-20 07:33 PM

Related issues

Related to illumos gate - Feature #2831: bring Joyent/SmartOS OS-1186 and OS-1187 to IllumosResolvedMilan Jurik2012-06-04

Actions
#1

Updated by Milan Jurik over 8 years ago

081131a8::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
81131a8 8111620 14b97b0d459bfe 19
80ed390 0 80c3ce8
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x153
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
libc_hwcap1.so.1`strdup+0x26
librestart.so.1`restarter_get_method_context+0x49a
method_run+0x29b
method_thread+0x184
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start

086d38a0::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
86d38a0 86d1840 14b97ba4b9c7f1 151
80ed390 0 0
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x19a
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
libc_hwcap1.so.1`strdup+0x26
librestart.so.1`restarter_get_method_context+0x49a
method_run+0x29b
method_thread+0x184
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start

081d0590::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
81d0590 81ddb40 14b97b3c739eda 75
80f8a90 0 80b2e88
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x153
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
librestart.so.1`lookup_pwd+0x79
librestart.so.1`restarter_get_method_context+0x404
method_run+0x29b
method_thread+0x184
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start

08233518::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
8233518 82357c0 14b97b1695b955 32
80f8a90 0 0
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x19a
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
librestart.so.1`lookup_pwd+0x79
librestart.so.1`restarter_get_method_context+0x404
method_run+0x29b
method_thread+0x184
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start

081470c0::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
81470c0 8155a00 14b97b0d39ec5b 19
80fc710 0 80b25c8
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x153
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
librestart.so.1`restarter_get_method_context+0xdc
method_run+0x29b
method_thread+0x184
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start

08610c38::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
8610c38 860ee00 14b97cdd052be4 8
80fc710 0 80b0000
libumem.so.1`umem_cache_alloc_debug+0x144
libumem.so.1`umem_cache_alloc+0x153
libumem.so.1`umem_alloc+0xcd
libumem.so.1`malloc+0x2a
libuutil.so.1`uu_zalloc+0x21
libscf.so.1`scf_value_create+0x2d
libscf_object_create+0x14
libscf_extract_runlevel+0x1d
dgraph_set_runlevel+0x16
process_pg_event+0x221
repository_event_thread+0xc2
libc_hwcap1.so.1`_thrp_setup+0x9b
libc_hwcap1.so.1`_lwp_start
#2

Updated by Robert Mustacchi over 8 years ago

The upcoming push of SmartOS will be syncing out changes to startd and configd that clean up memory leaks and excessive memory usage. You may want to just pull those in.

#3

Updated by Milan Jurik over 8 years ago

  • Status changed from New to In Progress

From investigation I think it is the same issue as SmartOS 1188. I am not sure about the last leak yet.

#4

Updated by Milan Jurik over 8 years ago

  • % Done changed from 0 to 60

The last leak is in libscf_extract_runlevel(), val returned from safe_scf_value_create() - libscf_object_create() is not freed.

#5

Updated by Milan Jurik over 8 years ago

After integration of #2831 only the last leak is resolved here.

#6

Updated by Milan Jurik over 8 years ago

  • Status changed from In Progress to Pending RTI
#7

Updated by Rich Lowe over 8 years ago

  • Status changed from Pending RTI to Resolved

Resolved in r13738 commit:e10d315d1821

Also available in: Atom PDF