[Top][All Lists]

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

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

From: G 3
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Tue, 22 Nov 2016 17:22:26 -0500

On Nov 21, 2016, at 3:36 PM, Eric Blake wrote:

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

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.

I would just like to note for anyone else who might face this problem in the
future that replacing %PRId64 with %lld fixed the problem. I made the
replacement in timestamp_put().

reply via email to

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