Netmap ouch double free
Vincenzo Maffione
v.maffione at gmail.com
Sun Dec 3 08:56:49 UTC 2017
Hi,
It may be related to the "extra buffers feature" of netmap, that lb uses.
When the netmap port is opened, some additional buffers (not bound to any
netmap ring) are allocated to be used by the application for slot swapping.
They are provided through the ni_bufs_head field as a linked list (see
updated netmap manual
https://github.com/luigirizzo/netmap/blob/master/share/man/man4/netmap.4 ).
To free them, the free list must be returned when closing the netmap file
descriptor, using the same ni_bufs_head field.
To check if this is true you could make sure that you are using "-B 0"
option, which means no extra buffers are used.
Are you using the latest netmap code from github? Are you using FreeBSD or
Linux?
Cheers,
Vincenzo
2017-12-01 15:21 GMT+01:00 Martina Balintova <balint.martina at gmail.com>:
> Hi,
> I am currently playing with lb app in netmap. Every time I kill/close it,
> the app hangs for some time and does not end immediately. In syslogs I am
> getting:
> '
> Netmap_do_unregif deleting last instance for myapp{1
> Netmap_do_deref active=5
> Netnap_obj_free ouch, double free on buffer 27777
> Netmap_extra_free freed 0 buffers
> '
>
> This happens when I have some consumer on the pipe and at some point during
> whole lb lifetime, it did not consume all packets (resulting in oq being
> filled or packets being dropped). If the pipe did not ever have a consumer,
> then it will not end up in the double free.
> I am finding it quite hard to debug in gdb, as this is happening at the
> shutdown.
> Could someone pls point me to reason?
>
> I am running lb with one interface and 2 groups, different numb of pipes
> per group and this happens even with no extra buffers.
>
> Martina
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
--
Vincenzo Maffione
More information about the freebsd-net
mailing list