qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Hajnoczi <stefanha@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/2] qtest: don't leak pid files and UNIX domain sockets
Date: Mon, 03 Feb 2014 12:10:01 +0100	[thread overview]
Message-ID: <52EF7909.4060601@suse.de> (raw)
In-Reply-To: <20140203095448.GB11167@stefanha-thinkpad.redhat.com>

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 <stefanha@redhat.com> wrote:
>>> 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.
>>
>> So looking back through mailing list history suggests that these patches
>> are supposed to avoid intermittent make check failures like:
>>
>> TEST: tests/qom-test... (pid=5078)
>>   /i386/qom/none:                                                      **
>> ERROR:/home/petmay01/linaro/qemu-for-merges/tests/libqtest.c:71:init_socket:
>> assertion failed (ret != -1): (-1 != -1)
>> FAIL
>> GTester: last random seed: R02S79ea313790bc9a8b21d9af5ed55c2fff
>> (pid=5080)
>>   /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?
> 
> 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?
> 
> Stefan
> 


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

  parent reply	other threads:[~2014-02-03 11:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 11:03 [Qemu-devel] [PATCH 0/2] qtest: don't leak pid files and UNIX domain sockets Stefan Hajnoczi
2013-11-21 11:03 ` [Qemu-devel] [PATCH 1/2] qtest: unlink QEMU pid file after startup Stefan Hajnoczi
2013-12-06 10:59   ` Markus Armbruster
2013-11-21 11:03 ` [Qemu-devel] [PATCH 2/2] qtest: unlink UNIX domain sockets after connecting Stefan Hajnoczi
2013-12-05 15:57 ` [Qemu-devel] [PATCH 0/2] qtest: don't leak pid files and UNIX domain sockets Stefan Hajnoczi
2013-12-06 11:07 ` Markus Armbruster
2014-01-31  0:07 ` Peter Maydell
2014-01-31 10:56   ` Stefan Hajnoczi
2014-02-03  9:00     ` Gerd Hoffmann
2014-02-03  9:54   ` Stefan Hajnoczi
2014-02-03 10:30     ` Peter Maydell
2014-02-03 15:22       ` Stefan Hajnoczi
2014-02-03 11:10     ` Andreas Färber [this message]
2014-02-03 11:24       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52EF7909.4060601@suse.de \
    --to=afaerber@suse.de \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).