From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2mRz-0000aB-3C for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:32:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2mRt-00032V-Kv for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:32:22 -0500 Received: from david.siemens.de ([192.35.17.14]:19284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2mRt-000327-Ap for qemu-devel@nongnu.org; Wed, 29 Feb 2012 11:32:17 -0500 Message-ID: <4F4E530D.2070703@siemens.com> Date: Wed, 29 Feb 2012 17:32:13 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20120229161521.GA8661@redhat.com> In-Reply-To: <20120229161521.GA8661@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] slirp memory leaks (from valgrind) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: "qemu-devel@nongnu.org" On 2012-02-29 17:15, Michael S. Tsirkin wrote: > valgrind run shows a memory leak in slirp: > > ==21745== 360 (168 direct, 192 indirect) bytes in 1 blocks are definitely lost in loss record 700 of 856 > ==21745== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) > ==21745== by 0x298F01: socreate (socket.c:48) > ==21745== by 0x298FBC: tcp_listen (socket.c:601) > ==21745== by 0x296325: slirp_add_hostfwd (slirp.c:794) > ==21745== by 0x25E7BB: slirp_hostfwd (slirp.c:413) > ==21745== by 0x25F7C6: net_init_slirp (slirp.c:254) > ==21745== by 0x25BC72: net_client_init (net.c:1155) > ==21745== by 0x27C759: qemu_opts_foreach (qemu-option.c:1053) > ==21745== by 0x25AED1: net_init_clients (net.c:1452) > ==21745== by 0x24EC5A: main (vl.c:3277) > > comments? The socket tcp_listen creates and returns is not handled by slirp_add_hostfwd, but it is part of the tcb queue of the slirp instance. Hmm, maybe we fail to clean up the tcb on slirp destruction, and that is the issue... Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux