Received: from eggs.gnu.org ([2001:4830:134:3::10]:41279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VotFk-0002hl-3G for qemu-devel@nongnu.org; Fri, 06 Dec 2013 06:07:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VotFe-00032V-51 for qemu-devel@nongnu.org; Fri, 06 Dec 2013 06:07:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VotFd-00032M-TD for qemu-devel@nongnu.org; Fri, 06 Dec 2013 06:07:18 -0500 From: Markus Armbruster References: <1385031835-4472-1-git-send-email-stefanha@redhat.com> Date: Fri, 06 Dec 2013 12:07:14 +0100 In-Reply-To: <1385031835-4472-1-git-send-email-stefanha@redhat.com> (Stefan Hajnoczi's message of "Thu, 21 Nov 2013 12:03:53 +0100") Message-ID: <877gbijl0d.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 0/2] qtest: don't leak pid files and UNIX domain sockets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Andreas Faerber , Gerd Hoffmann Stefan Hajnoczi writes: > GLib uses abort(3) to exit failed test cases. As a result, the pid file and > UNIX domain sockets for a running test are leaked upon failure. > > Since abort(3) does not call atexit(3) handler functions, we could set up a > SIGABRT handler that performs cleanup. But there are other conditions where > processes die, like SIGSEGV or SIGBUS. > > Let's unlink pid files and UNIX domain sockets as soon as the QEMU process has > initialized and connections have been made. This eliminates the possibility of > leaking these files. > > Note that the actual QEMU process is orphaned when a test case fails. This > series does not fix that problem. I guess for more reliable and complete cleanup, we'd need a monitor process that adopts and handles orphans, and removes left-behind files. To make the latter work, tests must create files only in a temporary directory the monitor process can then remove wholesale. Anyway, this series is a welcome improvement. Reviewed-by: Markus Armbruster