Date: Sun, 3 Dec 2017 09:56:47 +0100 From: Vincenzo Maffione <v.maffione@gmail.com> To: Martina Balintova <balint.martina@gmail.com> Cc: "freebsd-net@freebsd.org" <net@freebsd.org>, Giuseppe Lettieri <g.lettieri@iet.unipi.it> Subject: Re: Netmap ouch double free Message-ID: <CA%2B_eA9g3d4YrFi4=VjcObRLq-h3SRPSkfMMG_58NQ4wg1N3E-Q@mail.gmail.com> In-Reply-To: <CADBMiEfM8qEQbRtb-egJjtQ0vhZ0CCMRS2YHbmz8A_k7AyZu_Q@mail.gmail.com> References: <CADBMiEd-X-pJ5yjhcxXK5Fo_EgWsMai0Um2HGffYzC_EnRUU3g@mail.gmail.com> <CADBMiEfM8qEQbRtb-egJjtQ0vhZ0CCMRS2YHbmz8A_k7AyZu_Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- Vincenzo Maffione
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9g3d4YrFi4=VjcObRLq-h3SRPSkfMMG_58NQ4wg1N3E-Q>