Project

General

Profile

Bug #7730

libzfs`add_config() leaks config nvl when reading spare/l2cache devices

Added by Yuri Pankov over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2017-01-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

antares:root:~# mdb /usr/sbin/zpool
> ::sysbp _exit
> ::run import
   pool: data
     id: 2093977168778024605
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        data        ONLINE
          c6t0d0    ONLINE
          c6t1d0    ONLINE
        cache
          c6t2d0
mdb: stop on entry to _exit
mdb: target stopped at:
0xfee556ba:     nop
mdb: You've got symbols!
Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1 libnvpair.so.1 ]
> ::findleaks -d
BYTES             LEAKED VMEM_SEG CALLER
4096                  10 fda7b000 MMAP
8192                   1 fea8d000 MMAP
8192                   1 fe76d000 MMAP
8192                   1 fe66e000 MMAP
4096                   1 fe570000 MMAP
8192                   1 fe470000 MMAP
4096                   1 fe372000 MMAP
4096                   1 fe273000 MMAP
8192                   1 fe173000 MMAP
4096                   1 fde77000 MMAP
------------------------------------------------------------------------
           Total      10 oversized leaks, 61440 bytes

CACHE     LEAKED   BUFCTL CALLER
080cb590       1 080f6010 libnvpair.so.1`nv_alloc_sys+0x1b
080cb590       1 080f6088 libnvpair.so.1`nv_alloc_sys+0x1b
080cd590       3 082a33f8 libnvpair.so.1`nv_alloc_sys+0x1b
------------------------------------------------------------------------
   Total       5 buffers, 208 bytes

mmap(2) leak: [fda7b000, fda7c000), 4096 bytes
mmap(2) leak: [fea8d000, fea8f000), 8192 bytes
mmap(2) leak: [fe76d000, fe76f000), 8192 bytes
mmap(2) leak: [fe66e000, fe670000), 8192 bytes
mmap(2) leak: [fe570000, fe571000), 4096 bytes
mmap(2) leak: [fe470000, fe472000), 8192 bytes
mmap(2) leak: [fe372000, fe373000), 4096 bytes
mmap(2) leak: [fe273000, fe274000), 4096 bytes
mmap(2) leak: [fe173000, fe175000), 8192 bytes
mmap(2) leak: [fde77000, fde78000), 4096 bytes
umem_alloc_32 leak: 1 buffer, 32 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         80f6010          80f2c38      5cc3c226dbb                9
                          80cb590          809b190                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`umem_malloc+0x36
                 libnvpair.so.1`nv_alloc_sys+0x1b
                 libnvpair.so.1`nv_priv_alloc+0x13
                 libnvpair.so.1`nvlist_xalloc+0x1c
                 libnvpair.so.1`nvlist_xunpack+0x34
                 libnvpair.so.1`nvlist_unpack+0x29
                 libzfs.so.1`zpool_read_label+0x126
                 libzfs.so.1`zpool_open_func+0xe3
                 libc_hwcap2.so.1`tpool_worker+0x1b2
                 libc_hwcap2.so.1`_thrp_setup+0x88
                 libc_hwcap2.so.1`_lwp_start

umem_alloc_32 leak: 1 buffer, 32 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         80f6088          80f2c08      5cc3c2285df                9
                          80cb590          809b1f4                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`umem_malloc+0x36
                 libnvpair.so.1`nv_alloc_sys+0x1b
                 libnvpair.so.1`nv_mem_zalloc+0x25
                 libnvpair.so.1`nvlist_xalloc+0x37
                 libnvpair.so.1`nvlist_xunpack+0x34
                 libnvpair.so.1`nvlist_unpack+0x29
                 libzfs.so.1`zpool_read_label+0x126
                 libzfs.so.1`zpool_open_func+0xe3
                 libc_hwcap2.so.1`tpool_worker+0x1b2
                 libc_hwcap2.so.1`_thrp_setup+0x88
                 libc_hwcap2.so.1`_lwp_start

umem_alloc_48 leak: 3 buffers, 48 bytes each, 144 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         82a33f8          82a0f80      5cc3c22a29a                9
                          80cd590          809b258                0
                 libumem.so.1`umem_cache_alloc_debug+0x1fe
                 libumem.so.1`umem_cache_alloc+0x18f
                 libumem.so.1`umem_alloc+0x50
                 libumem.so.1`umem_malloc+0x36
                 libnvpair.so.1`nv_alloc_sys+0x1b
                 libnvpair.so.1`nv_mem_zalloc+0x25
                 libnvpair.so.1`nvp_buf_alloc+0x19
                 libnvpair.so.1`nvs_decode_pairs+0x3c
                 libnvpair.so.1`nvs_operation+0x5e
                 libnvpair.so.1`nvs_xdr+0x53
                 libnvpair.so.1`nvlist_common+0xc5
                 libnvpair.so.1`nvlist_xunpack+0x53
                 libnvpair.so.1`nvlist_unpack+0x29
                 libzfs.so.1`zpool_read_label+0x126
                 libzfs.so.1`zpool_open_func+0xe3

Related issues

Has duplicate illumos gate - Bug #6120: libzfs leaks a config nvlist for spares and l2arcClosed2015-08-12

Actions

History

#1

Updated by Electric Monk over 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

git commit 105686550ee9cbf5d033166a8a2a5a763667d436

commit  105686550ee9cbf5d033166a8a2a5a763667d436
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2017-01-13T18:18:20.000Z

    7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

#2

Updated by Yuri Pankov over 2 years ago

  • Has duplicate Bug #6120: libzfs leaks a config nvlist for spares and l2arc added

Also available in: Atom PDF