From patchwork Mon Feb 13 04:58:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 140851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D94EBB6FAA for ; Mon, 13 Feb 2012 15:58:16 +1100 (EST) Received: from localhost ([::1]:56027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwnzR-0000TD-GP for incoming@patchwork.ozlabs.org; Sun, 12 Feb 2012 23:58:13 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwnzL-0000T8-WF for qemu-devel@nongnu.org; Sun, 12 Feb 2012 23:58:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwnzK-0006R9-Rx for qemu-devel@nongnu.org; Sun, 12 Feb 2012 23:58:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwnzK-0006R3-Cj for qemu-devel@nongnu.org; Sun, 12 Feb 2012 23:58:06 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1D4w3vD014172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 12 Feb 2012 23:58:03 -0500 Received: from redhat.com (vpn-203-199.tlv.redhat.com [10.35.203.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id q1D4w1W6002342; Sun, 12 Feb 2012 23:58:02 -0500 Date: Mon, 13 Feb 2012 06:58:08 +0200 From: "Michael S. Tsirkin" To: Anthony Liguori Message-ID: <20120213045807.GA22676@redhat.com> References: <20120212170743.GA3375@redhat.com> <20120212173140.GB3375@redhat.com> <4F37F910.5030400@codemonkey.ws> <20120212175659.GA4199@redhat.com> <4F381B4D.2000108@codemonkey.ws> <20120212201547.GC4199@redhat.com> <4F381EC7.3030407@codemonkey.ws> <20120213001735.GA8269@redhat.com> <20120213011813.GA8482@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120213011813.GA8482@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] weird qdev error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Mon, Feb 13, 2012 at 03:18:13AM +0200, Michael S. Tsirkin wrote: > > I also see this: > > > > device_add virtio-net-pci,netdev=foo,mac=52:54:00:12:34:56,id=bla > > device_del bla > > *** glibc detected *** /home/mst/qemu-test/bin/qemu-system-x86_64: > > corrupted double-linked list: 0x00007fae434565a0 *** > > > > Am I alone? Doesn't solve this issue, but shouldn't we use _SAFE in object_property_del_child? Like this: ---> qemu: use safe list macro As we might remove an element from list, use the safe macro to walk it. Signed-off-by: Michael S. Tsirkin Reviewed-by: Paolo Bonzini diff --git a/qom/object.c b/qom/object.c index 5e5b261..8b64fb6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -299,9 +299,9 @@ static void object_property_del_all(Object *obj) static void object_property_del_child(Object *obj, Object *child, Error **errp) { - ObjectProperty *prop; + ObjectProperty *prop, *next; - QTAILQ_FOREACH(prop, &obj->properties, node) { + QTAILQ_FOREACH_SAFE(prop, &obj->properties, node, next) { if (!strstart(prop->type, "child<", NULL)) { continue; }