From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaVAx-0006NO-O1 for qemu-devel@nongnu.org; Fri, 11 Sep 2015 16:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaVAs-0001oW-Pi for qemu-devel@nongnu.org; Fri, 11 Sep 2015 16:44:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaVAs-0001o8-Jh for qemu-devel@nongnu.org; Fri, 11 Sep 2015 16:43:58 -0400 References: <1441999089-28960-1-git-send-email-armbru@redhat.com> <1441999089-28960-21-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F33D06.1090103@redhat.com> Date: Fri, 11 Sep 2015 14:43:50 -0600 MIME-Version: 1.0 In-Reply-To: <1441999089-28960-21-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0isLPsI1QL8HK8PlkPJsR7H2n4Xc6dOT9" Subject: Re: [Qemu-devel] [PATCH v6 20/26] qapi: Fix output visitor to return qnull() instead of NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0isLPsI1QL8HK8PlkPJsR7H2n4Xc6dOT9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/11/2015 01:18 PM, Markus Armbruster wrote: > Before commit 1d10b44, it crashed. Since then, it returns NULL, with > a FIXME comment. The FIXME is valid: code that assumes QObject * > can't be null exists. I'm not aware of a way to feed this problematic > return value to code that actually chokes on null in the current code, > but the next few commits will create one. >=20 > Commit 481b002 solved a very similar problem by introducing a special > null QObject. Use it here, and drop the FIXME. >=20 > Update the test accordingly. >=20 > Signed-off-by: Markus Armbruster > --- > qapi/qmp-output-visitor.c | 3 +-- > tests/test-qmp-output-visitor.c | 2 +- > 2 files changed, 2 insertions(+), 3 deletions(-) >=20 > +++ b/tests/test-qmp-output-visitor.c > @@ -485,7 +485,7 @@ static void test_visitor_out_empty(TestOutputVisito= rData *data, > QObject *arg; > =20 > arg =3D qmp_output_get_qobject(data->qov); > - g_assert(!arg); > + g_assert(qobject_type(arg) =3D=3D QTYPE_QNULL); > } Missing qobject_decref(arg); Ultimately, the global qnull_ starts life with refcnt 1, and after this test should be back to 1. But it is coming back as 3, so even with a qobject_decref, that would get it back down to 2. So we are leaking a reference to qnull somewhere. I'm still investigating, and may be able to find the patch --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0isLPsI1QL8HK8PlkPJsR7H2n4Xc6dOT9 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/ iQEcBAEBCAAGBQJV8z0GAAoJEKeha0olJ0Nq8RUH/ih4+LGJc6t3XnTo4HaFrS4N 0IxMzfRUUS+pX9kq3CCx9Ae0k2U7iI31xX1XmvoZTqKrRTQJpUK81wiZsCGKkHD0 hr2l0tRwqUq8mbwllZO4pe089+KE8PvPdzR7T/tEhEwE7RCGqTak7G3Vg506LGFS qiIhi0xViCw+mImMsesQ18HhDH0JwM4+s3IMUDrTiBLczkiFAjvXmnlBVp1fBxHr Ns8eep6zb7tT+rVcB7uHJq4qf8Ed5j/8KLs/j4Pn9cs3026o5oxS7gwLzqY625H1 ZxazPTPMJUFTZiyZl1hxdXfVuqf+CFef7bA1Bok800N/gf1A/pD+14i7Q520VBU= =xqvb -----END PGP SIGNATURE----- --0isLPsI1QL8HK8PlkPJsR7H2n4Xc6dOT9--