public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/26123] New: Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE
@ 2020-06-16 17:56 agentzh at gmail dot com
  2020-06-16 18:13 ` [Bug runtime/26123] " agentzh at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: agentzh at gmail dot com @ 2020-06-16 17:56 UTC (permalink / raw)
  To: systemtap

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug runtime/26123] Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE
  2020-06-16 17:56 [Bug runtime/26123] New: Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE agentzh at gmail dot com
@ 2020-06-16 18:13 ` agentzh at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: agentzh at gmail dot com @ 2020-06-16 18:13 UTC (permalink / raw)
  To: systemtap

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-16 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 17:56 [Bug runtime/26123] New: Use of VMA tracker would leak kernel slab memory for modern kernels without CONFIG_UTRACE agentzh at gmail dot com
2020-06-16 18:13 ` [Bug runtime/26123] " agentzh at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).