From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9CaZ-0000k2-NK for qemu-devel@nongnu.org; Tue, 22 Nov 2016 10:02:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9CaV-0008UQ-S2 for qemu-devel@nongnu.org; Tue, 22 Nov 2016 10:02:27 -0500 Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:32797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9CaV-0008Tk-ND for qemu-devel@nongnu.org; Tue, 22 Nov 2016 10:02:23 -0500 Received: by mail-io0-x241.google.com with SMTP id j92so11190916ioi.0 for ; Tue, 22 Nov 2016 07:02:23 -0800 (PST) In-Reply-To: References: <673F175E-AF65-4F4F-9895-C7335A36AC29@gmail.com> <8b136de6-490a-d194-b7a6-eabfb87daf2c@redhat.com> <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> <182f25fb-98bd-73db-62f3-ff18b30a49cd@redhat.com> <3c5fdd4e-da35-46d9-9c64-a1a269f41646@redhat.com> <87twaz3k2h.fsf@dusky.pond.sub.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5D55FA50-F411-4FB5-9E44-9F896328BB25@gmail.com> Content-Transfer-Encoding: 7bit From: G 3 Date: Tue, 22 Nov 2016 10:02:19 -0500 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: Eric Blake Cc: Markus Armbruster , Paolo Bonzini , qemu-devel qemu-devel On Nov 22, 2016, at 7:41 AM, Eric Blake wrote: > On 11/22/2016 04:06 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> On 11/21/2016 02:36 PM, Eric Blake wrote: >>>> 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, >> >> Yes... >> >>>> but I'd argue that using qobject_from_jsonf() is already less- >>>> than-useful. >>> >>> In fact, we are down to only a handful of users of our modified >>> 'jsonf' >>> format (that is, strings that mix JSON with % modifiers): >>> >>> hw/pci/pcie_aer.c: build a 5-element QDict >>> monitor.c: build a 1-element QDict which contains a 2-element QDict >>> qapi/qmp-dispatch.c: build a 2-element QDict >>> qapi/qmp-event.c: Build a 2-element QDict >>> >>> plus the testsuite (check-qjson.c). >> >> How did you find them? > > git grep qobject_from_jsonf > > I forgot about qobject_from_jsonv(), which is a bit more pervasive in > the testsuite, but even there, I only found a few additional uses of % > (that time, found by adding an assert(!strchr(format, '%')), then > seeing > where it triggered during 'make check'). I should have the cleanup > series later today. Technically, avoiding PRId64 in qmp-event.c is > worth having in 2.8 (it's a bug fix for Mac OS); but the rest of the > series is 2.9 material. Note that at least one of the testsuite > conversions I'm making also used PRId64 - is the original poster even > running 'make check', as at least check-qga would be evidence of the > JSON parser failing to understand Mac's %qd. I did run make check. It fails here: GTESTER tests/check-qjson qobject/qjson.c:69: failed assertion `obj != NULL' GTester: last random seed: R02S40df2b0a1486871a176bb83135c07c90 make: *** [/Users/john/desktop/qemu-2.0.0/tests/Makefile:343: check- tests/check-qjson] Error 1 check-qga isn't run.