From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAHPl-0001kP-Sr for qemu-devel@nongnu.org; Mon, 03 Feb 2014 06:10:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAHPe-0001DV-JH for qemu-devel@nongnu.org; Mon, 03 Feb 2014 06:10:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41382 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAHPe-00017z-Dh for qemu-devel@nongnu.org; Mon, 03 Feb 2014 06:10:02 -0500 Message-ID: <52EF7909.4060601@suse.de> Date: Mon, 03 Feb 2014 12:10:01 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1385031835-4472-1-git-send-email-stefanha@redhat.com> <20140203095448.GB11167@stefanha-thinkpad.redhat.com> In-Reply-To: <20140203095448.GB11167@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 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 , Peter Maydell Cc: QEMU Developers , Gerd Hoffmann Am 03.02.2014 10:54, schrieb Stefan Hajnoczi: > On Fri, Jan 31, 2014 at 12:07:34AM +0000, Peter Maydell wrote: >> On 21 November 2013 11:03, Stefan Hajnoczi wrote= : >>> GLib uses abort(3) to exit failed test cases. As a result, the pid f= ile and >>> UNIX domain sockets for a running test are leaked upon failure. >>> >>> Since abort(3) does not call atexit(3) handler functions, we could se= t up a >>> SIGABRT handler that performs cleanup. But there are other condition= s where >>> processes die, like SIGSEGV or SIGBUS. >>> >>> Let's unlink pid files and UNIX domain sockets as soon as the QEMU pr= ocess has >>> initialized and connections have been made. This eliminates the poss= ibility of >>> leaking these files. >> >> So looking back through mailing list history suggests that these patch= es >> are supposed to avoid intermittent make check failures like: >> >> TEST: tests/qom-test... (pid=3D5078) >> /i386/qom/none: = ** >> ERROR:/home/petmay01/linaro/qemu-for-merges/tests/libqtest.c:71:init_s= ocket: >> assertion failed (ret !=3D -1): (-1 !=3D -1) >> FAIL >> GTester: last random seed: R02S79ea313790bc9a8b21d9af5ed55c2fff >> (pid=3D5080) >> /i386/qom/pc: = OK >> /i386/qom/isapc: = OK >> /i386/qom/q35: = OK >> FAIL: tests/qom-test >> >> but this patch series doesn't actually say that's what it's for, >> so does it fix that kind of error? >=20 > I still think we should merge these patches :). +1 As an explanation, the temporary files contain the PID. When they remain behind due to test failure *and* the PID wraps around and file names thus happen to match, the error was triggered, and thereby not on each run but seemingly "sometimes". I am not 100% familiar with the unlinking and code ordering here, but it had looked sane to me back when I looked at it, I just didn't feel confident enough for a Reviewed-by. I could give it a spin and add a Tested-by if that reassures PMM. Andreas > Are you happy to merge > them? >=20 > Stefan >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg