From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK7LA-0002M5-3g for qemu-devel@nongnu.org; Mon, 04 Jul 2016 13:07:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK7L5-00061h-QW for qemu-devel@nongnu.org; Mon, 04 Jul 2016 13:07:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK7L5-00061d-Kv for qemu-devel@nongnu.org; Mon, 04 Jul 2016 13:07:19 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CAF13B716 for ; Mon, 4 Jul 2016 17:07:19 +0000 (UTC) Date: Mon, 4 Jul 2016 18:07:15 +0100 From: "Daniel P. Berrange" Message-ID: <20160704170715.GO3763@redhat.com> Reply-To: "Daniel P. Berrange" References: <20160704153823.16879-1-marcandre.lureau@redhat.com> <20160704163139.GM3763@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] char: do not use atexit cleanup handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: marcandre.lureau@redhat.com, qemu-devel@nongnu.org On Mon, Jul 04, 2016 at 06:46:47PM +0200, Paolo Bonzini wrote: > > > On 04/07/2016 18:31, Daniel P. Berrange wrote: > >> > Instead of using a atexit() handler, only run the chardev cleanup as > >> > initially proposed at the end of main(), where there are less chances > >> > (hic) of conflicts or other races. > > This doesn't really seem all that much safer. There's still plenty of > > chance that threads are running in the background at the end of the > > main() method, so plenty of scope for the qemu_chr_cleanup() call to > > cause threads to segv by destroying the chardevs they're using behind > > their back. > > At this point you have stopped all CPUs and block devices. There is not > much else that is going on in QEMU at all, at this point. The solution > would be to stop those threads. What about graphics threads ? In particular I'd be thinking of spice which uses threads and chardevs. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|