From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8vKt-0005ZX-2C for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8vKo-00040B-Qj for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:37:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8vKo-0003zx-HS for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:37:02 -0500 References: <673F175E-AF65-4F4F-9895-C7335A36AC29@gmail.com> <8b136de6-490a-d194-b7a6-eabfb87daf2c@redhat.com> <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> From: Eric Blake Message-ID: <182f25fb-98bd-73db-62f3-ff18b30a49cd@redhat.com> Date: Mon, 21 Nov 2016 14:36:59 -0600 MIME-Version: 1.0 In-Reply-To: <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rsEaEdXC6UhcbaB3FatOXPjFWuOSAvtgk" Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: G 3 , Paolo Bonzini , Markus Armbruster Cc: qemu-devel qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rsEaEdXC6UhcbaB3FatOXPjFWuOSAvtgk From: Eric Blake To: G 3 , Paolo Bonzini , Markus Armbruster Cc: qemu-devel qemu-devel Message-ID: <182f25fb-98bd-73db-62f3-ff18b30a49cd@redhat.com> Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' References: <673F175E-AF65-4F4F-9895-C7335A36AC29@gmail.com> <8b136de6-490a-d194-b7a6-eabfb87daf2c@redhat.com> <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> In-Reply-To: <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/21/2016 02:12 PM, G 3 wrote: >=20 > On Nov 21, 2016, at 5:02 AM, Paolo Bonzini wrote: >=20 >> >> >> On 21/11/2016 07:30, G 3 wrote: >>> When I try to use qemu-system-i386, I see this error message: >>> >>> qobject/qjson.c:69: failed assertion `obj !=3D NULL'. >>> >>> The string argument is this: { 'seconds': %qd, 'microseconds': %qd } >>> >>> Would anyone know how to fix this problem? >> >> Please include the full backtrace. > #3 0x003ec69c in qobject_from_jsonf (string=3D0x443f44 "{ 'seconds': %= qd, > 'microseconds': %qd }") at qobject/qjson.c:69 > #4 0x0033f6e4 in timestamp_put (qdict=3D0x2052e00) at > /Users/john/desktop/qemu-2.0.0/monitor.c:476 Why on earth are you trying to compile qemu 2.0.0? The latest version we support on this list is currently 2.6.x for patch backports, with 2.7.0 as the latest stable release; and very soon now it will be 2.7.x for backports and 2.8.0 as the latest stable release. The source of your problem is that your platform defines PRId64 as 'qd', but the qemu JSON parser only recognizes lld (POSIX) or I64d (mingw) for parsing 64-bit numbers. We could enhance the JSON parser to recognize the non-standard qd in addition to the hack we already have for mingw, but I'd argue that using qobject_from_jsonf() is already less-than-useful= =2E On the other hand, timestamp_put() (which now lives in qapi/qmp-event.c, rather than monitor.c) is still using qobject_from_jsonf() with PRId64 in current git master. If you don't want to hack the JSON parser (and I recommend that you don't), the alternative is to get rid of that function call and replace it with an open-coded construction of a QDict with manual population of its two members. It's hard to argue that the complexity of maintaining our pseudo-printf JSON parser for constructing a QObject with one line is worth the effort compared to the three or four lines to construct the same QObject by hand. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --rsEaEdXC6UhcbaB3FatOXPjFWuOSAvtgk 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/ iQEcBAEBCAAGBQJYM1rrAAoJEKeha0olJ0Nq+qcH/3FkDvIKYXAHDhGcxZAOiNKR QcWRH8l6B4Abvf/GBtvfatEjNVfaKNEsPGAeqMdUlctVz5NhL7ysofrXE82adOO1 5iljGn+WvC6j3Kzd+SPtXzJ48IEOeGDkmpRhgJkThKVcHCHwNXxIQOyNTL5+dHR0 jm9Lg8ChYMBpYfI1WLWf0uUUtFlgcf/DDLhUmsyOy5ifJYsWWsdqz4orzDAKFzgZ bFzcZ1rLXahjtMniAHbv0+BYKdKrbAIj0qVkdMQ9LtYJOaeBPCORY1g6YphKMKjW p4wN6/fZ10OnOW08wrv2veXgZcbAKNun+9A03bhUYMtWeM9KEIUvn4zoekcfHNU= =pOM8 -----END PGP SIGNATURE----- --rsEaEdXC6UhcbaB3FatOXPjFWuOSAvtgk--