[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Memory leak in locks?




On Jan 9, 2015 11:19 PM, "Ralph Castain" <rhc@xxxxxxxxxxxx> wrote:
>
> Thanks to both you and Tomer! I added a configure check for the function so I can use it when available - otherwise, someone will just have to live with the 40 bytes of loss :-)

If you use valgrind for automatic testing, then you could use suppression.

>
>
>> On Jan 9, 2015, at 12:11 PM, Azat Khuzhin <a3at.mail@xxxxxxxxx> wrote:
>>
>>
>> On Jan 9, 2015 9:05 PM, "Ralph Castain" <rhc@xxxxxxxxxxxx> wrote:
>> >
>> > Hi folks
>> >
>> > Iâve trying to make a new library that uses libevent be valgrind clean. This is a threaded library, and so libevent is thread enabled. I create a new event base, and I call event_base_free before finalizing.
>> >
>> > However, I keep seeing reports like this:
>> >
>> > ==16029== 40 bytes in 1 blocks are still reachable in loss record 1 of 3
>> > ==16029==Â Â at 0x4C288FE: malloc (in /home/common/local/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>> > ==16029==Â Â by 0x52A9EE1: evthread_posix_lock_alloc (evthread_pthread.c:46)
>> > ==16029==Â Â by 0x5075572: event_global_setup_locks_ (event.c:2900)
>> > ==16029==Â Â by 0x52AA08A: evthread_use_pthreads (evthread_pthread.c:185)
>> >
>> > This is with libevent 2.0.22-stable. Is this an expected situation? Or is there something I need to do beyond event_base_free to get a clean finalize?
>> >
>> > Thanks
>> > Ralph
>>
>> HI Ralph,
>>
>> In 2.1 you will have libevent_global_shutdown().
>> But unfortunately it is not ported to 2.0 AFAIK.
>>
>> >
>> > ***********************************************************************
>> > To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
>> > unsubscribe libevent-users  in the body.
>
>