From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFlpE-0004QN-7V for qemu-devel@nongnu.org; Tue, 18 Feb 2014 09:39:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFlp5-00008m-QZ for qemu-devel@nongnu.org; Tue, 18 Feb 2014 09:39:08 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:57632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFlp5-00008h-JW for qemu-devel@nongnu.org; Tue, 18 Feb 2014 09:38:59 -0500 Received: by mail-wi0-f171.google.com with SMTP id cc10so3553587wib.10 for ; Tue, 18 Feb 2014 06:38:58 -0800 (PST) Date: Tue, 18 Feb 2014 15:38:56 +0100 From: Stefan Hajnoczi Message-ID: <20140218143856.GB15348@stefanha-thinkpad.redhat.com> References: <1392651898-16749-1-git-send-email-stefanha@redhat.com> <1392651898-16749-4-git-send-email-stefanha@redhat.com> <530235F0.2040406@redhat.com> <87a9dpsmi4.fsf@blackfin.pond.sub.org> <20140218090504.GB32585@stefanha-thinkpad.redhat.com> <87r470ivlm.fsf@blackfin.pond.sub.org> <530334AF.30206@redhat.com> <87txbwg0qp.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87txbwg0qp.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Stefan Hajnoczi , qemu-devel@nongnu.org, Anthony Liguori , Paolo Bonzini , Andreas Faerber On Tue, Feb 18, 2014 at 11:43:10AM +0100, Markus Armbruster wrote: > Paolo Bonzini writes: > > > Il 18/02/2014 11:05, Markus Armbruster ha scritto: > >>> > Yes, SIGABRT is synchronous for all purposes. So the only danger is > >>> > that g_string_free() or g_free() could fail while we're in > >>> > g_assert(false). But they don't, which makes sense because they are > >>> > totally unrelated to g_assert() and therefore can handle re-entrancy. > >> The (theoretical!) problem is when it aborts in the bowels of g_*free(), > >> and your SIGABRT handler reenters g_*free(). > >> > >>> > In practice there is no issue and I've tested assertion failure with > >>> > glib 1.2.10. > >> Worst that can happen is we crash on the way from abort() to process > >> termination. Tolerable. > > > > What about recursive locking of a non-recursive mutex? > > You're right, deadlock is possible. Strengthens the argument for: > > >> Still, avoiding unnecessary cleanup on that path seems prudent to me. > >> If you agree, factor out the kill()/waitpid(), and call only that from > >> the signal handler. Okay, I'm convinced.