[Swan-dev] tracking libevent's memory

Andrew Cagney andrew.cagney at gmail.com
Mon Apr 1 14:15:31 UTC 2019


I've pushed the below - I've since used it to find a real memory leak.

On Fri, 22 Mar 2019 at 14:16, Andrew Cagney <andrew.cagney at gmail.com> wrote:
>
> Attached is a patch to configure libevent so that it uses pluto's
> leak-detective.  It does throw up some leaks but they are mostly
> harmless - pluto just needs to execute:
> +       dbg("releasing event base");
> +       event_base_free(pluto_eb);
> +       pluto_eb = NULL;
> +       dbg("releasing global event data");
> +       /* this releases data allocated by evthread_use_pthreads() */
> +       libevent_global_shutdown();
> as part of a clean shutdown.  The attached patch also adds these missing calls.
>
> I'm going to sit on this for now (I need to test more than just
> ikev2-12-x509-ikev1-rw), but that can wait until later.
>
> Andrew
>
> PS: more surprisingly is that this patch and count-pointers.awk found
> a bug in leak-detective :-)


More information about the Swan-dev mailing list