From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WALn9-0005Eu-QK for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:50:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WALn3-0008Ir-KK for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:50:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WALn3-0008Ik-CO for qemu-devel@nongnu.org; Mon, 03 Feb 2014 10:50:29 -0500 From: Stefan Hajnoczi Date: Mon, 3 Feb 2014 16:20:12 +0100 Message-Id: <1391440814-22229-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 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: qemu-devel@nongnu.org Cc: Peter Maydell , Andreas Faerber , Anthony Liguori This pull request has been rebased onto qemu.git/master and retested. The series fixes init_socket() failures when reused PIDs cause temporary file name collisions. 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. Stefan Hajnoczi (2): qtest: unlink QEMU pid file after startup qtest: unlink UNIX domain sockets after connecting tests/libqtest.c | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) -- 1.8.5.3