[Swan-dev] tracking libevent's memory

Andrew Cagney andrew.cagney at gmail.com
Fri Mar 22 18:16:43 UTC 2019


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 :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libevent-memory.patch
Type: text/x-patch
Size: 4209 bytes
Desc: not available
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20190322/80b20685/attachment.bin>


More information about the Swan-dev mailing list