[Bug runtime/26123] New: Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug runtime/26123] New: Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE

Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26123

            Bug ID: 26123
           Summary: Use of VMA tracker would leak kernel slab memory for
                    modern kernels without CONFIG_UTRACE
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

In the systemtap runtime, the stap_destroy_vma_map() function is never called
by _stp_vma_done() for modern kernels without `CONFIG_UTRACE` because the
former is guarded by the `CONFIG_UTRACE` macro. Thus the kernel slab memory
allocated in _stp_vma_init() through stap_initialize_vma_map() is never
released. The `stap_initialize_vma_map()` call is guarded, correctly, by the
`HAVE_TASK_FINDER` macro.

Even simplest .stp scripts involved with vma would reproduce the leak. We saw
giga bytes of Slab memory leaked in `/proc/meminfo` for boxes with a lot of
stap scripts runs. And stap's own `-DDEBUG_MEM` facility can successfully catch
the leak with the following dmesg output, for example:

```
[253908.065199] SYSTEMTAP ERROR: Memory ffff8cbb75523320 len=112 allocation
type: kmalloc. Not freed.
[253908.065203] SYSTEMTAP ERROR: Memory ffff8cbb75522f20 len=112 allocation
type: kmalloc. Not freed.
[253908.065204] SYSTEMTAP ERROR: Memory ffff8cbb75523220 len=112 allocation
type: kmalloc. Not freed.
[253908.065205] SYSTEMTAP ERROR: Memory ffff8cbb75523720 len=112 allocation
type: kmalloc. Not freed.
[253908.065206] SYSTEMTAP ERROR: Memory ffff8cbb75522c20 len=112 allocation
type: kmalloc. Not freed.
[253908.065207] SYSTEMTAP ERROR: Memory ffff8cbb75522220 len=112 allocation
type: kmalloc. Not freed.
[253908.065208] SYSTEMTAP ERROR: Memory ffff8cbb75522520 len=112 allocation
type: kmalloc. Not freed.
[253908.065209] SYSTEMTAP ERROR: Memory ffff8cbb75522120 len=112 allocation
type: kmalloc. Not freed.
[253908.065210] SYSTEMTAP ERROR: Memory ffff8cbb75523520 len=112 allocation
type: kmalloc. Not freed.
[253908.065210] SYSTEMTAP ERROR: Memory ffff8cbb75523f20 len=112 allocation
type: kmalloc. Not freed.
[253908.065211] SYSTEMTAP ERROR: Memory ffff8cbb75522620 len=112 allocation
type: kmalloc. Not freed.
[253908.065212] SYSTEMTAP ERROR: Memory ffff8cbb75523820 len=112 allocation
type: kmalloc. Not freed.
[253908.065213] SYSTEMTAP ERROR: Memory ffff8cbb75522820 len=112 allocation
type: kmalloc. Not freed.
[253908.065265] SYSTEMTAP ERROR: Memory ffff8cbb75522720 len=112 allocation
type: kmalloc. Not freed.
[253908.065266] SYSTEMTAP ERROR: Memory ffff8cbb75523b20 len=112 allocation
type: kmalloc. Not freed.
[253908.065267] SYSTEMTAP ERROR: Memory ffff8cb9ec1dff20 len=128 allocation
type: kmalloc. Not freed.
```

I'll commit a patch today to address this issue.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug runtime/26123] Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE

Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26123

agentzh <agentzh at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from agentzh <agentzh at gmail dot com> ---
Fixed in commit fb59e8c75.

--
You are receiving this mail because:
You are the assignee for the bug.