git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: rsbecker@nexbridge.com, 'Git List' <git@vger.kernel.org>
Subject: Re: [Bug] Test 1450.91 Fails on NonStop
Date: Wed, 15 Feb 2023 14:59:49 -0500	[thread overview]
Message-ID: <Y+05tTHdj2Jzenge@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqwn4iycbt.fsf@gitster.g>

On Wed, Feb 15, 2023 at 11:10:14AM -0800, Junio C Hamano wrote:

> > + test-tool genzeros 104857601
> > fatal: write(): Invalid function argument
> >
> > That explains it. We had to push the use of xwrite() because of
> > issues associated with writing large buffers exceeding through
> > write(). We could use MAX_IO_SIZE to limit the write size (at
> > least on NonStop) into acceptable chunks.
> 
> True.
> 
> Curious that this use of write(2) is from late 2021 and its uses in
> tests came from the same era (e.g. t1051 has two calls added in the
> same timeperiod).  So it is nothing new even to your platform, I
> suspect.

I think the latent problem was always there, but almost every call to
"test-tool genzeros" is gated on the EXPENSIVE prerequisite, and the
remainder are quite small. This is the first one that is always run, and
is bigger than the 256k buffer.

(This test actually _is_ kind of slow, so one might argue it should be
marked as EXPENSIVE, too, but obviously that is orthogonal).

> diff --git c/t/helper/test-genzeros.c w/t/helper/test-genzeros.c
> index 8ca988d621..9a1d3ee221 100644
> --- c/t/helper/test-genzeros.c
> +++ w/t/helper/test-genzeros.c
> @@ -17,12 +17,12 @@ int cmd__genzeros(int argc, const char **argv)
>  
>  	/* Writing out individual NUL bytes is slow... */
>  	while (count < 0)
> -		if (write(1, zeros, ARRAY_SIZE(zeros)) < 0)
> +		if (xwrite(1, zeros, ARRAY_SIZE(zeros)) < 0)
>  			return -1;

Sheesh. It even occurred to me with the big buffer that write limits
could be the problem, but I thought to myself, "no, we have MAX_IO_SIZE"
for that. The fact that this was write() and not xwrite() totally
escaped my notice. :)

So yeah, this seems like an obvious good fix. Using write_or_die() might
be even better, as it would report errors rather than quietly returning
non-zero.

We could also move test-tool away from the left-hand side of the pipe in
the test, which might have made this easier to diagnose. But not
significantly so, and it makes the test even less efficient than it
already is.

-Peff

  parent reply	other threads:[~2023-02-15 19:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 17:44 [Bug] Test 1450.91 Fails on NonStop rsbecker
2023-02-15 17:59 ` rsbecker
2023-02-15 18:02 ` Jeff King
2023-02-15 18:49   ` rsbecker
2023-02-15 19:10     ` Junio C Hamano
2023-02-15 19:41       ` rsbecker
2023-02-15 19:59       ` Jeff King [this message]
2023-02-16  1:45         ` Junio C Hamano
2023-02-16  2:56           ` [PATCH] test-genzeros: avoid raw write(2) Junio C Hamano
2023-02-16  4:34             ` Jeff King
2023-02-16 16:09               ` Junio C Hamano
2023-02-16 16:14                 ` rsbecker

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=Y+05tTHdj2Jzenge@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rsbecker@nexbridge.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).