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

Re: [Bug] Test 1450.91 Fails on NonStop

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 15, 2023, 19:10 UTC
Message-ID
<xmqqwn4iycbt.fsf@gitster.g>
In-Reply-To
<000801d9416e$4bf844b0$e3e8ce10$@nexbridge.com>
<rsbecker@nexbridge.com> writes:
Show 9 quoted lines
> So, this looks like we do not have to hold the 2.39.2 release for this problem. I will 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.

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).

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;
Previous: rsbecker@nexbridge.comNext: rsbecker@nexbridge.com
Message 5 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.