All of lore.kernel.org
 help / color / mirror / Atom feed
From: G 3 <programmingkidx@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Tue, 22 Nov 2016 17:22:26 -0500	[thread overview]
Message-ID: <E46E8397-DAEE-4812-B2B2-55A7D8F8AE3D@gmail.com> (raw)
In-Reply-To: <182f25fb-98bd-73db-62f3-ff18b30a49cd@redhat.com>


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
>> /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.

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().

  parent reply	other threads:[~2016-11-22 22:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21  6:30 [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' G 3
2016-11-21  9:13 ` Markus Armbruster
2016-11-21 10:02 ` Paolo Bonzini
2016-11-21 20:12   ` G 3
2016-11-21 20:36     ` Eric Blake
2016-11-21 20:46       ` Eric Blake
2016-11-21 20:53         ` G 3
2016-11-22  6:49           ` Paolo Bonzini
2016-11-22 10:06         ` Markus Armbruster
2016-11-22 12:41           ` Eric Blake
2016-11-22 12:54             ` Paolo Bonzini
2016-11-22 15:05               ` Markus Armbruster
2016-11-22 15:02             ` G 3
2016-11-22 15:13               ` Eric Blake
2016-11-22 16:00                 ` [Qemu-devel] check-qjson failure G 3
2016-11-22 22:42                   ` Eric Blake
2016-11-22 22:22       ` G 3 [this message]
2016-11-22 22:41         ` [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E46E8397-DAEE-4812-B2B2-55A7D8F8AE3D@gmail.com \
    --to=programmingkidx@gmail.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.