From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL v4 00/35] Misc patches for 2018-12-21
Date: Fri, 4 Jan 2019 12:01:40 +0100 [thread overview]
Message-ID: <d8bb4435-7b69-04e9-2b4a-4cfdd439ecea@redhat.com> (raw)
In-Reply-To: <CAFEAcA9tiqHEiCdUXWcD+SvzUzZPG4sTqiTSR57N=qYM49eykw@mail.gmail.com>
On 04/01/19 11:06, Peter Maydell wrote:
> On Fri, 4 Jan 2019 at 07:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 03/01/19 19:37, Peter Maydell wrote:
>>> On Sat, 22 Dec 2018 at 08:41, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>> Interestingly, I have today run into "make: write error: stdout"
>>> with the existing make check infrastructure. [...]
>>> I presume that something in one of the tests we're running,
>>> likely QEMU itself, ends up setting stdout to non-blocking.
>>> This while rune *used* to be entirely reliable, so maybe
>>> something recent has changed ?
>>
>> I don't know... I tried running make check under "strace -e fcntl" and I
>> didn't find any occurrences of fcntl(1, O_SETFL, ...|O_NONBLOCK).
>> Perhaps you can add a check after every invocation of a test executable.
>
>> Are you going to apply the pull request since the bug is preexisting?
>
> The pull request takes the problem from "occasionally shows up
> in by-hand running of make check in a while loop" to "reliably
> causes my automated tests to fail every time". I can't apply
> a pullreq that does that, so we need to find at least a workaround.
The certain workaround is to clear O_NONBLOCK before invoking make,
possibly by placing a wrapper in ~/bin:
import os
from fcntl import *
fcntl(1, F_SETFL, fcntl(1, F_GETFL) & ~os.O_NONBLOCK)
If you're using --output-sync, *not* using it might work, but not if the
write error occurs when writing the command (as opposed to the output).
For what it's worth, I think the latest version of Make is still
susceptible when using --output-sync. The loop that flushes the
temporary buffer to stdout or stderr is as follows:
while (1)
{
int len;
EINTRLOOP (len, read (from, buffer, sizeof (buffer)));
if (len < 0)
perror ("read()");
if (len <= 0)
break;
if (fwrite (buffer, len, 1, to) < 1)
{
perror ("fwrite()");
break;
}
fflush (to);
}
Maybe it's one of the dependencies of QEMU that is causing it.
Paolo
> I'm not sure why your test harness makes it much more likely
> that the problem manifests.
next prev parent reply other threads:[~2019-01-04 11:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-21 12:36 [Qemu-devel] [PULL v4 00/35] Misc patches for 2018-12-21 Paolo Bonzini
2018-12-21 12:36 ` [Qemu-devel] [PULL 22/35] test: execute g_test_run when tests are skipped Paolo Bonzini
2018-12-21 12:36 ` [Qemu-devel] [PULL 23/35] test: replace gtester with a TAP driver Paolo Bonzini
2018-12-21 21:09 ` [Qemu-devel] [PULL v4 00/35] Misc patches for 2018-12-21 Peter Maydell
2018-12-22 8:41 ` Paolo Bonzini
2018-12-22 11:26 ` Peter Maydell
2019-01-03 18:37 ` Peter Maydell
2019-01-04 7:59 ` Paolo Bonzini
2019-01-04 10:06 ` Peter Maydell
2019-01-04 11:01 ` Paolo Bonzini [this message]
2019-01-04 11:31 ` Peter Maydell
2019-01-04 12:59 ` Paolo Bonzini
2019-01-04 13:03 ` Peter Maydell
2019-01-04 13:34 ` Paolo Bonzini
2019-01-04 13:45 ` 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=d8bb4435-7b69-04e9-2b4a-4cfdd439ecea@redhat.com \
--to=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).