[Commotion-dev] [serval-project-dev] Serval memory leaks

Dan Staples danstaples at opentechinstitute.org
Fri Nov 1 01:59:58 UTC 2013


So I found the keyring-related memory leaks, and submitted a fix here:
https://github.com/opentechinstitute/serval-dna/commit/5fa8c98fbfd48d818684b6258d2ad4a8a8587e02.
Let me know if you want me to make a pull request. After someone else
here tests out the fix, we'll likely merge it into the
commotion-wireless branch in our repo.

It got rid of the 500kb leak, but there's still some unfreed allocated
memory left over from subscriber structs created in the root tree_node
(overlay_address.c:83). I'm not familiar enough with that part of Serval
to know what a good way to free that memory is at the end of the program
life.

Dan

On 10/31/2013 06:33 PM, Dan Staples wrote:
> It has one key :)
> 
> On Thu 31 Oct 2013 06:17:28 PM EDT, Jeremy Lakeman wrote:
>> 500k is a lot, how large is your keyring?
>>
>>
>> On Fri, Nov 1, 2013 at 8:34 AM, Dan Staples
>> <danstaples at opentechinstitute.org
>> <mailto:danstaples at opentechinstitute.org>> wrote:
>>
>>     At the international summit for community wireless networks last
>>     month,
>>     we noticed on the Commotion network we set up that the Serval daemon,
>>     and one of our own programs which uses the Serval library, were
>>     using up
>>     an awful lot of memory and leading to OOM conditions in which the
>>     routers rebooted periodically.
>>
>>     I noticed today, as I've been debugging our code that uses the Serval
>>     library, that Valgrind reports quite a bit of leaked memory from a
>>     single call to both keyring_open and keyring_enter_pin. 527,056 bytes
>>     lost memory to be exact, stemming from malloc and calloc calls in
>>     those
>>     functions. Perhaps this is our problem?
>>
>>     This was seen with both 0.90 and 0.91. I can send Valgrind output if
>>     that would be helpful.
>>
>>     Dan
>>
>>     --
>>     Dan Staples
>>
>>     Open Technology Institute
>>     https://commotionwireless.net
>>     OpenPGP key: http://disman.tl/pgp.asc
>>     Fingerprint: 2480 095D 4B16 436F 35AB 7305 F670 74ED BD86 43A9
>>
>>     --
>>     You received this message because you are subscribed to the Google
>>     Groups "Serval Project Developers" group.
>>     To unsubscribe from this group and stop receiving emails from it,
>>     send an email to
>>     serval-project-developers+unsubscribe at googlegroups.com
>>     <mailto:serval-project-developers%2Bunsubscribe at googlegroups.com>.
>>     To post to this group, send email to
>>     serval-project-developers at googlegroups.com
>>     <mailto:serval-project-developers at googlegroups.com>.
>>     Visit this group at
>>     http://groups.google.com/group/serval-project-developers.
>>     For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Serval Project Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to serval-project-developers+unsubscribe at googlegroups.com.
>> To post to this group, send email to
>> serval-project-developers at googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/serval-project-developers.
>> For more options, visit https://groups.google.com/groups/opt_out.
> 
> --
> Dan Staples
> 
> Open Technology Institute
> https://commotionwireless.net
> OpenPGP key: http://disman.tl/pgp.asc
> Fingerprint: 2480 095D 4B16 436F 35AB 7305 F670 74ED BD86 43A9
> 

-- 
Dan Staples

Open Technology Institute
https://commotionwireless.net
OpenPGP key: http://disman.tl/pgp.asc
Fingerprint: 2480 095D 4B16 436F 35AB 7305 F670 74ED BD86 43A9


More information about the Commotion-dev mailing list