qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] qtest: fix crash if SIGABRT during qtest_in


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 2/2] qtest: fix crash if SIGABRT during qtest_init()
Date: Thu, 13 Mar 2014 21:10:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Am 13.03.2014 10:41, schrieb Stefan Hajnoczi:
> If an assertion fails during qtest_init() the SIGABRT handler is
> invoked.  This is the correct behavior since we need to kill the QEMU
> process to avoid leaking it when the test dies.
> 
> The global_qtest pointer used by the SIGABRT handler is currently only
> assigned after qtest_init() returns.  This results in a segfault if an
> assertion failure occurs during qtest_init().
> 
> Move global_qtest assignment inside qtest_init().  Not pretty but let's
> face it - the signal handler dependeds on global state.
> 
> Reported-by: Marcel Apfelbaum <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  tests/libqtest.c | 3 ++-
>  tests/libqtest.h | 4 +---
>  2 files changed, 3 insertions(+), 4 deletions(-)

Thanks, applied to qom-next (with typo fix):
https://github.com/afaerber/qemu-cpu/commits/qom-next

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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