From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFQsR-0008G7-4m for qemu-devel@nongnu.org; Mon, 17 Feb 2014 11:17:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFQsI-0004Nv-OC for qemu-devel@nongnu.org; Mon, 17 Feb 2014 11:17:03 -0500 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:58567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFQsI-0004Mw-Hk for qemu-devel@nongnu.org; Mon, 17 Feb 2014 11:16:54 -0500 Received: by mail-ea0-f176.google.com with SMTP id b10so3238010eae.35 for ; Mon, 17 Feb 2014 08:16:52 -0800 (PST) Sender: Paolo Bonzini Message-ID: <530235F0.2040406@redhat.com> Date: Mon, 17 Feb 2014 17:16:48 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1392651898-16749-1-git-send-email-stefanha@redhat.com> <1392651898-16749-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1392651898-16749-4-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , Andreas Faerber , Anthony Liguori Il 17/02/2014 16:44, Stefan Hajnoczi ha scritto: > } > > +static void sigabrt_handler(int signo) > +{ > + qtest_end(); > +} > + void qtest_quit(QTestState *s) { int status; if (s->qemu_pid != -1) { kill(s->qemu_pid, SIGTERM); waitpid(s->qemu_pid, &status, 0); } close(s->fd); close(s->qmp_fd); g_string_free(s->rx, true); g_free(s); } Not async-signal safe. You need to ignore the g_string_free and g_free (perhaps even the closes) if calling from the sigabrt_handler. Paolo