All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] simple qmp core dump
Date: Wed, 28 Oct 2015 10:19:44 +0100	[thread overview]
Message-ID: <8737wvmjtb.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <87zizo5tv3.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Mon, 12 Oct 2015 11:17:04 +0200")

Markus Armbruster <armbru@redhat.com> writes:

> Eric Blake <eblake@redhat.com> writes:
>
>> Just noticed this core dump (I was actually trying to exceed the 1024
>> hard-baked limit in qmp-input-visitor.c which tries to set an Error
>> object, but it looks like that limit was unreachable due to this earlier
>> assertion):
>>
>> $ printf '{"execute":"qmp_capabilities","id":%1025s' " " | tr ' ' { |
>>     ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -qmp stdio
>> {"QMP": {"version": {"qemu": {"micro": 50, "minor": 4, "major": 2},
>> "package": ""}, "capabilities": []}}
>> main-loop: WARNING: I/O thread spun for 1000 iterations
>> **
>> ERROR:qobject/json-parser.c:294:parser_context_peek_token: assertion
>> failed: (ctxt->tokens.pos < ctxt->tokens.count)
>> Aborted (core dumped)
>>
>> I don't know the best way to deal with a client that abuses QMP
>> protocol, but it would at least be nice to not abort.
>
> Handwritten parser crashes, surprise, surprise.
>
> 1023 works, 1024 crashes.  Need to dig to find out why.

Regressed in commit 65c0f1e "json-parser: don't replicate tokens at each
level of recursion", v1.2.0.  Until then, we got a clean "{"error":
{"class": "GenericError", "desc": "Invalid JSON syntax"}}".

      reply	other threads:[~2015-10-28  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 13:02 [Qemu-devel] simple qmp core dump Eric Blake
2015-10-12  9:17 ` Markus Armbruster
2015-10-28  9:19   ` Markus Armbruster [this message]

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=8737wvmjtb.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@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.