git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [Bug] Test 1450.91 Fails on NonStop

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Feb 15, 2023, 19:41 UTC
Message-ID
<001301d94175$8baf97a0$a30ec6e0$@nexbridge.com>
In-Reply-To
<xmqqwn4iycbt.fsf@gitster.g>
On Wednesday, February 15, 2023 2:10 PM, Junio C Hamano wrote:
><rsbecker@nexbridge.com> writes:
>
>> So, this looks like we do not have to hold the 2.39.2 release for this
problem. I will
Show 13 quoted lines
>run the packaging job for the platform release.
>>
>> + 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 have been looking at the past log (pre-2.39) and this test has not failed previously - although git blame on t1450 shows 6-Feb-2023, so that might be why I've not seen this previously. It is possible test-genzeros was not used in this way previously.

>There are a handful of raw write() in reftable implementation whose size I
am not
>sure about (and I am not touching), and a deliberate use of it in
trace2/tr2_dst.c that
>is well explained (and I do not think touching is a good idea).  Everything
else looks
>like they are aware that they are making a short write, but some of them
might still
>want to become xwrite() to benefit from auto retrying a short write (which
I didn't
>check).

I would not want to touch those either, although I do keep an eye out for new write() usage and whine about it if I notice. ;-)

Show 25 quoted lines
>In any case, I think the attached is a sensible first step to have.
>
> t/helper/test-genzeros.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>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;
>
> 	while (count > 0) {
>-		n = write(1, zeros, count < ARRAY_SIZE(zeros) ?
>-			  count : ARRAY_SIZE(zeros));
>+		n = xwrite(1, zeros, count < ARRAY_SIZE(zeros) ?
>+			   count : ARRAY_SIZE(zeros));
>
> 		if (n < 0)
> 			return -1;

This works well as a fix. Please go with it with my blessing. --Randall

Previous: Junio C HamanoNext: Jeff King
Message 6 of 12 in “[Bug] Test 1450.91 Fails on NonStop”
  1. rsbecker@nexbridge.comFeb 15, 2023
  2. rsbecker@nexbridge.comFeb 15, 2023
  3. Jeff KingFeb 15, 2023
  4. rsbecker@nexbridge.comFeb 15, 2023
  5. Junio C HamanoFeb 15, 2023
  6. rsbecker@nexbridge.comFeb 15, 2023
  7. Jeff KingFeb 15, 2023
  8. Junio C HamanoFeb 16, 2023
  9. test-genzeros: avoid raw write(2)Junio C Hamano, Feb 16, 2023
  10. Jeff KingFeb 16, 2023
  11. Junio C HamanoFeb 16, 2023
  12. rsbecker@nexbridge.comFeb 16, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.