[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users]
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users]
- From: Ken Feng <kfmfe04@xxxxxxxxx>
- Date: Thu, 18 Nov 2010 10:26:43 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Wed, 17 Nov 2010 21:26:49 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=tncory/LhDcN6+wpbswv1OvDtnbPqi+blJa1xs0UE50=; b=najDIZKINse570VUmLnLt20XLidglscTDVyPdI2w+pxoZcTEFM0K4px/guJi3GHRaZ JuT9LgVpVhJKzUuYbjl728PsTTaXc8ckSOs+2AbYjog/lcre5mWwtH+2T5CXamrpZwHr d056m/4tPw4r8/URPSVbg9WTQuCnHW89+0Gcs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LpvshDUU3gXhR8GETIM9CZynFoBwJ5ye5c65r7ML06d5DG1OrArqcSk7Sf6cIUpQ0F SsBh5Fu+xkquRJM7cAb0bOOBnThTOhnResZRFlgve3UsB/syNhCjACubABrGwn2G8GBN oA99PHPhBm/2Ij9ZeO1Cbdt0wTA62G3NOPaDo=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
I am a new user of libevent - I ran into the following valgrind error
on my machine:
Version: libevent-2.0.8-rc
OS: Ubuntu 10.04 LTS amd64
Of interest is (bufferevent_sock.c:321) inside:
struct bufferevent *bufferevent_socket_new()
struct bufferevent_private *bufev_p;
// ...
if ((bufev_p = mm_calloc(1, sizeof(struct bufferevent_private)))== NULL)
// ...
// ----------------------------------------
bufev_p doesn't seem to get freed with mm_free() unless there is an error.
My question is, what to do about this valgrind error?
1. There is no bug - suppress the valgrind message?
2. There is a flaw in the way I am calling bufferevent_socket_new().
In other words, I am not calling bufferevent_free() at the right time?
3. This code needs to be patched?
4. Something else?
Please advise. Thank you.
- Ken
==2933== 2,728 (496 direct, 2,232 indirect) bytes in 1 blocks are
definitely lost in loss record 9 of 9
==2933== at 0x4C278FC: calloc (vg_replace_malloc.c:467)
==2933== by 0x5781B55: bufferevent_socket_new (bufferevent_sock.c:321)
==2933== by 0x4CE3A5: accept_conn_cb(evconnlistener*, int,
sockaddr*, int, void*) (Socket.cpp:71)
==2933== by 0x5783804: listener_read_cb (listener.c:377)
==2933== by 0x57796BB: event_base_loop (event.c:1287)
==2933== by 0x4CF773: robolab::Socket::startup() (Socket.cpp:226)
==2933== by 0x48ADF1: robolab::ClientServer::startup() (ClientServer.cpp:117)
==2933== by 0x473A76: serverThreadCB(void*) (Test_EchoClientServer.cpp:47)
==2933== by 0x66519C9: start_thread (pthread_create.c:300)
==2933== by 0x75526FC: clone (clone.S:112)
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.