From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbZ5u-000308-7t for qemu-devel@nongnu.org; Mon, 14 Sep 2015 15:07:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbZ5p-0003fD-8l for qemu-devel@nongnu.org; Mon, 14 Sep 2015 15:07:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbZ5p-0003eM-2v for qemu-devel@nongnu.org; Mon, 14 Sep 2015 15:07:09 -0400 References: <1442253477-15422-1-git-send-email-armbru@redhat.com> <1442253477-15422-21-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F71AD6.1000402@redhat.com> Date: Mon, 14 Sep 2015 13:07:02 -0600 MIME-Version: 1.0 In-Reply-To: <1442253477-15422-21-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LU6tdTtXbmh0elCR8NOWxR6Jc9loaINJ9" Subject: Re: [Qemu-devel] [PATCH v7 20/26] qapi: Make output visitor 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) --LU6tdTtXbmh0elCR8NOWxR6Jc9loaINJ9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 11:57 AM, 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, failing "make check". >=20 > Commit 481b002 solved a very similar problem by introducing a special > null QObject. Using this special null QObject is clearly the right > way to resolve this FIXME, so do that, and update the test > accordingly. >=20 > However, the patch isn't quite right: it messes up the reference > counting. After about SIZE_MAX visits, the reference counter > overflows, failing the assertion in qnull_destroy_obj(). Because > that's many orders of magnitude more visits of nulls than we expect, > we take this patch despite its flaws, to get the QMP introspection > stuff in without further delay. >=20 > Naturally, we'll have to fix it for real before the release. >=20 > Signed-off-by: Markus Armbruster > --- > qapi/qmp-output-visitor.c | 8 ++++++-- > tests/test-qmp-output-visitor.c | 3 ++- > 2 files changed, 8 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --LU6tdTtXbmh0elCR8NOWxR6Jc9loaINJ9 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/ iQEcBAEBCAAGBQJV9xrWAAoJEKeha0olJ0NqXmsIAJl2BOiixUuJiOEw5vZZp4Hg RFtrAAOlOZqcPWYVP9izI1NjhF/k5J9hj6dvNsW9H+bvllXD9R9b7S/28NTdnB60 agS47P+D2eSTnbRCMH2rAmJJjgPREF8BBzXhFCSnP6XX9ahlnpaYibsIXZrK45tk lBX2HtxXDXHARy4gCSwCK8t2Q0lb83GzlSWbv9ClGjdq/qJk6sx1mvAxieDZka9C DJzohbMo9V1RwOIwy3UdIbTLld6y9l5zk/hfEM7hrrI2+CxNbTdUgK+LyFNrvCWw sVVJwpITksV9L4fkYMBjoc/qhiTYNtzZLW5Pqu1LEkbPlu2j8/ZZ+6afVDBKc7g= =79TA -----END PGP SIGNATURE----- --LU6tdTtXbmh0elCR8NOWxR6Jc9loaINJ9--