[{"id":1776256,"web_url":"http://patchwork.ozlabs.org/comment/1776256/","msgid":"<92296b86-9676-c4a8-cf54-537e3641609a@redhat.com>","list_archive_url":null,"date":"2017-09-27T11:17:37","subject":"Re: [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device\n\tdevice_add test","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 27.09.2017 01:07, Eduardo Habkost wrote:\n> When running device_add tests, test all devices in a single run\n> instead of restarting QEMU every time.\n> \n> There's a plug_all testcase argument that can be used to make the\n> test code plug all devices at once.  I'm adding this mode because\n> there's a crash that was detected while testing the script\n> without any device_del command, but the crash goes away if we\n> device_del every device immediately:\n> \n>   $ ../scripts/device-crash-test ./x86_64-softmmu/qemu-system-x86_64 --quick -t method=device_add  --strict -t plug_all=1\n>   INFO: running test case: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add\n>   WARNING: qemu received signal -6: ./x86_64-softmmu/qemu-system-x86_64 -chardev socket,id=mon,path=/var/tmp/qemu-23578-monitor.sock -mon chardev=mon,mode=control -display none -vga none -S -machine pc-0.12,accel=kvm\n>   ERROR: result: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add\n>   ERROR: cmdline: ./x86_64-softmmu/qemu-system-x86_64 -S -machine pc-0.12,accel=kvm\n>   ERROR: log: audio: Could not init `oss' audio driver\n>   ERROR: log: qemu-system-x86_64: .../qemu/migration/savevm.c:721: vmstate_register_with_alias_id: Assertion `!se->compat || se->instance_id == 0' failed.\n>   ERROR: last device_add device: usb-net\n\nFWIW, I've seen similar crashes while working on my HMP device_add\ntester, when I skipped the device_del and plugged-in the devices a\ncouple of times instead. I think this happens because some devices are\ndoing a vmstate_register() in their instance_init() or realize()\nfunction, instead of using dc->vmsd as they should. However, with the\ngit master branch as of today (31bc1d8481af414cfa2857f905e), I am\ncurrently not able anymore to reproduce the problem with the HMP\ndevice_add tester, so one of the recent \"set user_creatable = false\"\npatches might have fixed the issue for me already...\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2Fg61LvMz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 21:18:08 +1000 (AEST)","from localhost ([::1]:54071 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxALu-0007cv-Ct\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 07:18:06 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53776)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dxALZ-0007ce-7L\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 07:17:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dxALV-0004ai-Um\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 07:17:45 -0400","from mx1.redhat.com ([209.132.183.28]:41116)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>) id 1dxALV-0004aH-OO\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 07:17:41 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 75583BDEA\n\tfor <qemu-devel@nongnu.org>; Wed, 27 Sep 2017 11:17:40 +0000 (UTC)","from [10.36.117.38] (ovpn-117-38.ams2.redhat.com [10.36.117.38])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 44F087F1E0;\n\tWed, 27 Sep 2017 11:17:38 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 75583BDEA","To":"Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org","References":"<20170926230709.22958-1-ehabkost@redhat.com>\n\t<20170926230709.22958-7-ehabkost@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<92296b86-9676-c4a8-cf54-537e3641609a@redhat.com>","Date":"Wed, 27 Sep 2017 13:17:37 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170926230709.22958-7-ehabkost@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tWed, 27 Sep 2017 11:17:40 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device\n\tdevice_add test","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tCleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1776483,"web_url":"http://patchwork.ozlabs.org/comment/1776483/","msgid":"<20170927164735.GE2108@work-vm>","list_archive_url":null,"date":"2017-09-27T16:47:36","subject":"Re: [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device\n\tdevice_add test","submitter":{"id":48102,"url":"http://patchwork.ozlabs.org/api/people/48102/","name":"Dr. David Alan Gilbert","email":"dgilbert@redhat.com"},"content":"* Thomas Huth (thuth@redhat.com) wrote:\n> On 27.09.2017 01:07, Eduardo Habkost wrote:\n> > When running device_add tests, test all devices in a single run\n> > instead of restarting QEMU every time.\n> > \n> > There's a plug_all testcase argument that can be used to make the\n> > test code plug all devices at once.  I'm adding this mode because\n> > there's a crash that was detected while testing the script\n> > without any device_del command, but the crash goes away if we\n> > device_del every device immediately:\n> > \n> >   $ ../scripts/device-crash-test ./x86_64-softmmu/qemu-system-x86_64 --quick -t method=device_add  --strict -t plug_all=1\n> >   INFO: running test case: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add\n> >   WARNING: qemu received signal -6: ./x86_64-softmmu/qemu-system-x86_64 -chardev socket,id=mon,path=/var/tmp/qemu-23578-monitor.sock -mon chardev=mon,mode=control -display none -vga none -S -machine pc-0.12,accel=kvm\n> >   ERROR: result: binary=./x86_64-softmmu/qemu-system-x86_64 plug_all=1 accel=kvm machine=pc-0.12 device=* method=device_add\n> >   ERROR: cmdline: ./x86_64-softmmu/qemu-system-x86_64 -S -machine pc-0.12,accel=kvm\n> >   ERROR: log: audio: Could not init `oss' audio driver\n> >   ERROR: log: qemu-system-x86_64: .../qemu/migration/savevm.c:721: vmstate_register_with_alias_id: Assertion `!se->compat || se->instance_id == 0' failed.\n> >   ERROR: last device_add device: usb-net\n> \n> FWIW, I've seen similar crashes while working on my HMP device_add\n> tester, when I skipped the device_del and plugged-in the devices a\n> couple of times instead. I think this happens because some devices are\n> doing a vmstate_register() in their instance_init() or realize()\n> function, instead of using dc->vmsd as they should. However, with the\n> git master branch as of today (31bc1d8481af414cfa2857f905e), I am\n> currently not able anymore to reproduce the problem with the HMP\n> device_add tester, so one of the recent \"set user_creatable = false\"\n> patches might have fixed the issue for me already...\n\nI think I've seen this problem when two things end up trying to register\nwith the same migration name;  I'll be honest I can't remember the\ndetails, but I think the choice is either between having a full bus\nname, e.g.\n\n    pci-xx:yy.z:aa:bb:.c:...... then similar for the USB chain\n\nor\n    mydevice  + number\n\nwhere number is the instance=id.  So to hit this I think\nit's typically a case of messing up that long path and it no\nlonger being unique.\nPrinting the path in vmstate_register_with_alias_id after the\npstrcat might help.\nI did add some sanity checking in there for a case I'd\npreviously hit where the name just got truncated, but I don't\nthink you should be able to hit that any more.\n\nDave\n\n>  Thomas\n--\nDr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=dgilbert@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2Nzs1mjGz9tXF\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 02:48:08 +1000 (AEST)","from localhost ([::1]:55586 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dxFVE-0003cE-Lz\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 12:48:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55826)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dxFUv-0003c7-HN\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 12:47:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgilbert@redhat.com>) id 1dxFUs-0007mU-Am\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 12:47:45 -0400","from mx1.redhat.com ([209.132.183.28]:48508)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgilbert@redhat.com>) id 1dxFUs-0007m8-1c\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 12:47:42 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C455FC4656\n\tfor <qemu-devel@nongnu.org>; Wed, 27 Sep 2017 16:47:40 +0000 (UTC)","from work-vm (ovpn-116-234.ams2.redhat.com [10.36.116.234])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 405B68AC20;\n\tWed, 27 Sep 2017 16:47:38 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C455FC4656","Date":"Wed, 27 Sep 2017 17:47:36 +0100","From":"\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>","To":"Thomas Huth <thuth@redhat.com>","Message-ID":"<20170927164735.GE2108@work-vm>","References":"<20170926230709.22958-1-ehabkost@redhat.com>\n\t<20170926230709.22958-7-ehabkost@redhat.com>\n\t<92296b86-9676-c4a8-cf54-537e3641609a@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<92296b86-9676-c4a8-cf54-537e3641609a@redhat.com>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tWed, 27 Sep 2017 16:47:41 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [RFC 6/6] device-crash-test: Multi-device\n\tdevice_add test","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Cleber Rosa <crosa@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>,\n\tqemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]