qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() fail


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() failure
Date: Tue, 18 Feb 2014 10:17:59 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Feb 18, 2014 at 11:07:53AM +0100, Paolo Bonzini wrote:
> Il 18/02/2014 10:05, Stefan Hajnoczi ha scritto:
> >>> SIGABRT is normally synchronous enough: it's sent by abort().  But of
> >>> course, nothing stops the user from kill -ABRT.  Or GLib from calling
> >>> abort() in some place where an attempt to reenter it crashes & burns.
> >>> Not sure I'd care, but I'm pretty sure I don't care for freeing stuff on
> >>> exit :)
> >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.
> 
> If malloc aborts due to a double free or other similar problem, you
> may risk reentering it.

If you register the custom SIGABRT handler with sigaction + SA_RESETHAND
then you'd avoid the re-entrancy risk, since a cascading SIGABRT would
get handled by the system default handler, which would immediately
terminate the process.

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 :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]