All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* bug: frozen map leaks
@ 2020-10-02 22:32 Alexei Starovoitov
  2020-10-02 22:46 ` Stanislav Fomichev
  0 siblings, 1 reply; 3+ messages in thread
From: Alexei Starovoitov @ 2020-10-02 22:32 UTC (permalink / raw
  To: bpf, Andrii Nakryiko, Martin KaFai Lau, Stanislav Fomichev

Hi,

after successful test_progs run I see a bunch of leaked maps:
# bpftool m s
3: array  name iterator.rodata  flags 0x480
    key 4B  value 98B  max_entries 1  memlock 8192B
    btf_id 4  frozen
9: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 145B  max_entries 1  memlock 8192B
    btf_id 13  frozen
12: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 144B  max_entries 1  memlock 8192B
    btf_id 14  frozen
13: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 85B  max_entries 1  memlock 8192B
    btf_id 15  frozen
14: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 45B  max_entries 1  memlock 8192B
    btf_id 16  frozen
15: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 40B  max_entries 1  memlock 8192B
    btf_id 17  frozen
17: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 55B  max_entries 1  memlock 8192B
    btf_id 18  frozen
19: array  name bpf_iter.rodata  flags 0x480
    key 4B  value 14B  max_entries 1  memlock 8192B
    btf_id 19  frozen

Andrii,
I suspect it's due to libbpf doing BPF_PROG_BIND_MAP now.

Stanislav,
could you take a look ?

Thanks!

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

* Re: bug: frozen map leaks
  2020-10-02 22:32 bug: frozen map leaks Alexei Starovoitov
@ 2020-10-02 22:46 ` Stanislav Fomichev
  2020-10-03  0:28   ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Fomichev @ 2020-10-02 22:46 UTC (permalink / raw
  To: Alexei Starovoitov; +Cc: bpf, Andrii Nakryiko, Martin KaFai Lau

> after successful test_progs run I see a bunch of leaked maps:
> # bpftool m s
> 3: array  name iterator.rodata  flags 0x480
>     key 4B  value 98B  max_entries 1  memlock 8192B
>     btf_id 4  frozen
> 9: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 145B  max_entries 1  memlock 8192B
>     btf_id 13  frozen
> 12: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 144B  max_entries 1  memlock 8192B
>     btf_id 14  frozen
> 13: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 85B  max_entries 1  memlock 8192B
>     btf_id 15  frozen
> 14: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 45B  max_entries 1  memlock 8192B
>     btf_id 16  frozen
> 15: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 40B  max_entries 1  memlock 8192B
>     btf_id 17  frozen
> 17: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 55B  max_entries 1  memlock 8192B
>     btf_id 18  frozen
> 19: array  name bpf_iter.rodata  flags 0x480
>     key 4B  value 14B  max_entries 1  memlock 8192B
>     btf_id 19  frozen
>
> Andrii,
> I suspect it's due to libbpf doing BPF_PROG_BIND_MAP now.
>
> Stanislav,
> could you take a look ?
Interesting. I can reproduce with 'test_progs -t snprintf_btf':

5: array  name netif_re.rodata  flags 0x480
        key 4B  value 13312B  max_entries 1  memlock 20480B
        btf_id 5  frozen
10: array  name pid_iter.rodata  flags 0x480
        key 4B  value 4B  max_entries 1  memlock 8192B
        btf_id 10  frozen
        pids bpftool(276)
11: array  flags 0x0
        key 4B  value 32B  max_entries 1  memlock 4096B

I suppose we do BPF_PROG_BIND_MAP only to #11, so I'm puzzled why
rodata is also leaking.
Will try to take a look!

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

* Re: bug: frozen map leaks
  2020-10-02 22:46 ` Stanislav Fomichev
@ 2020-10-03  0:28   ` Andrii Nakryiko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2020-10-03  0:28 UTC (permalink / raw
  To: Stanislav Fomichev
  Cc: Alexei Starovoitov, bpf, Andrii Nakryiko, Martin KaFai Lau

On Fri, Oct 2, 2020 at 3:47 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> > after successful test_progs run I see a bunch of leaked maps:
> > # bpftool m s
> > 3: array  name iterator.rodata  flags 0x480
> >     key 4B  value 98B  max_entries 1  memlock 8192B
> >     btf_id 4  frozen
> > 9: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 145B  max_entries 1  memlock 8192B
> >     btf_id 13  frozen
> > 12: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 144B  max_entries 1  memlock 8192B
> >     btf_id 14  frozen
> > 13: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 85B  max_entries 1  memlock 8192B
> >     btf_id 15  frozen
> > 14: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 45B  max_entries 1  memlock 8192B
> >     btf_id 16  frozen
> > 15: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 40B  max_entries 1  memlock 8192B
> >     btf_id 17  frozen
> > 17: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 55B  max_entries 1  memlock 8192B
> >     btf_id 18  frozen
> > 19: array  name bpf_iter.rodata  flags 0x480
> >     key 4B  value 14B  max_entries 1  memlock 8192B
> >     btf_id 19  frozen
> >
> > Andrii,
> > I suspect it's due to libbpf doing BPF_PROG_BIND_MAP now.
> >
> > Stanislav,
> > could you take a look ?
> Interesting. I can reproduce with 'test_progs -t snprintf_btf':
>
> 5: array  name netif_re.rodata  flags 0x480
>         key 4B  value 13312B  max_entries 1  memlock 20480B
>         btf_id 5  frozen
> 10: array  name pid_iter.rodata  flags 0x480
>         key 4B  value 4B  max_entries 1  memlock 8192B
>         btf_id 10  frozen
>         pids bpftool(276)
> 11: array  flags 0x0
>         key 4B  value 32B  max_entries 1  memlock 4096B
>
> I suppose we do BPF_PROG_BIND_MAP only to #11, so I'm puzzled why
> rodata is also leaking.

all .rodata maps are also BPF_PROG_BIND_MAP'ed by libbpf, if kernel is
recent enough

> Will try to take a look!

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

end of thread, other threads:[~2020-10-03  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-02 22:32 bug: frozen map leaks Alexei Starovoitov
2020-10-02 22:46 ` Stanislav Fomichev
2020-10-03  0:28   ` Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.