From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxhR0-0005pv-Gy for qemu-devel@nongnu.org; Fri, 21 Oct 2016 17:33:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxhQx-0006Vf-BI for qemu-devel@nongnu.org; Fri, 21 Oct 2016 17:33:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50290) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxhQx-0006VG-4E for qemu-devel@nongnu.org; Fri, 21 Oct 2016 17:32:59 -0400 References: <1476787052-27333-1-git-send-email-ptoscano@redhat.com> <877f91ztpr.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <57db07f2-daee-c494-5ca0-651b53bcc889@redhat.com> Date: Fri, 21 Oct 2016 16:32:56 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NKJiObSB7lcfMfU74OTlKf2mlrXxmplfs" Subject: Re: [Qemu-devel] [PATCH v2] qapi: fix memory leak in QmpOutputVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Pino Toscano Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NKJiObSB7lcfMfU74OTlKf2mlrXxmplfs From: Eric Blake To: Markus Armbruster , Pino Toscano Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Message-ID: <57db07f2-daee-c494-5ca0-651b53bcc889@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] qapi: fix memory leak in QmpOutputVisitor References: <1476787052-27333-1-git-send-email-ptoscano@redhat.com> <877f91ztpr.fsf@dusky.pond.sub.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/21/2016 10:39 AM, Eric Blake wrote: > On 10/21/2016 09:01 AM, Markus Armbruster wrote: >> Pino Toscano writes: >> >>> qmp_output_start_struct() and qmp_output_start_list() create a new >>> QObject (QDict, QList) and push it to the stack of the QmpOutputVisit= or, >>> where it is saved as 'value'. When freeing the iterator in >>> qmp_output_free(), these values are never freed properly. >>> >>> The simple solution is to qobject_decref() them. >>> >>> Signed-off-by: Pino Toscano >> >> Hmm. The patch looks correct, even though it adds a decref very simil= ar >> to the one deleted by commit f24582d "qapi: fix double free in >> qmp_output_visitor_cleanup()". >=20 In fact, applying this patch regresses to the very state that f24582d tried to prevent. However, I'm unable to see a difference in valgrind on tests/test-qmp-output-visitor either with or without this patch, which sadly means our testsuite is not actually testing this scenario. >> Should this go into -stable? >=20 > I'm still not convinced this patch makes sense. NACK. As mentioned in the v1 thread, the leak that Pino was seeing is fixed by http://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg04023.html I don't think we don't want this patch. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NKJiObSB7lcfMfU74OTlKf2mlrXxmplfs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYComIAAoJEKeha0olJ0NqE/UH/iI9pyco8cXLR5lXEK1gEPF/ S0VBzXcBsBQ7mE4sDGNVOsnLKvfXBuFrHbKjE3VNLRPnA2bvlbBeU+5SMcKStFwQ 0J5Oc+4s+EUJ542ccbgcgyTaYF7F++1w2iYROwGVRMuBrh1aG0PAzdKEXIpCVkCw 1nRS/8Xc9LgvNgJdVL6jNdLAAs9xTqln/b3EqlPKIdAyvRzfV36TVX3gXZEqdYYx A2DmSYzBOuYVL+q+uthLQ6AQ44zKth9ELggzv2NBBCRmgXsYVZqWE81BRj90ImxA EUFiJNrYnazMpUIbQZtb6HP9kJ1K4L0hDywRrWFoMp2gctoDSThKvYpWvscs6TU= =OJjc -----END PGP SIGNATURE----- --NKJiObSB7lcfMfU74OTlKf2mlrXxmplfs--