qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'


From: Eric Blake
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Mon, 21 Nov 2016 14:36:59 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/21/2016 02:12 PM, G 3 wrote:
> 
> On Nov 21, 2016, at 5:02 AM, Paolo Bonzini wrote:
> 
>>
>>
>> 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 != 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=0x443f44 "{ 'seconds': %qd,
> 'microseconds': %qd }") at qobject/qjson.c:69
> #4  0x0033f6e4 in timestamp_put (qdict=0x2052e00) 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.

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]