Received: from eggs.gnu.org ([2001:4830:134:3::10]:57890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlZEE-0006ey-Ow for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:17:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlZEB-000325-It for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:17:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlZEB-00031h-Db for qemu-devel@nongnu.org; Mon, 12 Oct 2015 05:17:07 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id B70B48F287 for ; Mon, 12 Oct 2015 09:17:06 +0000 (UTC) From: Markus Armbruster References: <5617BAD9.8040205@redhat.com> Date: Mon, 12 Oct 2015 11:17:04 +0200 In-Reply-To: <5617BAD9.8040205@redhat.com> (Eric Blake's message of "Fri, 9 Oct 2015 07:02:17 -0600") Message-ID: <87zizo5tv3.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] simple qmp core dump List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "qemu-devel@nongnu.org" Eric Blake 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.