From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HL1nj-00071Y-QI for qemu-devel@nongnu.org; Sat, 24 Feb 2007 13:39:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HL1nh-00071J-8P for qemu-devel@nongnu.org; Sat, 24 Feb 2007 13:39:18 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HL1nh-00071G-3v for qemu-devel@nongnu.org; Sat, 24 Feb 2007 13:39:17 -0500 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HL1ng-0007CD-Oq for qemu-devel@nongnu.org; Sat, 24 Feb 2007 13:39:16 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l1OIdGPU015903 for ; Sat, 24 Feb 2007 13:39:16 -0500 Received: from file.surrey.redhat.com (file.surrey.redhat.com [172.16.10.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l1OIdFHe013030 for ; Sat, 24 Feb 2007 13:39:15 -0500 Received: (from berrange@localhost) by file.surrey.redhat.com (8.13.1/8.13.1/Submit) id l1OIdEXl016802 for qemu-devel@nongnu.org; Sat, 24 Feb 2007 18:39:14 GMT Date: Sat, 24 Feb 2007 18:39:14 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH] Make removing IOHandlers safe from within an IOHandler Message-ID: <20070224183914.GA15380@redhat.com> References: <45E07BC9.1080209@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45E07BC9.1080209@codemonkey.ws> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sat, Feb 24, 2007 at 11:54:17AM -0600, Anthony Liguori wrote: > I was getting random SEGVs when disconnecting from the VNC server. I > tracked it down to the fact that if you remove a IOHandler from another > IOHandler, all sorts of badness may result as you're removing entries > from a linked list while transversing it. > > My solution is to simply add a deleted flag to each entry and walk the > list a second time. During the second transversal, we'll remove nodes > that need removing. > > Haven't seen the SEGV since I started using this patch. That's pretty much identical solution to the one I just posted along with the patches for VNC TLS support, so I can also confirm this approach works & solves the SEGV issue. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|