From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bydcn-0001VA-NI for qemu-devel@nongnu.org; Mon, 24 Oct 2016 07:41:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bydcj-0001tV-QC for qemu-devel@nongnu.org; Mon, 24 Oct 2016 07:41:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bydcj-0001tE-IJ for qemu-devel@nongnu.org; Mon, 24 Oct 2016 07:41:01 -0400 From: Pino Toscano Date: Mon, 24 Oct 2016 13:40:50 +0200 Message-ID: <3912491.6kvB5k8DnY@thyrus.usersys.redhat.com> In-Reply-To: <18fc0471-2259-b0bd-3e0c-2cd7ea3bc394@redhat.com> References: <1476782267-2602-1-git-send-email-ptoscano@redhat.com> <3321636.HNiH4nMqTU@thyrus.usersys.redhat.com> <18fc0471-2259-b0bd-3e0c-2cd7ea3bc394@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4271953.aDxDD4vzbv"; micalg="pgp-sha256"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [PATCH] qapi: fix memory leak in QmpOutputVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, armbru@redhat.com, mdroth@linux.vnet.ibm.com --nextPart4271953.aDxDD4vzbv Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday, 21 October 2016 16:20:30 CEST Eric Blake wrote: > On 10/18/2016 06:22 AM, Pino Toscano wrote: > > On Tuesday, 18 October 2016 06:13:30 CEST Eric Blake wrote: > >> On 10/18/2016 04:17 AM, Pino Toscano wrote: > >>> qmp_output_start_struct() and qmp_output_start_list() create a new > >>> QObject (QDict, QList) and push it to the stack of the QmpOutputVisitor, > >>> where it is saved as 'value'. When freeing the iterator in > >>> qmp_output_free(), these values are never freed properly. > >> > >> Do any of the tests (perhaps run under valgrind) show this leak? If not, > >> maybe we should enhance their coverage. > > > > Running a simple `qemu-img info file.qcow2` under valgrind was enough > > for me to show the leak. > > I'm still not reproducing it. :( Funny, now I cannot either, not even by resetting master back to the day when I did the patches. And I'm pretty sure that it was an issue, since doing only this patch did not fully fix the leak: valgrind runs were fine, so a full run of the libguestfs test suite with the rebuild qemu as hypervisor. > > In this case, another simple fix is needed to fully fix the leak: > > http://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg04023.html > > In fact, isn't that fix alone enough to fix the leak? The more I think > about this patch (and the thread on v2), the more I think it is too > prone to double-freeing things. I agree on the "this is not needed part", so let's just drop this patch. Thanks, -- Pino Toscano --nextPart4271953.aDxDD4vzbv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJYDfNCAAoJEMPRTC2YZDfNp90QALWVa0eZUMy1IUR8VjWlCVfQ myoI5Q8r8gxy4Gq+s1qFTNpD+u5+VhBFvT3Kd6g56Ivho6AMnmy1wWHjoiC3sSz1 QbDylBof1irs/eD3LDEwMVPEdHup+6FqZPo87l1m70MdJlzdtkdC1cYkVuPWY+y4 2DyMWmW0JFhY0unOAYPAPasiFIJa8XK70hCqj3g2iWwrDBU7g04KsetBEa8ADMCi Le+3K9pSniivNcYVe2aMQzzpm7qoQzdi3k/kDOpTB+HBWI9POhtW1kWYeh93Zuo8 DD5um2R0P5s6E3jXgzdYAhhqeuUjXH50btTG1gP9wtpvqLth/H62pnBnqAgtYHrR PMslGx8VacoRyW5e2ZdkR0ZxcCFpoPP2j9KWVR6V0cbmqKbBtBKnAQtaVQmar7aj fE0SipID3aFK6+ia5lHFBtjzM7Yut45xxZMaFZv/x6nsQBvIPDf2xhQfIJ9fLWm4 2fwFuOQGhm90PPI9mMPGXm6JEYS3lDrKZaoAjfHcBJmVjoem7PWo47iZ2Me9n3dQ KdOfwu8+KCNalt7dl0sHhqWl0Rxq9unZnYwfIh/zhzzwYi4orQIAyodM6OjDr7zA 5MCZnfBkVn/aCGlxvLrlVz4cHJlK1f3H0ue6tNpOmz7J4M5/kgFGPAB7GObJ9+lM OsYRHMhs7b4trBiO5/HI =LbiS -----END PGP SIGNATURE----- --nextPart4271953.aDxDD4vzbv--