[systemd-devel] Leak mempool/hashmap
Ronny Chevalier
chevalier.ronny at gmail.com
Thu Nov 6 11:04:10 PST 2014
2014-11-06 19:59 GMT+01:00 Jan Janssen <medhefgo at web.de>:
Hi,
>
>
> On 2014-11-06 19:05, Lennart Poettering wrote:
>>
>> On Thu, 06.11.14 18:36, Jan Janssen (medhefgo at web.de) wrote:
>>
>>> Hi,
>>>
>>> I just noticed that mempool/hashmap leaks memory. It's as simple as this
>>> to
>>> trigger:
>>>
>>> #include "hashmap.h"
>>> int main(int argc, const char *argv[]) {
>>> Hashmap *m = hashmap_new(&string_hash_ops);
>>> hashmap_free(m);
>>> }
>>
>>
>> How did you determine the leak?
>>
>> Note that the hashmap uses an allocation cache. It's not freed on
>> shutdown, but it's not leaked either...
>>
>> Lennart
>>
>
> I've noticed while testing my cryptsetup-generator rewrite with valgrind.
> It's still reachable according to valgrind, but a silent output would be
> nice to have.
If you add -DVALGRIND=1 to the CFLAGS there will be no false positive
leaks reported.
>
> Jan
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list